rio-rgbify icon indicating copy to clipboard operation
rio-rgbify copied to clipboard

rasterio._err.CPLE_AppDefinedError: densify_pts must be at least 2 if the output is geograpic

Open ahmadiqbalpk opened this issue 1 year ago • 12 comments

I am getting this error. I have installed python 3.8 and pip install rio-rgbify. When ever i run this command "rio rgbify --format png --min-z 0 --max-z 15 input.tif output.mbtiles

I am getting this error "_rasterio.err.CPLE_AppDefinedError: densify_pts must be at least 2 if the output is geograpic."

Kindly tell me what is the issue. I have checked all the online forums and also try your tif dataset.

ahmadiqbalpk avatar Jul 25 '22 11:07 ahmadiqbalpk

I'm also stuck with this same issue except in this case: When I run against .hgt files from the NASA SRTM DEM's I don't see this error, but I get it if I run it with any other tif file (including one generated from gdalwarping the .hgt SRTM files into geotifs in EPSG3857)

rumicuna avatar Jul 25 '22 23:07 rumicuna

I also encounter this error when producing mbtiles. If the output is tif then there is no such error.

Input tif:

Driver: GTiff/GeoTIFF
Files: smooth-sk-warped.tif
Size is 475105, 293083
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
    BASEGEOGCRS["WGS 84",
        ENSEMBLE["World Geodetic System 1984 ensemble",
            MEMBER["World Geodetic System 1984 (Transit)"],
            MEMBER["World Geodetic System 1984 (G730)"],
            MEMBER["World Geodetic System 1984 (G873)"],
            MEMBER["World Geodetic System 1984 (G1150)"],
            MEMBER["World Geodetic System 1984 (G1674)"],
            MEMBER["World Geodetic System 1984 (G1762)"],
            MEMBER["World Geodetic System 1984 (G2139)"],
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]],
            ENSEMBLEACCURACY[2.0]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["Popular Visualisation Pseudo-Mercator",
        METHOD["Popular Visualisation Pseudo Mercator",
            ID["EPSG",1024]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["False easting",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Web mapping and visualisation."],
        AREA["World between 85.06°S and 85.06°N."],
        BBOX[-85.06,-180,85.06,180]],
    ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (1849822.663334832992405,6393767.517880097031593)
Pixel Size = (1.194328566968441,-1.194328566968441)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
  PREDICTOR=2
Corner Coordinates:
Upper Left  ( 1849822.663, 6393767.518) ( 16d37' 2.06"E, 49d41'45.05"N)
Lower Left  ( 1849822.663, 6043730.118) ( 16d37' 2.06"E, 47d37' 9.00"N)
Upper Right ( 2417254.137, 6393767.518) ( 21d42'52.43"E, 49d41'45.05"N)
Lower Right ( 2417254.137, 6043730.118) ( 21d42'52.43"E, 47d37' 9.00"N)
Center      ( 2133538.400, 6218748.818) ( 19d 9'57.25"E, 48d40' 5.53"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray

zdila avatar Aug 11 '22 07:08 zdila

In my case it was issue with "no data points" I delete it using - gdalwarp, then run the "rio rgbify --format png --min-z 0 --max-z 15 input.tif output.mbtiles". it works fine

ahmadiqbalpk avatar Aug 11 '22 18:08 ahmadiqbalpk

I have same issue : no problem with geotiff output, but with mbtiles, it crashs.

I tested on tiff with, and without "No Data" value, and the result is every time the same.

There was not any problem with 1.2.0 version of rasterio from Debian packages repositories.

gqdc avatar Aug 21 '22 09:08 gqdc

@dnomadb Do you also reproduce the issue ? Any idea what it could be ?

utagawal avatar Aug 28 '22 15:08 utagawal

Same here.

NasH5169 avatar Oct 20 '22 15:10 NasH5169