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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Joaquim Luis
Hi Even,

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

gdaltransform -s_srs EPSG:4326 -t_srs +proj=airy +ellps=WGS84 +units=m
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'.


Is there a place where I can find the list of available proj.4 transforms?



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

Cheers

Joaquim
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

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
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 25.08.2017 um 13:52 schrieb Even Rouault:

>> 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
>

https://github.com/OSGeo/proj.4/blob/master/src/PJ_vandg.c only has
formulas for the spheroid. So it would be better to specify a radius
directly, instead of an ellipsoid:

echo 4.897 52.371 | proj +proj=vandg +R=6371000
488458.74       6424384.22

gdaltransform -s_srs EPSG:4326 -t_srs "+proj=vandg +R=6371000
4.897 52.371
488458.742715653 6424384.22221862 0

HTH,
André Joost

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Joaquim Luis
In reply to this post by Even Rouault-2
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
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

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",

> >

> > 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

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Joaquim Luis

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 ?


Yep, I was using a 4.8 version from  OSGeo4W. With 4.9.3 I get the same as with GDAL



 

>

>

> 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",

> >

> > 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

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com





_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Joaquim Luis
In reply to this post by Even Rouault-2

>
>
>> 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
>

Sorry Even, but it still fails

gdaltransform -s_srs EPSG:4326 -t_srs "+proj=bonne +lat_0=1 +wktext"
ERROR 6: Failed to initialize PROJ.4 with `+proj=bonne +lat_0=1 +wktext'.

And I'm facing some other issues with the +wktext.

This GMT using proj.4 via GDAL, and it works.

grdproject lixo.grd -J+proj=sinu -Glixo2.grd

but adding +wktext makes it fail in GDAL

grdproject lixo.grd -J"+proj=sinu +wktext" -Glixo2.grd
ERROR 6: Failed to initialize PROJ.4 with `+proj=sinu +wktext'
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

On dimanche 27 août 2017 00:02:35 CEST Joaquim Luis wrote:

> >> 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

>

> Sorry Even, but it still fails

>

> gdaltransform -s_srs EPSG:4326 -t_srs "+proj=bonne +lat_0=1 +wktext"

> ERROR 6: Failed to initialize PROJ.4 with `+proj=bonne +lat_0=1 +wktext'.

 

It is lat_1 which must be non zero.

 

>

> And I'm facing some other issues with the +wktext.

>

> This GMT using proj.4 via GDAL, and it works.

>

> grdproject lixo.grd -J+proj=sinu -Glixo2.grd

>

> but adding +wktext makes it fail in GDAL

>

> grdproject lixo.grd -J"+proj=sinu +wktext" -Glixo2.grd

> ERROR 6: Failed to initialize PROJ.4 with `+proj=sinu +wktext'

 

Perhaps due to the lack of datum/ellipsoid, if you don't have a proj_def.dat file that will contain the implicit one

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Joaquim Luis

> gdaltransform -s_srs EPSG:4326 -t_srs "+proj=bonne +lat_0=1 +wktext"

> ERROR 6: Failed to initialize PROJ.4 with `+proj=bonne +lat_0=1 +wktext'.

 

It is lat_1 which must be non zero.

 

> grdproject lixo.grd -J"+proj=sinu +wktext" -Glixo2.grd

> ERROR 6: Failed to initialize PROJ.4 with `+proj=sinu +wktext'

 

Perhaps due to the lack of datum/ellipsoid, if you don't have a proj_def.dat file that will contain the implicit one


Thanks. That was the case(s)




_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
In reply to this post by Even Rouault-2
Am 25.08.2017 um 13:52 schrieb Even Rouault:

>
> 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
>

This seems to work arbitrary.

gdalwarp -overwrite -dstnodata 0 -s_srs EPSG:3857 -t_srs "+proj=lcc
+lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89
+x_0=500000 +y_0=295809.184 +k_0=0.99996704 +ellps=clrk66 +units=m
+no_defs +towgs84=0,125,194,0,0,0,0 +wktext" -of GTiff ElSalvador.png
ElSalvadorNAD27.tif
gdalsrsinfo ElSalvadorNAD27.tif >out.txt

does not add an EXTENSION to the WKT, but preserves the TOWGS84 values


ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=lcc +lat_1=13.31666666666667
+lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184
+k_0=0.99996704 +ellps=clrk66 +units=m +no_defs
+towgs84=0,125,194,0,0,0,0 +wktext" LimitesNAD27.shp dptoA_WGS_1984.shp
gdalsrsinfo LimitesNAD27.prj >>out.txt

neither saves towgs84 or wktext

gdalsrsinfo "+proj=lcc +lat_1=13.31666666666667 +lat_2=14.25
+lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +k_0=0.99996704
+ellps=clrk66 +units=m +no_defs +towgs84=0,125,194,0,0,0,0 +wktext"

adds TOWGS84 and EXTENSION.

Tested with GDAL 2.2.1

Perhaps you like to comment on
https://gis.stackexchange.com/questions/253475/results-of-layers-created-with-a-custom-crs-are-loaded-with-a-generated-crs-in-q 
(with links to data).

Still confused,
André Joost

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

 

> This seems to work arbitrary.

 

Not really. GDAL is an abstraction of a lot of imperfections, so losses can happen for various (more or less well documented) reasons each time you export & import.

 

>

> gdalwarp -overwrite -dstnodata 0 -s_srs EPSG:3857 -t_srs "+proj=lcc

> +lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89

> +x_0=500000 +y_0=295809.184 +k_0=0.99996704 +ellps=clrk66 +units=m

> +no_defs +towgs84=0,125,194,0,0,0,0 +wktext" -of GTiff ElSalvador.png

> ElSalvadorNAD27.tif

> gdalsrsinfo ElSalvadorNAD27.tif >out.txt

>

> does not add an EXTENSION to the WKT, but preserves the TOWGS84 values

>

 

Yes, the GeoTIFF format isn't WKT based. So the GDAL WKT representation gets translated as best as possible into GeoTIFF keys, which don't support EXTENSION. TOWGS84 was added as an extra GeoTIFF key a few years ago by Frank, although not part of the original GeoTIFF specification.

 

>

> ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=lcc +lat_1=13.31666666666667

> +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184

> +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs

> +towgs84=0,125,194,0,0,0,0 +wktext" LimitesNAD27.shp dptoA_WGS_1984.shp

> gdalsrsinfo LimitesNAD27.prj >>out.txt

>

> neither saves towgs84 or wktext

 

Yes, a .prj file contains a ESRI flavour of WKT, which supports neither TOWGS84 or EXTENSION, so they get stripped.

 

>

> gdalsrsinfo "+proj=lcc +lat_1=13.31666666666667 +lat_2=14.25

> +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +k_0=0.99996704

> +ellps=clrk66 +units=m +no_defs +towgs84=0,125,194,0,0,0,0 +wktext"

>

> adds TOWGS84 and EXTENSION.

 

Yes, you completely stay in GDAL realm here without import/export issues

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 01.09.2017 um 20:14 schrieb Even Rouault:

>
>>
>> ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=lcc +lat_1=13.31666666666667
>> +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184
>> +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs
>> +towgs84=0,125,194,0,0,0,0 +wktext" LimitesNAD27.shp dptoA_WGS_1984.shp
>> gdalsrsinfo LimitesNAD27.prj >>out.txt
>>
>> neither saves towgs84 or wktext
>
> Yes, a .prj file contains a ESRI flavour of WKT, which supports neither TOWGS84 or
> EXTENSION, so they get stripped.
>

So how is a datum shift outside of the EPSG code world supposed to be
applied to a shapefile with ogr2ogr?

Greetings,
André Joost


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

On vendredi 1 septembre 2017 20:42:34 CEST Andre Joost wrote:

> Am 01.09.2017 um 20:14 schrieb Even Rouault:

> >> ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=lcc +lat_1=13.31666666666667

> >> +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184

> >> +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs

> >> +towgs84=0,125,194,0,0,0,0 +wktext" LimitesNAD27.shp dptoA_WGS_1984.shp

> >> gdalsrsinfo LimitesNAD27.prj >>out.txt

> >>

> >> neither saves towgs84 or wktext

> >

> > Yes, a .prj file contains a ESRI flavour of WKT, which supports neither

> > TOWGS84 or EXTENSION, so they get stripped.

>

 

And more importantly the original EPSG code is also missing in ESRI WKT.

 

> So how is a datum shift outside of the EPSG code world supposed to be

> applied to a shapefile with ogr2ogr?

 

You have to override the source SRS with -s_srs EPSG:XXXX if you know the code. One could potentially improve the situation by trying to match the .prj CRS name with the entries in the EPSG database to try recovering which code the ESRI WKT corresponds too (if there's a match)

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 01.09.2017 um 21:05 schrieb Even Rouault:

> On vendredi 1 septembre 2017 20:42:34 CEST Andre Joost wrote:
>> Am 01.09.2017 um 20:14 schrieb Even Rouault:
>>>> ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=lcc +lat_1=13.31666666666667
>>>> +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184
>>>> +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs
>>>> +towgs84=0,125,194,0,0,0,0 +wktext" LimitesNAD27.shp dptoA_WGS_1984.shp
>>>> gdalsrsinfo LimitesNAD27.prj >>out.txt
>>>>
>>>> neither saves towgs84 or wktext
>>>
>>> Yes, a .prj file contains a ESRI flavour of WKT, which supports neither
>>> TOWGS84 or EXTENSION, so they get stripped.
>>
>
> And more importantly the original EPSG code is also missing in ESRI WKT.
>
>> So how is a datum shift outside of the EPSG code world supposed to be
>> applied to a shapefile with ogr2ogr?
>
> You have to override the source SRS with -s_srs EPSG:XXXX if you know the code. One could
> potentially improve the situation by trying to match the .prj CRS name with the entries in the
> EPSG database to try recovering which code the ESRI WKT corresponds too (if there's a
> match)
>

The problem is that there is no EPSG code for the projection, and NAD27
datum is handled badly outside the US and Canada. The country in
question is El Salvador, where they adopted NAD27, but it's not part of
the NAD27 datum shift files. EPSG suggests a Ocotepeque datum, which is
shifted to NAD27.

greetings,
André Joost


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

 

> The problem is that there is no EPSG code for the projection,

 

Ah, the -s_srs syntax is not limited to EPSG:XXXX. You can use a proj.4 string, inlined WKT, a filename that has WKT or proj.4 string in it, etc.

See http://gdal.org/gdal_utilities.html

 

> and NAD27

> datum is handled badly outside the US and Canada. The country in

> question is El Salvador, where they adopted NAD27, but it's not part of

> the NAD27 datum shift files. EPSG suggests a Ocotepeque datum, which is

> shifted to NAD27.

 

 

Isn'it the datum used by ?

 

$ gdalsrsinfo EPSG:5451

 

PROJ.4 : +proj=longlat +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +no_defs

 

OGC WKT :

GEOGCS["Ocotepeque 1935",

DATUM["Ocotepeque_1935",

SPHEROID["Clarke 1866",6378206.4,294.9786982138982,

AUTHORITY["EPSG","7008"]],

TOWGS84[205,96,-98,0,0,0,0],

AUTHORITY["EPSG","1070"]],

PRIMEM["Greenwich",0,

AUTHORITY["EPSG","8901"]],

UNIT["degree",0.0174532925199433,

AUTHORITY["EPSG","9122"]],

AUTHORITY["EPSG","5451"]]

 

The TOWGS84 parameters are the ones of transformation http://epsg.io/6891 that is valid for El Savador (and neighbouring countries). There are other transformations from Octopeque 35 to WGS 84, but none have an area of use that include El Savador.

They are also transformations from Octopeque 35 to NAD 27.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 05.09.2017 um 16:56 schrieb Even Rouault:

>> The problem is that there is no EPSG code for the projection,
>
> Ah, the -s_srs syntax is not limited to EPSG:XXXX. You can use a proj.4 string, inlined WKT, a
> filename that has WKT or proj.4 string in it, etc.
> See http://gdal.org/gdal_utilities.html
>
>> and NAD27
>> datum is handled badly outside the US and Canada. The country in
>> question is El Salvador, where they adopted NAD27, but it's not part of
>> the NAD27 datum shift files. EPSG suggests a Ocotepeque datum, which is
>> shifted to NAD27.
>
>
> Isn'it the datum used by ?
>
> $ gdalsrsinfo EPSG:5451
>
> PROJ.4 : +proj=longlat +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +no_defs
>
> OGC WKT :
> GEOGCS["Ocotepeque 1935",
>      DATUM["Ocotepeque_1935",
>          SPHEROID["Clarke 1866",6378206.4,294.9786982138982,
>              AUTHORITY["EPSG","7008"]],
>          TOWGS84[205,96,-98,0,0,0,0],
>          AUTHORITY["EPSG","1070"]],
>      PRIMEM["Greenwich",0,
>          AUTHORITY["EPSG","8901"]],
>      UNIT["degree",0.0174532925199433,
>          AUTHORITY["EPSG","9122"]],
>      AUTHORITY["EPSG","5451"]]
>
> The TOWGS84 parameters are the ones of transformation http://epsg.io/6891 that is valid
> for El Savador (and neighbouring countries). There are other transformations from
> Octopeque 35 to WGS 84, but none have an area of use that include El Savador.
> They are also transformations from Octopeque 35 to NAD 27.
>

The shapefile clearly states DATUM["D_North_American_1927", and the
download page (from the official agency)
http://www.cnr.gob.sv/geoportal-cnr/ tells the same.

In fact, I have not found any Ocotepeque based GIS data available from
El Salvador, only from the surrounding countries.

Greetings,
André Joost


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

 

>

> The shapefile clearly states DATUM["D_North_American_1927", and the

> download page (from the official agency)

> http://www.cnr.gob.sv/geoportal-cnr/ tells the same.

 

Hum, actually looking at the full .prj, it looks similar to EPSG:5460

 

See:

 

$ gdalsrsinfo ESRI::dptoA_Lambert_NAD27.prj

 

PROJ.4 : +proj=lcc +lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +datum=NAD27 +units=m +no_defs

 

OGC WKT :

PROJCS["IDGES_rev",

GEOGCS["GCS_North_American_1927",

DATUM["North_American_Datum_1927",

SPHEROID["Clarke_1866",6378206.4,294.9786982]],

PRIMEM["Greenwich",0.0],

UNIT["Degree",0.0174532925199433]],

PROJECTION["Lambert_Conformal_Conic_2SP"],

PARAMETER["False_Easting",500000.0],

PARAMETER["False_Northing",295809.184],

PARAMETER["Central_Meridian",-89.0],

PARAMETER["Standard_Parallel_1",13.31666666666667],

PARAMETER["Standard_Parallel_2",14.25],

PARAMETER["Scale_Factor",0.99996704],

PARAMETER["Latitude_Of_Origin",13.783333],

UNIT["Meter",1.0]]

 

$ gdalsrsinfo EPSG:5460

 

PROJ.4 : +proj=lcc +lat_1=13.78333333333333 +lat_0=13.78333333333333 +lon_0=-89 +k_0=0.99996704 +x_0=500000 +y_0=295809.184 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs

 

OGC WKT :

PROJCS["Ocotepeque 1935 / El Salvador Lambert",

GEOGCS["Ocotepeque 1935",

DATUM["Ocotepeque_1935",

SPHEROID["Clarke 1866",6378206.4,294.9786982138982,

AUTHORITY["EPSG","7008"]],

TOWGS84[205,96,-98,0,0,0,0],

AUTHORITY["EPSG","1070"]],

PRIMEM["Greenwich",0,

AUTHORITY["EPSG","8901"]],

UNIT["degree",0.0174532925199433,

AUTHORITY["EPSG","9122"]],

AUTHORITY["EPSG","5451"]],

PROJECTION["Lambert_Conformal_Conic_1SP"],

PARAMETER["latitude_of_origin",13.78333333333333],

PARAMETER["central_meridian",-89],

PARAMETER["scale_factor",0.99996704],

PARAMETER["false_easting",500000],

PARAMETER["false_northing",295809.184],

UNIT["metre",1,

AUTHORITY["EPSG","9001"]],

AXIS["X",EAST],

AXIS["Y",NORTH],

AUTHORITY["EPSG","5460"]]

 

So beside the datum difference, they are equivalent. The .prj one uses a

LCC2SP formulation of LCC, and the EPSG one a LCC1SP one. One can easily

check they are equivalent with:

 

$ gdaltransform -s_srs "+proj=longlat +ellps=clrk66" -t_srs ESRI::dptoA_Lambert_NAD27.prj

-88 14

608032.297052867 320003.359813003 0

 

$ gdaltransform -s_srs "+proj=longlat +ellps=clrk66" -t_srs EPSG:5460

-88 14

608032.297913122 320003.32045602 0

 

(the slight difference in northing might come from the .prj having a limited number

of digits for Latitude_of_origin compared to the EPSG one)

 

So the NAD27 datum might be just an artifact of something in their production

chain not being able to handle Octopeque 1935. Or just a matter of habit. My

knowledge of El Salvador geodesy is rather limited ;-)

 

Or if it is really NAD27 datum, I can indeed see that they are 3 NAD27->WGS84 transforms available

for central America.

 

$ ogrinfo pg:dbname=epsg -sql "select c.*, a.area_code, a.area_name from epsg_coordoperation c join epsg_area a on c.area_of_use_code = a.area_code where c.source_crs_code = 4267 and c.target_crs_code=4326 and area_south_bound_lat > 0 and area_north_bound_lat < 20 and area_west_bound_lon > -95 and area_east_bound_lon < -75"

 

Two of them are specific of Panama. The remaining one is EPSG:1171 that applies to

"Central America - Belize to Costa Rica"

 

Its TOWGS84 params are 0.0, 125.0, 194.0, 0.0, 0.0, 0.0, 0.0

 

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 05.09.2017 um 19:43 schrieb Even Rouault:
>>
>> The shapefile clearly states DATUM["D_North_American_1927", and the
>> download page (from the official agency)
>> http://www.cnr.gob.sv/geoportal-cnr/ tells the same.
>
> Hum, actually looking at the full .prj, it looks similar to EPSG:5460

Yes, projection parameter values are the same, and the datum shift is
not stored inside the Shapefile definition.

>
> See:
>
> $ gdalsrsinfo ESRI::dptoA_Lambert_NAD27.prj
>
> PROJ.4 : +proj=lcc +lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +datum=NAD27 +units=m +no_defs

... and that's the pitfall for Proj.4, resulting in zero datum shift
because the grid shift files don't cover El Salvador.

>
> OGC WKT :
> PROJCS["IDGES_rev",
>      GEOGCS["GCS_North_American_1927",
>          DATUM["North_American_Datum_1927",
>              SPHEROID["Clarke_1866",6378206.4,294.9786982]],
>          PRIMEM["Greenwich",0.0],
>          UNIT["Degree",0.0174532925199433]],
>      PROJECTION["Lambert_Conformal_Conic_2SP"],
>      PARAMETER["False_Easting",500000.0],
>      PARAMETER["False_Northing",295809.184],
>      PARAMETER["Central_Meridian",-89.0],
>      PARAMETER["Standard_Parallel_1",13.31666666666667],
>      PARAMETER["Standard_Parallel_2",14.25],
>      PARAMETER["Scale_Factor",0.99996704],
>      PARAMETER["Latitude_Of_Origin",13.783333],
>      UNIT["Meter",1.0]]
>

>
> So beside the datum difference, they are equivalent. The .prj one uses a
> LCC2SP formulation of LCC, and the EPSG one a LCC1SP one.

Except that they have a scale factor with LCC 2SP, but it gets silently
dropped by GDAL/PROJ.4.

>
> So the NAD27 datum might be just an artifact of something in their production
> chain not being able to handle Octopeque 1935. Or just a matter of habit. My
> knowledge of El Salvador geodesy is rather limited ;-)

... or they keep a kind of mistery on it. El Salvador should have moved
to SIRGAS-ES2007.8 by now, but I have not found any projected CRS based
on that.

>
> Or if it is really NAD27 datum, I can indeed see that they are 3 NAD27->WGS84 transforms available
> for central America.
>
> $ ogrinfo pg:dbname=epsg -sql "select c.*, a.area_code, a.area_name from epsg_coordoperation c join epsg_area a on c.area_of_use_code = a.area_code where c.source_crs_code = 4267 and c.target_crs_code=4326 and area_south_bound_lat > 0 and area_north_bound_lat < 20 and area_west_bound_lon > -95 and area_east_bound_lon < -75"
>
> Two of them are specific of Panama. The remaining one is EPSG:1171 that applies to
> "Central America - Belize to Costa Rica"
>
> Its TOWGS84 params are 0.0, 125.0, 194.0, 0.0, 0.0, 0.0, 0.0
>

... and that looks nothing similar to the Ocotepeque datum shift. They
are about 400 meters apart.

Greetings,
André Joost


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Even Rouault-2

> Except that they have a scale factor with LCC 2SP, but it gets silently

> dropped by GDAL/PROJ.4.

 

Which is OK. The LCC 2SP formulation just needs the 2 standard parallels and the latitude of origin. Basically when GDAL imports a ESRI WKT and sees that there's 2 standard parallel, it considers it is a LCC_2SP. The scale factor is redundant there. proj.4 doesn't need it when the 2 standard parallels are provided; You need either the 2 standard parallels, or 1 standard parallel + the scale factor, and with some maths you can go from one form to the equivalent other one (the importFromESRI() method could probably be enhanced to check the consistency of the 4 parameters when present and emit a warning in case they are not consistent. Exercice left to contributors)

 

Actually looking at proj.4 code, you must *not* include a +k_0 (other than 1) when using the +lat_1 +lat_2 formulation, otherwise the scale factor would be applied twice.

 

> ... and that looks nothing similar to the Ocotepeque datum shift. They

> are about 400 meters apart.

 

Well that's expected if NAD27 and Octopeque are indeed 2 different datums: there must be a shift between. The EPSG database has also shifts from Octopeque to NAD27. Apparently they also offer the datasets in WGS 84, so you can perhaps check which hypothesis is right from that.

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Which Proj.4 transforms are available in GDAL?

Andre Joost
Am 05.09.2017 um 20:50 schrieb Even Rouault:
>Apparently
> they also offer the datasets in WGS 84, so you can perhaps check which hypothesis is right
> from that.
>

Both datasets align with the Custom CRS including 3-parms datum shift I
included earlier in this thread.

Greetings,
André Joost


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev