[gdal-dev] OGRSpatialReference::importFromWkt ()

Mateusz Loskot mateusz at loskot.net
Fri Aug 1 15:42:43 EDT 2008


Kyle Shannon wrote:
> Hello all,
> I am using OGR Spatial references to reproject points to plot in google
> earth.  I read an ascii raster and an associated prj file to define the
> source and destination spatial references.  My program gets hung up with a
> certain *.prj file containing the text:
> 
> PROJCS["USA_Contiguous_Albers_Equal_Area_Conic_USGS_version",
> GEOGCS["GCS_North_American_1983",
> DATUM["D_North_American_1983",
> SPHEROID["GRS_1980",6378137.0,298.257222101],TOWGS84[0.0, 0.0, 0.0, 0.0,
> 0.0, 0.0, 0.0]],
> PRIMEM["Greenwich",0.0],
> UNIT["Degree",0.0174532925199433]],
> PROJECTION["Albers"],
> PARAMETER["False_Easting",0.0],
> PARAMETER["False_Northing",0.0],
> PARAMETER["Central_Meridian",-114.9786],
> PARAMETER["Standard_Parallel_1",45.54426],
> PARAMETER["Standard_Parallel_2",46.12414],
> PARAMETER["Latitude_Of_Origin",45.8342],
> UNIT["Meter",1.0]]
> 
> 
> I assume this is a valid prj, although importFrom Wkt() returns 5, which is
> OGRERR_CORRUPT_DATA.  Any advice would be greatly appreciated.  Thank you
> for your time.

Kyle,

Yes, this is valid .prj file but the WKT definition it stores
is not OGC WKT;

It reminds this (compare with ESRI WKT link output):

http://spatialreference.org/ref/epsg/102003/

but parameters are slightly different.


I'd suggest you to try to call ImportFromESRI  instead of ImportFromWkt.
It should handle it, I hope,

Best regards
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list