Skip to content

Instantly share code, notes, and snippets.

@samgranieri
Created March 31, 2009 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samgranieri/88465 to your computer and use it in GitHub Desktop.
Save samgranieri/88465 to your computer and use it in GitHub Desktop.
End Result: What are the Lat/Lng points for zipcode 60614's boundaries in chicago
I downloaded the shapefile from here
http://egov.cityofchicago.org:80/webportal/COCWebPortal/COC_ATTACH/zipcodes.zip
This page gave me directions on where to find the SRID
http://egov.cityofchicago.org:80/webportal/COCWebPortal/COC_ATTACH/Chicago_GIS_Addressing_Stds_May_19.pdf
1 Technical Mapping Specifications
Chicago GIS (Geographic Information Systems) Data conforms to the standards below:
Datum: NAD 83
Projection: State Plane Illinois East
FIPS Zone: 1201
Units: US Foot
Precision: 1:10,000 (1:1,000 is acceptable for most uses)
so I looked it up in spatial_ref_sys
select * from spatial_ref_sys
where srtext ilike '%illinois%'
order by srtext
and on the shell i ran
shp2pgsql -I -s26971 Zipcodes.shp zipcodes > zipcodes.sql; psql -f zipcodes.sql mydb
with the db populated, i executed this query
mydb=# select zip, asText(transform(the_geom, 26971 )) from zipcodes where zip = '60614';
zip | astext
-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
60614 | MULTIPOLYGON(((1175424.1 1918917.93,1175388.78 1918612.97,1175385 1918551.97,1175339.3 1918384.57,1175308.63 1918188.08,1175313.7 1917878.4,1175320.11 1917745.47,1175339.35 1917614.23,1175371.26 1917485.48,1175415.53 1917360.44,1175471.75 1917240.3,1175539.56 1917125.88,1175689.92 1916889.24,1175728.85 1916800.8,1175742.18 1916760.77,1175751.48 1916719.89,1175756.23 1916678.24,1175756.42 1916634.55,1175717.4 1916506.85,1175666.05 1916528.66,1175572.72 1916402,1175560.1 1916263.45,1175590.89 1915936.74,1175959.43 1915307.48,1175834.59 1915214.79,1175785.99 1915184.15,1175865.02 1915045.09,1176107.29 1914710.29,1176126.09 1914691.74,1175968.34 1914583.29,1176257.54 1914114.98,1176096.51 1914006.53,1176400.5 1913557.95,1176214.15 1913400.96,1176231.31 1913384.42,1176320.42 1913282.76,1176433.67 1913158.64,1176451.71 1913140.16,1176558.08 1913000.16,1176726.19 1913135.88,1176520.77 1912937.68,1176550.33 1912906.82,1176624 1912817.27,1177267.6 1912246.77,1177345.1 1912182.44,1177428.72 1912128.93,1177517.55 1912084.62,1177610.58 1912050.01,1177706.78 1912025.49,1177804.96 1912011.35,1177850.7 1912007.27,1177896.57 1912007.81,1177940.99 1912012.82,1178007.04 1912030.92,1178072.64 1912055.2,1178112.58 1912077.76,1178150.06 1912104.21,1178184.69 1912134.29,1178263.22 1912314.42,1178331.69 1912190.06,1178301.58 1911966.43,1178280.28 1911927.55,1178254.67 1911891.36,1178225.11 1911858.32,1178191.96 1911828.88,1178155.7 1911803.44,1178092.52 1911771.46,1178026.47 1911746.03,1177958.2 1911727.4,1177888.39 1911715.75,1177817.91 1911711.21,1177760.44 1911701.39,1177704.33 1911685.72,1177650.12 1911664.35,1177598.41 1911637.51,1177549.73 1911605.49,1177503.62 1911567.83,1177165.7 1911215.8,1176694.5 1911039.67,1175226.15 1910999.98,1174407.03 1910990.05,1172364.01 1910936.04,1172034.88 1910930.25,1171782.29 1910911.39,1171382.77 1910894.63,1170719.18 1910873.04,1168378.5 1910805.88,1168169.34 1911563.4,1168086.97 1911822.13,1168038.17 1912017.86,1167390.91 1912607.45,1167229.02 1912764.33,1166904.2 1912609.96,1166715.8 1912532.57,1166635.77 1912493.99,1166536.15 1912543.82,1166464.88 1912593.87,1166367.47 1912966.37,1166314.51 1913092.48,1165983.78 1913697.23,1165766.63 1913481.23,1165762.67 1913468.95,1165750.76 1913471.62,1165476.76 1913389.62,1165465.83 1913380.64,1165455.53 1913385.5,1165359.22 1913390.29,1165347.54 1913382.89,1165335 1913390.1,1165184.41 1913388.15,1165162.35 1913381.15,1165148.4 1913386.28,1164891.4 1913375.09,1164882.2 1913370.57,1164873.11 1913373.01,1164734.42 1913367.14,1164729.68 1913364.83,1164425.9 1913359.34,1164422.11 1913355.88,1164416.93 1913358.82,1164034.77 1913343.84,1162711.64 1913301.35,1162673.21 1914409.92,1162658.61 1914623.66,1162650.79 1914824.98,1162626.87 1915933.14,1162620.73 1915943.37,1162626.26 1915951.51,1162618.26 1916067.06,1162621.07 1916073.75,1162628.05 1916962.93,1162542.21 1918591.47,1163343.25 1918614.8,1165182.77 1918657.89,1170449.14 1918813.11,1171100.55 1918835.46,1171102.12 1918837.68,1172225.41 1918874.19,1172530.72 1918887.46,1172532.83 1918884.76,1172534.93 1918887.49,1173070.05 1918920.65,1173084.94 1918900.24,1173909.9 1918885.2,1174284.93 1918959.73,1174498.03 1919031.23,1174511.88 1919016.37,1174691.48 1919039.67,1174744.31 1919041.69,1174794.95 1919020.59,1174841.54 1918967.76,1174878.5 1918945.65,1174929.14 1918942.44,1174984.17 1918953.07,1175424.1 1918917.93)))
(1 row)
but google maps doesnt recognize these points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment