Search code examples
gdal

Is gdalwarp broken? reprojection failed


I use gdalwarp to get a planisphere with the EPSG 4326 projection (equidistant cylindrical projection). Before with GDAL 2 I had no problem to use gdalwarp with this command :

gdalwarp -te lonMin latMin lonMax latMax -t_srs EPSG:4326 sphere.tiff planisphere.tiff

Example

gdalwarp -te -100 -10 -60 10 -t_srs EPSG:4326 sphere.tiff planisphere.tiff

But now with GDAL 3.0.4 it returns an error like if I made a mistake in coordinates.

Creating output file that is 0P x 0L. ERROR 1: Attempt to create 0x0 dataset is illegal,sizes must be larger than zero.

Do we need to install something else now? (maybe because now GDAL seems to use PROJ6).

If someone have the solution or an idea, I will be glad to hear it. Thanks !


Solution

  • Alright gdalwarp works well, this problem is due to gdal_translate. Since GDAL 3, if you extract an image from netCDF file, it doesn't georeference automatically your tiff image. This is why gdalwarp wouldn't work because it was impossible to crop my image. So if you have a non-georeferenced image, you have to georeference your image with gdal_translate.