[gdal-dev] Failure to convert to Airy

Joaquim Manuel Freire Luís jluis at ualg.pt
Mon Jun 17 12:45:34 PDT 2019


I used the gdaltranslate example because I knew that it would much simpler for you to test but, as I said first, this issue was raised by a call to GDAL from GMT.

Looked again into it and what happens is that the gmt_OGRCoordinateTransformation() call runs fine when

pSrcSRS = "+proj=latlong +datum=WGS84"
pDstSRS = "+proj=airy +ellps=WGS84 +units=m"

but raise the error when I change the order of the source and target (i.e. create the inverse mapping)

pSrcSRS = "+proj=airy +ellps=WGS84 +units=m"
pDstSRS = "+proj=latlong +datum=WGS84"

In this case, it even raises an exception in VS debugger at line #63

		CPLFree(pSrcSRS);		CPLFree(pDstSRS);

|>On lundi 17 juin 2019 17:14:21 CEST Joaquim Manuel Freire Luís wrote:
|>> Well, I call it via GMT but that test is in GMT for a while and it
|>> used to pass.
|>>
|>> Anyway, I'll have to investigate this further because I rebuilt GDAL
|>> and now the gdaltransform works, but when I call it from GMT is still fails.
|>>
|>> The code is
|>>
|>> https://github.com/GenericMappingTools/gmt/blob/master/src/gmt_ogrproj
|>> .c#L27
|>
|>gmt_OGRCoordinateTransformation(() isn't actually equivalent to
|>gdaltransform, since it only creates the forward transformer.
|>So that should, normally, work with both GDAL < 3 or GDAL >= 3 when going
|>from longlat to airy.
|>
|>--
|>Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list