[gdal-dev] Issue with Custom Transformation Pipeline in GDALReprojectImage

Martin Ždila m.zdila at gmail.com
Thu Jan 9 07:37:53 PST 2025


Thank you Even,

I went more low-level and successfully used GDALChunkAndWarpImage
<https://github.com/FreemapSlovakia/freemap-tiler/blob/8e1650b62fe2ca6a784870234810410284bd8263/src/main.rs#L344>.
I also posted answer on SO <https://stackoverflow.com/a/79342516/289827>.

Regarding the pipeline, it could be a bad copy-paste or garbled by
ChatGPT 😀.

Best regards

On Thu, Jan 9, 2025 at 1:11 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> GDALReprojectImage() expects that a correct geotransform is already set on
> the target dataset.
>
> You may use GDALSuggestedWarpOutput2() to get a guessed geotransform
>
> Otherwise for full automated way, you may also using the C function
> GDALWarp().
>
> By the way, your below pipeline looks wrong
>
> +proj=pipeline
> +step +inv +proj=krovak +lat_0=49.5 +lon_0=24.8333333333333 +alpha=30.2881397527778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel
> +step +inv +proj=hgridshift +grids=Slovakia_JTSK03_to_JTSK.gsb
> +step +proj=krovak +lat_0=49.5 +lon_0=24.8333333333333 +alpha=30.2881397527778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel
> +step +proj=webmerc
>
> After the 3rd step (+proj=krovak), you are in projected coordinate space.
> Applying +proj=webmerc afterwards doesn't make any sense since the later
> expects geographic coordinates. You probably want to omit the 3rd step
>
-- 
Martin Ždila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250109/1b901264/attachment-0001.htm>


More information about the gdal-dev mailing list