0

I want to generate tiles from a GeoTIFF file using gdal2tiles.

gdal2tiles.py input.tif

when I try the above command I got the following error

Too many points (10201 out of 10201) failed to transform, unable to compute output bounds.

gdalinfo of the tiff file is

{
  "description":"input.tif",
  "driverShortName":"GTiff",
  "driverLongName":"GeoTIFF",
  "files":[
    "input.tif"
  ],
  "size":[
    21229,
    22620
  ],
  "coordinateSystem":{
    "wkt":"GEOGCRS[\"WGS 84\",\n    DATUM[\"World Geodetic System 1984\",\n        ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n            LENGTHUNIT[\"metre\",1]]],\n    PRIMEM[\"Greenwich\",0,\n        ANGLEUNIT[\"degree\",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS[\"geodetic latitude (Lat)\",north,\n            ORDER[1],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        AXIS[\"geodetic longitude (Lon)\",east,\n            ORDER[2],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n    USAGE[\n        SCOPE[\"unknown\"],\n        AREA[\"World\"],\n        BBOX[-90,-180,90,180]],\n    ID[\"EPSG\",4326]]",
    "dataAxisToSRSAxisMapping":[
      2,
      1
    ]
  },
  "geoTransform":[
    615760.8191289966925979,
    0.05,
    0.0,
    3398079.7514832559973001,
    0.0,
    -0.05
  ],
  "metadata":{
    "":{
      "AREA_OR_POINT":"Area"
    },
    "IMAGE_STRUCTURE":{
      "COMPRESSION":"LZW",
      "INTERLEAVE":"PIXEL"
    }
  },
  "cornerCoordinates":{
    "upperLeft":[
      615760.819,
      3398079.751
    ],
    "lowerLeft":[
      615760.819,
      3396948.751
    ],
    "lowerRight":[
      616822.269,
      3396948.751
    ],
    "upperRight":[
      616822.269,
      3398079.751
    ],
    "center":[
      616291.544,
      3397514.251
    ]
  },
  "wgs84Extent":{
    "type":"Polygon",
    "coordinates":[
      [
        [
          615760.819129,
          3398079.7514833
        ],
        [
          615760.819129,
          3396948.7514833
        ],
        [
          616822.269129,
          3396948.7514833
        ],
        [
          616822.269129,
          3398079.7514833
        ],
        [
          615760.819129,
          3398079.7514833
        ]
      ]
    ]
  },
  "bands":[
    {
      "band":1,
      "block":[
        21229,
        32
      ],
      "type":"Byte",
      "colorInterpretation":"Red",
      "metadata":{
      }
    },
    {
      "band":2,
      "block":[
        21229,
        32
      ],
      "type":"Byte",
      "colorInterpretation":"Green",
      "metadata":{
      }
    },
    {
      "band":3,
      "block":[
        21229,
        32
      ],
      "type":"Byte",
      "colorInterpretation":"Blue",
      "metadata":{
      }
    },
    {
      "band":4,
      "block":[
        21229,
        32
      ],
      "type":"Byte",
      "colorInterpretation":"Undefined",
      "metadata":{
      }
    }
  ]
} 

I tried to convert the tiff file using

gdal_translate -of GTiff -a_srs EPSG:4362 input.tif temp.tif
gdalwarp -t_srs EPSG:4326 temp.tif output.tif 

gdal2tiles works fine but they show up in the completely wrong location.

What mistake I am doing?


UPDATE


I can able to produce tiles for the specific location by the following command:

gdal_translate -of GTiff -a_srs EPSG:32643 input.tif output.tif
gdal2tiles.py output.tif output

Here I'm using the UTM projection system.

But how can I get the UTM zone and EPSG reference for a given tif file? I am not getting any info from gdalinfo.

  • Your original image must have wrong georeferencing info. It claims to be in EPSG:4326 but corner coordinates 615760.819, 3398079.751 are telling another story. How did you guess that it is really in EPSG:32643? Could you ask your image provider to fix their images? – user30184 Oct 1 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.