[gdal-dev] [help][gdalwarp]Use of gdalwarp with data overlapping antimeridian

Robert Coup robert.coup at koordinates.com
Thu Mar 8 06:40:44 PST 2018


Hi Christophe,

Have a look at the following:

https://lists.osgeo.org/pipermail/gdal-dev/2016-January/043358.html
https://gis.stackexchange.com/questions/37790/how-to-
reproject-raster-from-0-360-to-180-180-with-cutting-180-meridian

I'd suggest building a couple of VRT files to treat your data as -180 to
+180, then project each independently to EPSG:3857.

I'm sure there used to be an example in the GDAL docs, but I can't find it
- maybe I'm imagining it :)

As I’m new on this mail list do I have to “Reply All”? or just reply to you?


Reply all is good — that way everyone can read it.

Cheers,

Rob.

On 7 March 2018 at 13:05, LAVOYE Christophe <Christophe.LAVOYE at akka.eu>
wrote:

> Hi Robert,
>
>
>
> You could find my sample in attached files.
>
>
>
> This is the gdal informations:
>
>
>
> Driver: GTiff/GeoTIFF
>
> Files: D:\TEMP\TempProjectionsV2\BASE\baseAnteMeridien.tiff
>
> Size is 900, 803
>
> Coordinate System is:
>
> GEOGCS["WGS 84",
>
>     DATUM["WGS_1984",
>
>         SPHEROID["WGS 84",6378137,298.257223563,
>
>             AUTHORITY["EPSG","7030"]],
>
>         AUTHORITY["EPSG","6326"]],
>
>     PRIMEM["Greenwich",0],
>
>     UNIT["degree",0.0174532925199433],
>
>     AUTHORITY["EPSG","4326"]]
>
> GeoTransform =
>
>   179.9362167765823, 0.001541256882521351, 1.892378333877928e-005
>
>   66.12419696670919, 9.991578318404334e-006, -0.0006775726479453831
>
> Metadata:
>
>   AREA_OR_POINT=Area
>
>   TIFFTAG_XRESOLUTION=96
>
>   TIFFTAG_YRESOLUTION=96
>
> Image Structure Metadata:
>
>   COMPRESSION=JPEG
>
>   INTERLEAVE=PIXEL
>
> Corner Coordinates:
>
> Upper Left  ( 179.9362168,  66.1241970) (179d56'10.38"E, 66d 7'27.11"N)
>
> Lower Left  ( 179.9514126,  65.5801061) (179d57' 5.09"E, 65d34'48.38"N)
>
> Upper Right (     181.323,      66.133) (181d19'24.05"E, 66d 7'59.48"N)
>
> Lower Right (     181.339,      65.589) (181d20'18.76"E, 65d35'20.75"N)
>
> Center      ( 180.6373803,  65.8566478) (180d38'14.57"E, 65d51'23.93"N)
>
> Band 1 Block=900x803 Type=Byte, ColorInterp=Red
>
> Band 2 Block=900x803 Type=Byte, ColorInterp=Green
>
> Band 3 Block=900x803 Type=Byte, ColorInterp=Blue
>
>
>
> So my question concerns data which past +180° a
>
>
>
> I made old tests where I first cut my image and then make two warp
> operations and I remember it was working. I didn’t try to re-associate then.
>
> I have to test.
>
>
>
> As I’m not an expert I want to know the best approach to enable
> reprojection on those kind of data with coordinate over +180°.
>
>
>
> As I’m new on this mail list do I have to “Reply All”? or just reply to
> you?
>
>
>
> Best regards,
>
>
>
>
>
> [image: cid:image003.png at 01D1FD34.3B7C8CC0]
>
> *Christophe LAVOYE - **Analyste*
> * AKKA Technologies *Informatique & Systèmes
> 7 boulevard Henri Ziegler – 31700 BLAGNAC
> <https://maps.google.com/?q=7+boulevard+Henri+Ziegler+%E2%80%93+31700+BLAGNAC&entry=gmail&source=g>
> Tél : +33 (0)5 36 25 15 40 <+33%205%2036%2025%2015%2040>
> Email : christophe.lavoye at akka.eu
>
>
>
>
>
> *De :* Robert Coup [mailto:robert.coup at koordinates.com]
> *Envoyé :* mercredi 7 mars 2018 12:33
> *À :* LAVOYE Christophe
> *Cc :* gdal-dev at lists.osgeo.org
> *Objet :* Re: [gdal-dev] [help][gdalwarp]Use of gdalwarp with data
> overlapping antimeridian
>
>
>
> Hi Christophe,
>
>
>
> What do you *expect or want* to happen with your images?
>
>
>
> Are your 4326 image coordinates in -180° to +180° range (ie. the right
> longitude is < the left); or do they go past +180°?
>
>
>
> 3857 is a projected coordinate system, so doesn't have a builtin concept
> of wrapping. Some clients implement.
>
> Do you want x values >20037508.34? But they'll only display on the "right"
> side of the world then (if at all).
>
>
>
> The simplest approach is likely to be to do two warp operations, for the
> left and right parts, ending up with two images — one with
> left=-20037508.34 and one with right=+20037508.34
>
>
>
> Rob :)
>
>
>
>
>
> On 1 March 2018 at 15:23, LAVOYE Christophe <Christophe.LAVOYE at akka.eu>
> wrote:
>
> Hello,
>
>
>
> I’m using GDAL library in a C# project.
>
>
>
> To reproject some geotiff files i’m calling gdalwarp tool as external
> process with this command:
>
>
>
> gdalwarp.exe -s_srs EPSG:4326 -t_srs EPSG:3857 -dstalpha input.tiff
> output.tiff
>
>
>
>
>
> All works fine except for data overlapping antimeridian such as the
> associated tiff file.
>
>
>
> I don’t find how fix my problem or if I’m using the correct tool for those
> kind of data.
>
>
>
>
>
> Best regards,
>
>
>
>
>
> [image: cid:image003.png at 01D1FD34.3B7C8CC0]
>
> *Christophe LAVOYE - **Analyste*
> * AKKA Technologies *Informatique & Systèmes
> 7 boulevard Henri Ziegler – 31700 BLAGNAC
> <https://maps.google.com/?q=7+boulevard+Henri+Ziegler+%E2%80%93+31700+BLAGNAC&entry=gmail&source=g>
> Tél : +33 (0)5 36 25 15 40 <+33%205%2036%2025%2015%2040>
> Email : christophe.lavoye at akka.eu
>
>
>
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
>
> --
>
> Chief Technology Officer Koordinates
>
> +44 759 987 3480 <+44%20759%209873480> / koordinates.com / @koordinates
> <https://twitter.com/koordinates>
>



-- 

Chief Technology Officer Koordinates

+44 759 987 3480 <+44%20759%209873480> / koordinates.com / @koordinates
<https://twitter.com/koordinates>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180308/6fa153fe/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 11648 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180308/6fa153fe/attachment-0001.png>


More information about the gdal-dev mailing list