[gdal-dev] Image reprojection with GDALWARP

Javier Jimenez Shaw j1 at jimenezshaw.com
Wed Feb 1 09:56:55 PST 2023


Hi Elena

I see that you are converting to ED50, a very old system. I assume
that you *have
to* do it, instead of ETRS89 (I'm sorry about that).
How big is the reprojection error? I do not find that in your previous
email. To get a proper transformation you need a grid file (
es_ign_SPED2ETV2.tif <https://cdn.proj.org/es_ign_SPED2ETV2.tif>). I do not
know if it is supported in gdal 2.4.4
The transformation from ED50 to ETRS89 is defined in different ways in
different locations.

Cheers,
Javier
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.



On Wed, 1 Feb 2023 at 18:06, Elena Ruiz <eruiz at aplitop.com> wrote:

> Hello, thank you very much for answering, I have added the "-r bilinear"
> option to the gdalwarp command and this solves the distortion problem, but
> the reprojection is still wrong with the coordinates of the drawing
> matching those of the image, and the drawing does not fit the image as it
> does the original image. How do I have to call gdalwarp so that it does the
> reprojection correctly, that is, in addition to modifying the image that
> changes the coordinates and the image projection system? Regards
>
>
>
>
>
> ------------------------------
>
> *Elena Ruiz*
>
>
> Sofware Development & Technical Support
> Tel.: +34 952 43 97 71
> eruiz at aplitop.com
> *www.aplitop.com <http://www.aplitop.com>*
>
>
>
> <http://www.aplitop.com/Product/es/6/5/tcptunnel>
>
> <http://www.aplitop.com/New/es/281/mdt-75-a-la-venta>
>
>
>
>
>
> *De:* Even Rouault <even.rouault at spatialys.com>
> *Enviado el:* miércoles, 1 de febrero de 2023 16:58
> *Para:* Elena Ruiz <eruiz at aplitop.com>; gdal-dev at lists.osgeo.org
> *Asunto:* Re: [gdal-dev] Image reprojection with GDALWARP
>
>
>
> Try adding -r bilinear or -r bicubic. By default gdalwarp performs nearest
> resampling which is rarely what you need for high quality results
>
> Le 01/02/2023 à 16:44, Elena Ruiz a écrit :
>
>
>
> Hi, I'm trying to reproject images from WGS 84 / Pseudo-Mercator EPSG:3857
> to ED50 / UTM zone 30N EPSG:23030, but the resulting image doesn't adapt
> well to drawing. I will explain it in more detail so that you understand:
>
>
>
> I have an image in EPSG:3857, the result of a WMTS service, and a drawing
> in the same SRS, as you can see in the image the drawing matches the image
> perfectly.
>
> Image source with drawing:
> https://aplitop.sharefile.com/d-s4d6dcf6d8ff34023a8b6e95277519c56
>
>
>
> I want to convert the previous image to EPSG:23030 and I have used
> gdalwarp command with different parameters and I get the same result :
>
>
>
> 1*.gdalwarp -s_srs EPSG:3857 -t_srs EPSG:23030 -co "TFW=YES" -overwrite
> "C:\Users\elena\Downloads\Nueva carpeta\imagen_t.tif"
> "C:\Users\elena\Downloads\Nueva carpeta\nueva_6.tif"*
>
> 2.*gdalwarp -s_srs EPSG:3857 -t_srs EPSG:23030 -te 335000 4084501.25
> 335550 4084848.75 -co "TFW=YES" -overwrite "C:\Users\elena\Downloads\Nueva
> carpeta\imagen_t.tif" "C:\Users\elena\Downloads\Nueva carpeta\nueva_6.tif"*
>
>
>
> And the resulting image, in addition to noticing that the road is
> distorted (like a staircase effect), does not match the drawing.
>
> Image destination with drawing:
> https://aplitop.sharefile.com/d-s98f76513feb34c268764c0492ccb40d3
>
> Zoom of image destination:
> https://aplitop.sharefile.com/d-sf9a270a9300e4ac796eddeac7131a058
>
>
>
> I have also done the test from EPSG:23030 to EPSG:25830 and it does not do
> well either.
>
> I am using the version of gdal 2.4.4 for x64, this is the link to download
> the source and destination image:
> https://aplitop.sharefile.com/d-sdae2552bd2054fdf8cc29ce5b559e278 , I
> hope someone can help me and tell me if there is something wrong. Regards
> ------------------------------
>
> *Elena Ruiz *
> Sofware Development & Technical Support
> Tel. +34 952 43 97 71
> eruiz at aplitop.com
> Sumatra, 9 - 29190 Málaga (Spain)
> *www.aplitop.com <http://www.aplitop.com>*
>
> <https://www.facebook.com/AplitopSL/>   <https://twitter.com/aplitop>
> <https://www.linkedin.com/company/aplitop>
> <https://www.youtube.com/user/aplitop>
>
> In accordance with the provisions of the European Regulation of Data
> Protection 2016/679 (Reglamento Europeo de Protección de Datos 2016/679),
> we inform you that the data and the information you provide us through this
> medium will be used by APLITOP, S.L., with C.I.F. B-92543396 and with
> address at C / Sumatra, 9, Malaga, 29190, in order to answer your questions
> and inform you about our products. The data provided will be kept as long
> as it does not request its cessation and will not be transferred to third
> parties except in cases where there is a legal obligation. You have the
> right to access your personal data, correct inaccurate data or request its
> deletion when the data is no longer necessary for the purposes that were
> collected, as well as any rights recognized in the RGPD 2016/679
>
>
>
>
>
>
>
> _______________________________________________
>
> gdal-dev mailing list
>
> gdal-dev at lists.osgeo.org
>
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
>
> http://www.spatialys.com
>
> My software is free, but my time generally not.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230201/c295e45f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 365 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230201/c295e45f/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 619 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230201/c295e45f/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230201/c295e45f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 817 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230201/c295e45f/attachment-0003.png>


More information about the gdal-dev mailing list