[gdal-dev] Which Proj.4 transforms are available in GDAL?

Even Rouault even.rouault at spatialys.com
Fri Aug 25 12:06:29 PDT 2017


On vendredi 25 août 2017 18:25:36 CEST Joaquim Luis wrote:
> OK, understood thanks. But got confused too. Why would a GDAL port of a
> proj.4 string do a different thing than the coded in the proj.4 string?
> 

Yes that's not obvious but internally SRS in GDAL are not modelled as a proj.4 string, but as 
WKT. So there's a importFromProj4() and exportFromProj4(), and possible loss can happen 
when some concepts cannot be matched exactly.

> Found these two that not even with the +wktext agree

Perhaps you don't use the same proj.4 version ?

> 
> 
> gdaltransform -s_srs EPSG:4326 -t_srs "+proj=aeqd +ellps=WGS84 +units=m
> +wktext"
> 4.897 52.371
> 384537.462362467 5809944.80754693 0
> 
> echo 4.897 52.371 | proj +proj=aeqd +ellps=WGS84 +units=m
> 384923.72       5809986.5

I get the same result as GDAL (with proj 4.9.2)

$ echo 4.897 52.371 | proj +proj=aeqd +ellps=WGS84 +units=m
384537.46	5809944.81

> 
> 
> 
> gdaltransform -s_srs EPSG:4326 -t_srs "+proj=robin +ellps=WGS84 +units=m
> +wktext"
> 4.897 52.371
> 394576.527707384 5570940.8420985 0
> 
> echo 4.897 52.371 | proj +proj=robin +ellps=WGS84 +units=m
> 394576.51       5571243.64

$ echo 4.897 52.371 | proj +proj=robin +ellps=WGS84 +units=m
394576.53	5570940.84


> 
> > Joaquim,
> > 
> >> I'm implementing Proj.4 in GMT via GDAL and now, in the the testing
> >> stage,
> >> 
> >> 
> >> 
> >> I'm using data from
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> https://github.com/Beman/boost-trunk-git-svn/blob/master/libs/geometry/te
> >> st_
> >> 
> >> 
> >> 
> >> extensions/gis/projections/projections.cpp#L121
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> but to my surprise lots of projections are not implemented in GDAL. For
> >> 
> >> 
> >> 
> >> example
> > 
> > GDAL SRS model is based on WKT, so only projections that have a mapping
> > to WKT 1 (and for which a >developer cared enough to write the needed
> > code !) are nominally supported
> > 
> >> gdaltransform -s_srs EPSG:4326 -t_srs +proj=airy +ellps=WGS84 +units=m
> > 
> > For unsupported projections, add +wktext. A dummy WKT representation is
> > then built that captures >the full proj.4 string in a EXTENSION node.
> > Can also serve for supported projections if you want to >overrite the
> > WKT -> proj.4 string conversion done by GDAL
> > 
> > 
> > 
> > 
> > 
> > 
> > $ gdalsrsinfo "+proj=airy +ellps=WGS84 +units=m +wktext"
> > 
> > 
> > 
> > 
> > 
> > 
> > PROJ.4 : +proj=airy +ellps=WGS84 +units=m +wktext
> > 
> > 
> > 
> > 
> > 
> > 
> > OGC WKT :
> > 
> > 
> > 
> > PROJCS["unnamed",
> > 
> >    GEOGCS["WGS 84",
> >    
> >        DATUM["unknown",
> >        
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170825/c1bf665c/attachment-0001.html>


More information about the gdal-dev mailing list