[Gdal-dev] Old style ESRI prj files

Frank Warmerdam warmerdam at pobox.com
Wed Nov 14 13:37:05 EST 2007


Ari Jolma wrote:
> Ethan Alpert kirjoitti:
>> I'm still in the debugger looking at what is going on hopefully I'll
>> come up with something. For now, it seems [$prj] although it is the type
>> expected by the wrapper, causes pszItem to always be NULL when it
>> fetches the list of strings. So arg2 contains no data when calling
>> OSRSpatialReferenceShadow_ImportFromESRI
>> I'm going to have to read the perl guts docs to get a better idea of why
>> this is.
>>
>> Here's an ESRI prj file:
>>
>> PROJCS["WGS_1984_UTM_Zone_10N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",
>> SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Gr
>> eenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_
>> Mercator"],PARAMETER["False_Easting",500000],PARAMETER
>> ["False_Northing",0],PARAMETER["Central_Meridian",-123],PARAMETER["Scale
>> _Factor",0.9996],PARAMETER["Latitude_Of_Origin",0],UNI
>> T["Meter",1]]
>>   
> 
> Isn't this more or less WKT? At least ImportFromWkt() method eats it 
> without complaints and the result seems ok. I saw somewhere an old prj 
> file which had what looked like key, value -pairs.

Ari,

This is an example of old style .prj:
Projection    TRANSVERSE
Datum         GDA94
Spheroid      GRS80
Units         METERS
Zunits        NO
Xshift        0.0
Yshift        0.0
Parameters
0.9996 /* scale factor at central meridian
  147  0  0.0 /* longitude of central meridian
    0  0  0.0 /* latitude of origin
500000.0 /* false easting (meters)
10000000.0 /* false northing (meters)

This has to be passed into the ImportFromESRI() as a list of strings,
one string per line.  I appologise for all this hassle.  The ImportFromESRI()
interface was poorly designed.

For most purposes (new style ESRI WKT files) it is sufficient to prefix the
string with "ESRI::" and pass to SetFromUserInput().

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    | President OSGeo, http://osgeo.org




More information about the gdal-dev mailing list