[gdal-dev] Confused about datum transformations

dev4cx4m9z at snkmail.com dev4cx4m9z at snkmail.com
Wed Oct 19 03:16:00 EDT 2011


Thanks for all the suggestions – they have given me many possibilities to eliminate, but I still haven’t really got an answer to the original question.

 

Am I required to have proj.dll built with support for the datums/projections I want to use, or is it sufficient to set GDAL_DATA such that gcs.csv and pcs.csv are visible? I’m working in VB.NET, and I’m not confident I can rebuild PROJ with the required datums, so I wish to avoid if possible. I’d even be prepared to use SetGeogCS explicitly as I only use a few datums. If I use SetGeogCS, I can’t see what purpose proj.dll serves.

 

I have set GDAL_DATA to the correct folder.

I have checked that the datum numbers I use are in the gcs.csv file.

 

From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of dev4cx4m9z at snkmail.com
Sent: Tuesday, October 18, 2011 4:12 AM
To: gdal-dev at lists.osgeo.org
Subject: RE: [gdal-dev] Confused about datum transformations

 

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


This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and delete the original message.   ­­  

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/20111019/73558761/attachment-0001.html


More information about the gdal-dev mailing list