[gdal-dev] Create Coordinate Transformation always returns NULL

Clay, Bruce bclay at ball.com
Wed Mar 12 17:33:02 EDT 2008


I am trying to create a transformation from WGS 84 to a projected
system.  I have tried several but create transform always returns NULL.

The code I am using is essentially the reverse sequence as shown in the
OSR tutorial.  That is that the example went from a projected frame to a
geodetic frame.

The returned status for each of the steps is 0 so it looks like
everything should work and this type of transform is fairly common so I
would think it should be supported by proj4 but I don't see anything in
the proj4 docs that describe what types are supported.

 

Any ideas would be greatly appreciated

 

Bruce

 

////////////////////////////////////////////////////////////////////////
///////

OGRCoordinateTransformation *GdalWrapper::CreateWellKnownTransformation(

                  const char *srcWngcsSrs, const char *destWngcsSrs)

{

      int status = -1;

      OGRErr ogrStatus;

      OGRCoordinateTransformation *coordTransPtr = NULL;

 

      OGRSpatialReference srcSpatialRef;

      OGRSpatialReference destSpatialRef;

 

      ogrStatus = srcSpatialRef.SetWellKnownGeogCS("WGS84");

 

      if (ogrStatus == 0)

      {

            ogrStatus = destSpatialRef.SetProjCS("UTM 17 / WGS84" );

            ogrStatus = destSpatialRef.SetWellKnownGeogCS( "WGS84" );

            ogrStatus = destSpatialRef.SetUTM( 17, TRUE );

 

            if (ogrStatus == 0)

            {

                  coordTransPtr = OGRCreateCoordinateTransformation(

                              &srcSpatialRef, &destSpatialRef);

            }

      }

      return(coordTransPtr);

}

 




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080312/316740f3/attachment-0001.html


More information about the gdal-dev mailing list