I was given a shapefile at work with the information that it is in Lambert Azimuth Equal Area (LAEA) projection (EPSG 9820). After some research on the web, I found out that EPSG 9820 is a generic EPSG for all LAEA projections [1].
The *.prj like this:


Is there a way how I can figure out the EPSG code based on the *.prj file with open source tools?

[1] http://www.osgeo.org/pipermail/gdal-dev/2008-January/015519.html

  • I am pretty sure this doesn't have an EPSG WKID. It doesn't have an Esri WKID. Esri (we) have started inserting an AUTHORITY tag at the end of the well-known text: AUTHORITY["ESRI",102100] for instance. If it's not there, you would probably need the projection engine library to do a look-up or have a current set of wkt to compare against. www.spatialreference.org will output various styles but I don't know how you could mine the information. – mkennedy Jul 1 '11 at 15:32

There may not be an EPSG code for a specific LAEA, unless some agency has used it (such as a national geological organization, or a petroleum company), and the EPSG (or other authority such as ESRI or OGC), have assigned it a code, and someone has had the need to put it into the database for their application.

The clue is in the central_meridian parameter, which in your case is -75, and the Latitude_Of_Origin parameter (which point to a Peru-centred map). A LAEA projection must specify these lines, but they can be anywhere on the globe, so there would have to be infinite number of authority codes to cover them all!

It must be remembered that EPSG codes aren't "magic", they are only a convenience in looking up the projection parameters in a database (and as a shorthand when talking to colleagues); and it is these parameters that are used to transform the data from one CS/projection to another.

What you could do if you use this projection often, is to assign your own codes in whichever database you use. Proj.4 (which is the de facto library for cartographic projection) allows you to create your own text file databases mapping codes to projection parameters, or even append to an existing one like the file called epsg in the Proj.4 directory. An example of this is the "Google" Spherical Mercator projection that was originally assigned to EPSG:900913 which is way off the bottom of the official list. Eventually the EPSG adopted it and gave it the official code EPSG:3857

  • +1 Good discussion and analysis which actually answers the question and clears up much of the confusion. – whuber Jul 12 '11 at 13:48

According to http://prj2epsg.org/search there are 4404 EPSG SRIDs for that WKT projection.

  • That narrows it down! :-) (The search looks worthless to me: the projections it returns match the target text in some, but not all, aspects.) – whuber Jul 1 '11 at 13:14

If using GDAL, the command ogrinfo might give the information you need. In a Linux box:

$ ogrinfo -al /path/to/myshapefile.shp

If available, you will find the information you are looking for in the first lines of the command output.

GDAL is available for MS Windows via FWTools.

  • This tool appears just to read what is in the .prj file. – whuber Jul 1 '11 at 13:20
  • After some research, I have also the same impression. – dariapra Jul 2 '11 at 11:31

I would try using Quantum GIS - www.qgis.org. It is able to read and write shapefiles, as well as other spatial formats. When you add a shapefile vector layer, it reads the .prj file and shows what projection it is in, under properties. I think that it also lists the EPSG code as well. I think it tries to assign the best matching EPSG code based on parsing the .prj file.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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