[gdal-dev] Converting raster pixel space to geospace

Smart, Gary Gary.Smart at Goodrich.com
Thu Jul 16 04:41:02 EDT 2009


> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at mines-paris.org]
> Sent: 15 July 2009 21:14
> To: Smart, Gary
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] Converting raster pixel space to geospace
> 
> Le Wednesday 15 July 2009 20:50:15 Smart, Gary, vous avez écrit :
> > Thanks for that! :-)
> >
> > ... without appearing too cheeky,
> > Could you point me to a page which would help me translate the x/y
> returned
> > from the transformation (presumably easting/northing in metres?), into
> > WGS84 Lat/Long?
> 
> The x,y returned by the translation depend of the coordinate system of the
> raster (returned by GDALGetProjectionRef()). For a geographic coordinate
> system, generally you get x = longitude, y = latitude. For a UTM
> projection,
> x = easting, y = northing. For other projections, it depends on the units
> of
> the projection system.
> 
> For conversion between coordinate systems, you're interested in OSR then.
> See
> http://gdal.org/ogr/osr_tutorial.html and
> http://gdal.org/ogr/ogr__srs__api_8h.html

Thanks, this is certainly what I'm looking for Even.

But how do I load a OGRSpatialRef object with the output from the GDALApplyGeoTransform?  Presumably I can prime the OGRSpatialReference using the result of GDALDataset::GetProjectionRef?  I'm not yet sure of my terminology but is the GetProjectionRef supposed to satisfy the OGR importFromWkt (the types seem to clash though - char* vs char**)?

I suspect my output projection could then be set up with SetWellKnownGeogCS("WGS84") in order to convert from whatever input projection prevails, to a standard WGS84 lat/long representation (using        OGRCreateCoordinateTransformation::Transform)?



More information about the gdal-dev mailing list