Figure out SRID of the data
You will notice one of the files it extracts is called TOWNS_POLY.prj
. A .prj
is often included with ESRI shape files and tells you the projection of the data. We'll need to match this descriptive projection to an SRID (the id field of a spatial ref record in the spatial_ref_sys table) if we ever want to reproject our data.
Open up the .prj file in a text editor. You'll see something like NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001
and UNIT["Meter",1.0]
Open up your PgAdmin III query tool and type in the following statement
select srid, srtext, proj4text from spatial_ref_sys where srtext ILIKE '%Massachusetts%'
And then click the green arrow. This will bring up about 10 records.
Note the srid of the closest match. In this case its 26986.
NOTE: srid is not just a PostGIS term. It is an OGC standard so you will see SRID mentioned a lot in other spatial databases, gis webservices and applications. Most of the common spatial reference systems have globally defined numbers. So 26986 always maps to NAD83_StatePlane_Massachusetts_Mainland_FIPS_2001 Meters. Most if not all MassGIS data is in this particular projection.
Source