[gdal-dev] converting from EPSG:3857 to EPSG:25832 , gdaltransform works, gdalwarp not ?
Andrew C Aitchison
andrew at aitchison.me.uk
Sun Jul 27 06:36:16 PDT 2025
On Sun, 27 Jul 2025, Peter Bennewitz via gdal-dev wrote:
> Dear all,
>
> Overall, I'm trying to convert ESRI SHAPE data, given in "Web Mercator"
> EPSG:3857 , to a TIF in ETRS89 / UTM Zone 32U , EPSG:25832 .
>
> The GDAL Version is the one included in current stable Debian,
> https://packages.debian.org/bookworm/gdal-bin , gdal-bin (3.6.2+dfsg-1 and
> others)
>
> The first step, rasterization, works flawless:
> gdal_rasterize -a_srs EPSG:3857 -tr 10 10 -burn 1 q.shp q.tif
... ...
> However, running the TIF through gdalwarp, and checking the result with
> gdalinfo, does not show a plausible bounding box:
>
> gdalwarp -s_srs EPSG:3857 -t_srs EPSG:25832 q.tif w.tif
Not really answering your question but why are you
rasterizing and then warping ?
I would use ogr2ogr to convert srs and then rasterize:
ogr2ogr -s_srs EPSG:3857 -t_srs EPSG:25832 w.shp q.shp
gdal_rasterize -tr 10 10 -burn 1 w.shp w.tif
Note that ogr2ogr is <dst_dataset_name> <src_dataset_name>
but gdal_rasterize is <src_datasource> <dst_filename>
- ie the reverse order.
If the source is properly geolocated,
the "-s_srs EPSG:3857" in the ogr2ogr command is optional.
--
Andrew C. Aitchison Kendal, UK
andrew at aitchison.me.uk
More information about the gdal-dev
mailing list