I have a shapefile with the following .prj file:
PROJCS["NAD_1927_Albers",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]
When I run the following python code:
srs = osr.SpatialReference()
if ( srs.ImportFromWkt( prjText ) != 0 ):
return "error"
srsProj4 = srs.ExportToProj4()
sourceProjection = pyproj.Proj( srsProj4, preserve_units=True )
the variable srsProj4
, as returned from srs.ExportToProj4()
, is an empty string.
When I look here: http://www.gdal.org/ogr/classOGRSpatialReference.html
it says that ExportToProj4()
returns an empty string in the case the srs is in a local (non-geo-referenced) coordinate system. But as far as I understand, the text in the .prj file (above) is a valid, regular geo projection.
This code works with other .prj files I've used. Can you tell what's special about this one that's making it fail?
Thanks.
osr.UseExceptions()
. The error is: RuntimeError: No translation for Albers to PROJ.4 format is known. This is possibly a bug.