[gdal-dev] Transformation works in GDAL2 but cause problems in GDAL3

mattijn mattijn at gmail.com
Thu Dec 3 03:11:13 PST 2020


Dear Even et al.,

To answer my own question. Based on your comment on the units, I was able
to make it. By changing the Affine transformation as well. So the
gdaltransform example command becomes like this:
echo "0 -3650000" | gdaltransform -s_srs "+proj=stere +x_0=0 +y_0=0
+lat_0=90 +lon_0=0 +lat_ts=60 +a=6378137 +b=6356752" -t_srs EPSG:4326
And gives as result
0 90 0
This is really great! Let me send a message as well to the meteorological
agency so they can update their projection information.
Thanks again!
Regards,
Mattijn

On Thu, 3 Dec 2020 at 11:26, mattijn <mattijn at gmail.com> wrote:

> Dear Even,
>
> Thanks for your response! It's much appreciated. I control the creation of
> the source file, so I can adjust the unit of the ellipsoid axis in the
> source. Would that help with avoiding the need of a  -ct pipeline?
>
> Regards,
> Mattijn
>
> (forgot the Replay All, to send to the full list, instead of replying to
> Even only.)
>
>
> On Thu, 3 Dec 2020 at 11:19, Even Rouault <even.rouault at spatialys.com>
> wrote:
>
>> Mattijn,
>>
>> > Question: how do I define my source raster instance, to avoid using the
>> > advance `-ct` operator in gdalwarp in GDAL3 during reprojection?
>>
>> I don't think you can avoid it here. There seems to be an issue in either
>> your
>> source file or in the HDF5 driver regarding the unit of the ellipsoid
>> axis.
>> Normally the a and b parameters should be in meters, not kilometers.
>>
>> > But now with GDAL3 using the same command I get:
>> >
>> > ERROR 1: PROJ: proj_create_operations: Source and target ellipsoid do
>> not
>> > belong to the same celestial body
>>
>> yes it detects that the source and target ellipsoids are completely
>> different,
>> which is in most cases involve a non sensical attempt.
>>
>> > And using the `-ct` operator with GDAL3 I get this:
>> >
>> > echo "0.000 -3650.000" | gdaltransform -s_srs '+proj=stere +x_0=0 +y_0=0
>> > +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378.137 +b=6356.752' -t_srs EPSG:4326
>> -ct
>> > '+proj=axisswap +order=2,1 +step' --debug on
>>
>> Your -ct pipeline should include the full pipeline, not just an axisswap
>> operation. For gdaltransform, you can remove the -s_srs and -t_srs
>> parameters
>> when you specify -ct. For gdalwarp / ogr2ogr, you can keep the -t_srs so
>> that
>> the output dataset has correct CRS information.
>>
>> Your pipeline should be something like
>>
>> +proj=pipeline +step +inv +proj=stere +x_0=0 +y_0=0
>> +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378.137 +b=6356.752 +step
>> +proj=axisswap
>> +order=2,1
>>
>> Even
>>
>> --
>> Spatialys - Geospatial professional services
>> http://www.spatialys.com
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201203/07d279fc/attachment.html>


More information about the gdal-dev mailing list