[gdal-dev] OSR Projection Error 6

Frank Warmerdam warmerdam at pobox.com
Sun Oct 10 23:05:45 EDT 2010


Jay L. wrote:
> Morning all,
> 
> I am struggling to get a coordinate transformation to work in a python 
> script.  Below is the code snippet that is causing the following error:
> 
> "ERROR 6: No translation for 'Azimuthal_Equidistant' to PROJ.4 format is 
> known."
> 
> I am pulling the input spatial reference from the input shapefile 
> (Mars_2000), defining the custom projection (custom in that it is 
> centered on a point), and then trying to transform to the custom projection.
> 
>     Create a new shapefile and copy, one geometry at a time, from the
>     input to the new output
>     ...
>     #Define the new projection to ortho centered on the crater
>         azimuthal =
>     "PROJCS['Azimuthal_Equidistant',GEOGCS['GCS_Mars_2000',DATUM['D_Mars_2000',SPHEROID['Mars_2000_IAU_IAG',3396190.0,169.8944472236118]],PRIMEM['Reference_Meridian',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Azimuthal_Equidistant'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',%f],PARAMETER['Latitude_Of_Origin',%f],UNIT['Meter',1.0]]"
>     %(x,y)
>        
>         intermediate_SR.ImportFromWkt(azimuthal)
>        
>         #Transform the point from the spatial input reference to an
>     azimuthal projection centered on the point
>         outputGeom.TransformTo(intermediate_SR)
>     ...
> 
> Do I need to define the coordinate system differently or am I making an 
> error somewhere else?

Jay,

The problem is that this is an ESRI projection engine string.  These
are similar but sometimes incompatible with OGR WKT.  After importing
it, call morphFromESRI().

eg.
          intermediate_SR.ImportFromWkt(azimuthal)
          intermediate_SR.MorphFromESRI()

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list