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?
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
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.
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.
You can find definitions for most standard projections at spatialreference.org.
I've always used
The gdal app gdalsrsinfo produces many different representations of an srs:
You can input proj.4 strings, wkt strings or epsg codes. Since gdal 1.9 (I think).