Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question already has an answer here:

I have to work with a shapefile defined in an unusual projection, which my GIS software does not know about. How can I get the proj4 definition or the EPSG code for the projection?

share|improve this question
    
Check online EPSG registry? Perhaps search by area of use. epsg-registry.org –  mkennedy Mar 22 '13 at 18:16
add comment

marked as duplicate by Devdatta Tengshe, whuber Jun 26 '13 at 3:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

up vote 3 down vote accepted

The shapefile should have a .prj file which defines the projection. You can use it together with one of the following 3 options to get either the proj4 string, WKT definition or EPSG code.

To get proj4 definition:

If you have gdal installed on your system, you can use the gdalsrsinfo command line application to get the proj4 definition as the OGC WKT definition:

$ gdalsrsinfo <shapefile>.prj

Exampe:

$ gdalsrsinfo 7490.prj 

PROJ.4 : '+proj=aea +lat_1=-18 +lat_2=-32 +lat_0=0 +lon_0=24 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs '

OGC WKT :
PROJCS["Albers_Equal_Area_Conic_South_Africa",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["False_Easting",0],
    PARAMETER["False_Northing",0],
    PARAMETER["longitude_of_center",24],
    PARAMETER["Standard_Parallel_1",-18],
    PARAMETER["Standard_Parallel_2",-32],
    PARAMETER["latitude_of_center",0],
    UNIT["Meter",1]]

To get EPSG number:

You can use the prj2epsg.org service to upload the .prj file and get a list of matching EPSG codes. Warning: prj2epsg.org returns the list of codes which match best. It may be that none of them are correct.

Using python:

If you are comfortable with Python, you can use the very useful script at Shapefile PRJ to PostGIS SRID lookup table? to get the WKT, proj4 string and EPSG code.

See also:

You can find definitions for most standard projections at spatialreference.org.

share|improve this answer
add comment

I've always used grep to grab this information:

gdalinfo <shapefile>.shp | grep -e "ESPG"
share|improve this answer
    
only possible in linux :) –  Curlew Mar 22 '13 at 15:05
2  
and Mac OS X :) –  ShaunLangley Mar 22 '13 at 15:31
add comment

The gdal app gdalsrsinfo produces many different representations of an srs:

kyle@kyle-hp-desktop:~$ gdalsrsinfo epsg:4326 -o all

PROJ.4 : '+proj=longlat +datum=WGS84 +no_defs '

OGC WKT :
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

OGC WKT (simple) :
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

OGC WKT (no CT) :
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

ESRI WKT :
GEOGCS["GCS_WGS_1984",
    DATUM["D_WGS_1984",
        SPHEROID["WGS_1984",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.017453292519943295]]

...

You can input proj.4 strings, wkt strings or epsg codes. Since gdal 1.9 (I think).

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.