[postgis-users] Beginner question: Incorrect SRID?

Adrian Holovaty postgis at holovaty.com
Sun May 29 12:58:55 PDT 2005


Hello,

I've successfully imported the City of Chicago's ZIP code data into 
PostgreSQL/PostGIS, but when I try to transform() it in Postgres, I get 
longitude and latitude that appears to be way off. I suspect I'm importing it 
using the wrong SRID, but I'm not sure. I'm a beginner and would appreciate 
some help.

The Chicago GIS Web site from which I got the data (http://tinyurl.com/7qwad) 
says it follows the following standards:

   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)

I've used shp2pgsql to import the data with SRID 26971, which looks correct to 
my inexperienced eyes:

mapdatabase=# select * from spatial_ref_sys where srid=26971;
 26971 | EPSG      |     26971 | PROJCS["NAD83 / Illinois East", 
GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 
1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.66666666666666],PARAMETER["central_meridian",-88.33333333333333],PARAMETER["scale_factor",0.999975],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26971"]]                                       
| +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 
+x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

Here's the import command I used:

shp2pgsql -s 26971 Zipcodes.shp testtable > zipcodes.sql

Is this the correct SRID for this data? Do I have to do something special 
because the data standard uses "US Foot" as its units?

Raw data, in shapefile format, is here:
http://egov.cityofchicago.org/webportal/COCWebPortal/COC_ATTACH/zipcodes.zip

The query I'm running on the data to get longitude/latitude is:
select zip, asText(transform(the_geom, 4326)) from testtable limit 1;

That query returns:
MULTIPOLYGON(((-75.3136373094386 53.5032244406271,-75.3116700756851 
53.5029863825251 ...

...which corresponds to longitude and latitude somewhere in Canada instead of 
Chicago.

Thanks for any help.

Adrian



More information about the postgis-users mailing list