[gdal-dev] Confused about datum transformations

dev4cx4m9z at snkmail.com dev4cx4m9z at snkmail.com
Tue Oct 18 06:11:56 EDT 2011


I’m not sure the code will help too much, but here are the relevant code fragments. I’m using a hand crafted VB.net wrapper which explains some of the syntax

 

Private WGS84SRS As New OGRSpatialReference     ' Coordinate system in WGS84

Private MapSRS As OGRSpatialReference       ' Coordinate system of map

Private ctWGS84toMap As OGRCoordinateTransformation       ' Coordinate transform from WGS84 to map

 

With WGS84SRS

    GDALError = .SetProjCS("WGS84 Datum")

    Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())

    GDALError = .SetWellKnownGeogCS("WGS84")          ' Define WGS84 coordinate system

    Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())

End With

 

With MapSRS

     GDALError = .SetProjCS("Map coordinate system")

     Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())

     GDALError = .ImportFromEPSG(3577)

     Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())

End With

 

ctWGS84toMap = GDAL.CreateCoordinateTransformation(WGS84SRS, MapSRS)        ' Create a coordinate transformation - WGS84 to map

Debug.Assert(ctWGS84toMap IsNot Nothing, GetLastErrorMsg())

 

Marc,

Can you provide the code leading to the error?

On Tue, Oct 18, 2011 at 1:21 PM, Marc Hillman <dev4cx4m9z at snkmail.com> wrote:

I have a GIS database, and all data is stored in WGS84 datum. I have developed an application using GDAL, and I now need to translate my WGS84 coordinates to several different datums, depending what map is loaded. I seem to be going around in circles, and need a nudge in the right direction. I am defining an OGRSpatialReference for each datum (WGS84 and current map) and then attempting to create an OGRCoordinateTransformation for the transformation.. This last step fails with a PROJ.4 error (“No PROJ.4 translation for destination SRS, coordinate transformation initialization failed”

 

My question is - Do I need PROJ.4 to do the translation? Can I not just use ImportFromWKT to define my OGRSpatialReference? If so, is there a nice canned list of all the WKT somewhere?  I’m keen to avoid PROJ.4 if possible as I’m not sure I can build it.

 


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev




-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E



No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1831 / Virus Database: 2092/4558 - Release Date: 10/17/11

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20111018/c642324e/attachment.html


More information about the gdal-dev mailing list