[gdal-dev] Transform from lat/long/elevation to 3d sphere

Christopher Hunt huntc at internode.on.net
Fri Jul 3 03:23:18 EDT 2009


Sorry for the hopefully not so dumb question here.

If I want to transform from one projection to a projection of the  
earth in 3D, how would I set up my target srs?

I want to take a WGS-84 lat/long/elevation and have an x,y,z returned  
in metres.

Here's my present code:

   // Read the image's projection
   OGRSpatialReference projSpatialReference(dataset- 
 >GetProjectionRef());
   scoped_ptr<OGRSpatialReference>  
latLongSpatialReference(projSpatialReference.CloneGeogCS());
   transform =  
OGRCreateCoordinateTransformation(latLongSpatialReference.get(),  
&projSpatialReference);

...and of course that transforms from lat/long/elevation to the  
projection srs nicely. What I'm looking for is a way to specify the  
target srs so that it yields the x, y, z values for WGS84 3d sphere  
i.e. the earth.

Kind regards,
Christopher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090703/bc158495/attachment.html


More information about the gdal-dev mailing list