[gdal-dev] Errors with gdalwarp in reprojection
Even Rouault
even.rouault at spatialys.com
Mon Mar 29 08:46:58 PDT 2021
Hi,
There might 2 potential issues here: being close to the antimeridian
(and potentially slightly crossing it, but not visible here with the
rounding used to display coordinates), and being close to the pole. I
think that might be the later reason here. Basically EPSG:3857 can't be
reasonably used beyond 85 degrees of latitude. Latitudes of +/- 90
project to infinity in mercator projection...
Even
Le 29/03/2021 à 17:24, Hotmail a écrit :
> Hi,
>
> From a png file library (524288 tiles of 256x256px), I georeference
> them using gdal_translate like this :
> => gdal_translate -of VRT -a_srs EPSG: 4326 -a_nodata 255 PATH /
> FILE.png PATH / FILE.vrt -a_ullr ULLR
>
> Then I use gdalwarp to reproject them like this :
> => gdalwarp -overwrite -s_srs EPSG:4326 -t_srs EPSG:3857 -co
> COMPRESS=LZW PATH/FILE.vrt PATH/FILE.tiff
>
> 524286 tiles, out of 524288, work without any problem but 2 gives me
> an error message …
>
> The 2 .vrt files of these tiles tell me this :
>
> Driver: VRT/Virtual Raster
> Files: map_11_1023_0.vrt
> /Users/romain/VRTiles/bw_png/map_11_1023_0.png
> Size is 256, 256
> Coordinate System is:
> GEOGCRS["WGS 84",
> DATUM["World Geodetic System 1984",
> ELLIPSOID["WGS 84",6378137,298.257223563,
> LENGTHUNIT["metre",1]]],
> PRIMEM["Greenwich",0,
> ANGLEUNIT["degree",0.0174532925199433]],
> CS[ellipsoidal,2],
> AXIS["geodetic latitude (Lat)",north,
> ORDER[1],
> ANGLEUNIT["degree",0.0174532925199433]],
> AXIS["geodetic longitude (Lon)",east,
> ORDER[2],
> ANGLEUNIT["degree",0.0174532925199433]],
> ID["EPSG",4326]]
> Data axis to CRS axis mapping: 2,1
> Origin = (179.648437500000000,90.000000000000000)
> Pixel Size = (0.001373291015625,-0.001373291015625)
> Corner Coordinates:
> Upper Left ( 179.6484375, 90.0000000) (179d38'54.38"E, 90d 0' 0.00"N)
> Lower Left ( 179.6484375, 89.6484375) (179d38'54.38"E, 89d38'54.38"N)
> Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
> Lower Right ( 180.0000000, 89.6484375) (180d 0' 0.00"E, 89d38'54.38"N)
> Center ( 179.8242188, 89.8242188) (179d49'27.19"E, 89d49'27.19"N)
> Band 1 Block=128x128 Type=Byte, ColorInterp=Palette
> NoData Value=255
> Image Structure Metadata:
> NBITS=1
> Color Table (RGB with 2 entries)
> 0: 0,0,0,255
> 1: 255,255,255,255
>
> Driver: VRT/Virtual Raster
> Files: map_11_1023_511.vrt
> /Users/romain/VRTiles/bw_png/map_11_1023_511.png
> Size is 256, 256
> Coordinate System is:
> GEOGCRS["WGS 84",
> DATUM["World Geodetic System 1984",
> ELLIPSOID["WGS 84",6378137,298.257223563,
> LENGTHUNIT["metre",1]]],
> PRIMEM["Greenwich",0,
> ANGLEUNIT["degree",0.0174532925199433]],
> CS[ellipsoidal,2],
> AXIS["geodetic latitude (Lat)",north,
> ORDER[1],
> ANGLEUNIT["degree",0.0174532925199433]],
> AXIS["geodetic longitude (Lon)",east,
> ORDER[2],
> ANGLEUNIT["degree",0.0174532925199433]],
> ID["EPSG",4326]]
> Data axis to CRS axis mapping: 2,1
> Origin = (179.648437500000000,-89.648437500000000)
> Pixel Size = (0.001373291015625,-0.001373291015625)
> Corner Coordinates:
> Upper Left ( 179.6484375, -89.6484375) (179d38'54.38"E, 89d38'54.38"S)
> Lower Left ( 179.6484375, -90.0000000) (179d38'54.38"E, 90d 0' 0.00"S)
> Upper Right ( 180.0000000, -89.6484375) (180d 0' 0.00"E, 89d38'54.38"S)
> Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
> Center ( 179.8242188, -89.8242188) (179d49'27.19"E, 89d49'27.19"S)
> Band 1 Block=128x128 Type=Byte, ColorInterp=Palette
> NoData Value=255
> Image Structure Metadata:
> NBITS=1
> Color Table (RGB with 2 entries)
> 0: 0,0,0,255
> 1: 255,255,255,255
>
>
> _gdalwarp errors :_
> • the first one give me this :
>
> Creating output file that is -2147483648P x 362L.
> ERROR 1: Attempt to create -2147483648x362 dataset is illegal,sizes
> must be larger than zero.
>
> • the second one give me this :
>
> Creating output file that is -2147483648P x 362L.
> ERROR 1: Attempt to create -2147483648x362 dataset is illegal,sizes
> must be larger than zero.
>
> And I don't understand why ... what am I doing that is not correct
> since it works well on all the other tiles?
>
> I use GDAL 3.2.2, released 2021/03/05
>
> Thanks
>
> Romain
>
> _______________________________________________
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210329/ea5901fa/attachment.html>
More information about the gdal-dev
mailing list