Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you know what SRID to use for a shp file?

I am trying to put a SHP file into my PostGIS database, the the data is just a little off. I think this is because I am using the wrong SRID. The contents of the PRJ file are as follows:

GEOGCS["GCS_North_American_1983", DATUM["D_North_American_1983", SPHEROID["GRS_1980",6378137.0,298.257222101]], PRIMEM["Greenwich",0.0], UNIT["Degree",0.0174532925199433]] 

What SRID does this correlate to? And more generally, how can I look up the SRID based on the information found in the PRJ file? Is there a lookup table somewhere that lists all SRID's and their 'geogcs' equivalents?

The data imported using srid=4269 and 4326 were the exact same results.

Does this mean I'm using the wrong SRID, or is this just expected margin of error?

The shp file is from here.

like image 621
priestc Avatar asked Oct 09 '09 00:10

priestc


People also ask

What is a SHP XML file?

shp. xml : the file that is the geospatial metadata in XML format, (e.g. ISO 19115 or XML format).


2 Answers

To elaborate on synecdoche's answer, the SRID is sometimes called an "EPSG" code. The SRID/EPSG code is a defacto short-hand for the Well-Known-Text representations of projections.

You can do a quick search on the SRID table to see if you can find an exact or similar match:
SELECT srid, srtext, proj4text FROM spatial_ref_sys WHERE srtext ILIKE '%BLAH%'

Above was found at http://www.bostongis.com/?content_name=postgis_tut01.

You can also search on spatialreference.org for these kinds of things. The search tool is primitive so you may have to use a Google search and specify the site, but any results will show you the ESRI PRJ contents, the PostGIS SQL INSERT, and a bunch of other representations.

I think your PRJ is at: http://spatialreference.org/ref/sr-org/15/

like image 131
James Schek Avatar answered Sep 19 '22 20:09

James Schek


Prj2EPSG is a small website aimed at exactly this problem; paste in the PRJ contents and it does its best to find a matching EPSG. They also have a web service API. It's not an exact science. They seem to use Lucene and the EPSG database to do text searches for matches.

like image 20
Nelson Avatar answered Sep 20 '22 20:09

Nelson