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?
Found these two that not even with the +wktext agree
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
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
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/test_
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",
SPHEROID["WGS84",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["custom_proj4"],
UNIT["Meter",1],
EXTENSION["PROJ4","+proj=airy +ellps=WGS84 +units=m +wktext"]]
$ gdaltransform -s_srs EPSG:4326 -t_srs "+proj=airy +ellps=WGS84
+units=m +wktext"
ERROR 1: Translating source or target SRS failed:
+proj=airy
Or
gdaltransform -s_srs EPSG:4326 -t_srs +proj=bonne
ERROR 6: Failed to initialize PROJ.4 with `+proj=bonne +lon_0=0 +lat_1=0
+x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'.
I thing the issue is that lat_1=0 is invalid for bonne. Any non zero
value is OK
Is there a place where I can find the list of available proj.4
transforms?
You mean projections supported by GDAL (as far as I know, most if not
all projections supported by >GDAL translate then to proj.4) ?
Look at the various OSRSetXXXXX() methods in
http://gdal.org/ogr__srs__api_8h.html
Or starting there
https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogr_srs_proj4.cpp#L616
And also found some that do no agree between GDAL and proj. For example
echo 4.897 52.371 | proj +proj=vandg +ellps=WGS84 +units=m
489005.93 6431581.02
gdaltransform -s_srs EPSG:4326 -t_srs "+proj=vandg +ellps=WGS84
+units=m"
4.897 52.371
488459.293282675 6424391.46347316 0
If you add --debug on, you'll see that GDAL adds a +R_A parameter. I
haven't dug up into history to >know the reason for that.
If you add +wktext, the original string will be passed unmodified to
proj.4
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev