roblabs / gdal2tilesp

Enhancements to tile cutter for parallelism and image format support
Other
20 stars 9 forks source link

Raster with non-square pixels #10

Closed KleggerKoder closed 7 years ago

roblabs commented 7 years ago

Here is the response from gdalinfo. If you can add your command line for gdal2tilesp.py that may be helpful for others testing.

gdalinfo USA_IFR_Low_Alaska_RESIZE.tif

Driver: GTiff/GeoTIFF
Files: USA_IFR_Low_Alaska_RESIZE.tif
Size is 20000, 2058
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
    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"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],
    AUTHORITY["EPSG","3857"]]
Origin = (-20037507.811301831156015,11734889.435571515932679)
Pixel Size = (2003.723337214412823,-3066.172484160079421)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-20037507.811,11734889.436) (179d59'59.98"W, 71d56'56.92"N)
Lower Left  (-20037507.811, 5424706.463) (179d59'59.98"W, 43d44'10.26"N)
Upper Right (20036958.933,11734889.436) (179d59'42.23"E, 71d56'56.92"N)
Lower Right (20036958.933, 5424706.463) (179d59'42.23"E, 43d44'10.26"N)
Center      (    -274.439, 8579797.949) (  0d 0' 8.88"W, 60d47'56.12"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  NoData Value=1
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  NoData Value=1
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  NoData Value=1
KleggerKoder commented 7 years ago

gdal2tilesp.py -z 0-10 -r lanczos

The raster in the pull request was a resized version of the original but it still serves as a good test. As you can tell from the info above the pixel size is : Pixel Size = (2003.723337214412823,-3066.172484160079421) So the previous algorithm was using only the x pixel size which was dropping the bottom part of the raster in this instance.