PNG driver chokes on raster gdal_transformed to ot byteTilecache positions my gdal_translated map 20km south of where I want itVSIMalloc3() and UnifiedSrcDensity mask errors when running gdal_warp in OSGEO4w shellgdal2tiles tile origin differences using Windows/OSGeo4W and Linux/GDALConvert grey,green,blue to red,green,blue tiffGetting origin as long, lat in GDAL without knowing EPSGCan gdalwarp reproject from ESPG:4326 (WGS84) to UTM?gdal_translate - raw to png?Transforming Lambert Conformal Conic to EPSG:3857Projecting EUMETSAT precipitation dataosgeo.gdal.Translate - How to set compression on GDAL GTiff driver
Approximately how much travel time was saved by the opening of the Suez Canal in 1869?
Which models of the Boeing 737 are still in production?
Today is the Center
Why don't electron-positron collisions release infinite energy?
How can bays and straits be determined in a procedurally generated map?
The use of multiple foreign keys on same column in SQL Server
Prove that NP is closed under karp reduction?
Why doesn't H₄O²⁺ exist?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Have astronauts in space suits ever taken selfies? If so, how?
Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)
strToHex ( string to its hex representation as string)
Languages that we cannot (dis)prove to be Context-Free
Maximum likelihood parameters deviate from posterior distributions
To string or not to string
TGV timetables / schedules?
Dragon forelimb placement
Modeling an IPv4 Address
What's the point of deactivating Num Lock on login screens?
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
In Japanese, what’s the difference between “Tonari ni” (となりに) and “Tsugi” (つぎ)? When would you use one over the other?
Why does Kotter return in Welcome Back Kotter?
Writing rule stating superpower from different root cause is bad writing
How to write a macro that is braces sensitive?
PNG driver chokes on raster gdal_transformed to ot byte
Tilecache positions my gdal_translated map 20km south of where I want itVSIMalloc3() and UnifiedSrcDensity mask errors when running gdal_warp in OSGEO4w shellgdal2tiles tile origin differences using Windows/OSGeo4W and Linux/GDALConvert grey,green,blue to red,green,blue tiffGetting origin as long, lat in GDAL without knowing EPSGCan gdalwarp reproject from ESPG:4326 (WGS84) to UTM?gdal_translate - raw to png?Transforming Lambert Conformal Conic to EPSG:3857Projecting EUMETSAT precipitation dataosgeo.gdal.Translate - How to set compression on GDAL GTiff driver
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'd like to extract a part of a DEM (data.linz.govt.nz wellinton lidar dem) and analyse it using gdaldem:
$ gdalinfo /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Driver: GTiff/GeoTIFF
Files: /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Size is 40827, 59684
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1079625.000000000000000,6229400.000000000000000)
Pixel Size = (25.000000000000000,-25.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1079625.000, 6229400.000) (167d22'19.08"E, 33d56'49.88"S)
Lower Left ( 1079625.000, 4737300.000) (166d 6'50.17"E, 47d18'37.53"S)
Upper Right ( 2100300.000, 6229400.000) (178d24'42.42"E, 33d57'24.89"S)
Lower Right ( 2100300.000, 4737300.000) (179d37'20.18"E, 47d19'33.76"S)
Center ( 1589962.500, 5483350.000) (172d52'51.63"E, 40d48' 2.84"S)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
NoData Value=-32768
Metadata:
LAYER_TYPE=athematic
That my source.
$ gdal_translate -q -scale -ot Byte -a_nodata 0 -of GTiff -projwin 1744670.939733, 5432632.999810, 1759079.145998, 5417666.249587 -outsize 256 256 /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
I tried all combinations, with or without scale, ot and a_nodata.
$ gdalinfo /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Driver: GTiff/GeoTIFF
Files: /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Size is 256, 256
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1744650.000000000000000,5432650.000000000000000)
Pixel Size = (56.250000000000000,-58.496093750000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1744650.000, 5432650.000) (174d43'34.71"E, 41d14'40.64"S)
Lower Left ( 1744650.000, 5417675.000) (174d43'47.53"E, 41d22'46.03"S)
Upper Right ( 1759050.000, 5432650.000) (174d53'53.08"E, 41d14'30.91"S)
Lower Right ( 1759050.000, 5417675.000) (174d54' 7.18"E, 41d22'36.25"S)
Center ( 1751850.000, 5425162.500) (174d48'50.62"E, 41d18'38.57"S)
Band 1 Block=256x32 Type=Byte, ColorInterp=Gray
NoData Value=0
Metadata:
LAYER_TYPE=athematic
gdaldem hillshade works but not slope or any of the other modes:
$ gdaldem slope /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b /dev/stdout -q -of PNG
returns the error:
ERROR 6: PNG driver doesn't support data type Float32. Only eight bit (Byte) and sixteen bit (UInt16) bands supported.
How do I translate the original raster so that conforms with what gdaldem slope and co expect?
gdal gdal-translate gdaldem
New contributor
add a comment |
I'd like to extract a part of a DEM (data.linz.govt.nz wellinton lidar dem) and analyse it using gdaldem:
$ gdalinfo /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Driver: GTiff/GeoTIFF
Files: /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Size is 40827, 59684
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1079625.000000000000000,6229400.000000000000000)
Pixel Size = (25.000000000000000,-25.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1079625.000, 6229400.000) (167d22'19.08"E, 33d56'49.88"S)
Lower Left ( 1079625.000, 4737300.000) (166d 6'50.17"E, 47d18'37.53"S)
Upper Right ( 2100300.000, 6229400.000) (178d24'42.42"E, 33d57'24.89"S)
Lower Right ( 2100300.000, 4737300.000) (179d37'20.18"E, 47d19'33.76"S)
Center ( 1589962.500, 5483350.000) (172d52'51.63"E, 40d48' 2.84"S)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
NoData Value=-32768
Metadata:
LAYER_TYPE=athematic
That my source.
$ gdal_translate -q -scale -ot Byte -a_nodata 0 -of GTiff -projwin 1744670.939733, 5432632.999810, 1759079.145998, 5417666.249587 -outsize 256 256 /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
I tried all combinations, with or without scale, ot and a_nodata.
$ gdalinfo /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Driver: GTiff/GeoTIFF
Files: /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Size is 256, 256
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1744650.000000000000000,5432650.000000000000000)
Pixel Size = (56.250000000000000,-58.496093750000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1744650.000, 5432650.000) (174d43'34.71"E, 41d14'40.64"S)
Lower Left ( 1744650.000, 5417675.000) (174d43'47.53"E, 41d22'46.03"S)
Upper Right ( 1759050.000, 5432650.000) (174d53'53.08"E, 41d14'30.91"S)
Lower Right ( 1759050.000, 5417675.000) (174d54' 7.18"E, 41d22'36.25"S)
Center ( 1751850.000, 5425162.500) (174d48'50.62"E, 41d18'38.57"S)
Band 1 Block=256x32 Type=Byte, ColorInterp=Gray
NoData Value=0
Metadata:
LAYER_TYPE=athematic
gdaldem hillshade works but not slope or any of the other modes:
$ gdaldem slope /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b /dev/stdout -q -of PNG
returns the error:
ERROR 6: PNG driver doesn't support data type Float32. Only eight bit (Byte) and sixteen bit (UInt16) bands supported.
How do I translate the original raster so that conforms with what gdaldem slope and co expect?
gdal gdal-translate gdaldem
New contributor
2
Think what the error message says and don't try to create png but create a GeoTIFF instead with-ot GTiff
. In the first clipping command leave out-ot Byte
. You should not convert DEM into 8 bit.
– user30184
Apr 3 at 5:10
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06
add a comment |
I'd like to extract a part of a DEM (data.linz.govt.nz wellinton lidar dem) and analyse it using gdaldem:
$ gdalinfo /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Driver: GTiff/GeoTIFF
Files: /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Size is 40827, 59684
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1079625.000000000000000,6229400.000000000000000)
Pixel Size = (25.000000000000000,-25.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1079625.000, 6229400.000) (167d22'19.08"E, 33d56'49.88"S)
Lower Left ( 1079625.000, 4737300.000) (166d 6'50.17"E, 47d18'37.53"S)
Upper Right ( 2100300.000, 6229400.000) (178d24'42.42"E, 33d57'24.89"S)
Lower Right ( 2100300.000, 4737300.000) (179d37'20.18"E, 47d19'33.76"S)
Center ( 1589962.500, 5483350.000) (172d52'51.63"E, 40d48' 2.84"S)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
NoData Value=-32768
Metadata:
LAYER_TYPE=athematic
That my source.
$ gdal_translate -q -scale -ot Byte -a_nodata 0 -of GTiff -projwin 1744670.939733, 5432632.999810, 1759079.145998, 5417666.249587 -outsize 256 256 /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
I tried all combinations, with or without scale, ot and a_nodata.
$ gdalinfo /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Driver: GTiff/GeoTIFF
Files: /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Size is 256, 256
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1744650.000000000000000,5432650.000000000000000)
Pixel Size = (56.250000000000000,-58.496093750000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1744650.000, 5432650.000) (174d43'34.71"E, 41d14'40.64"S)
Lower Left ( 1744650.000, 5417675.000) (174d43'47.53"E, 41d22'46.03"S)
Upper Right ( 1759050.000, 5432650.000) (174d53'53.08"E, 41d14'30.91"S)
Lower Right ( 1759050.000, 5417675.000) (174d54' 7.18"E, 41d22'36.25"S)
Center ( 1751850.000, 5425162.500) (174d48'50.62"E, 41d18'38.57"S)
Band 1 Block=256x32 Type=Byte, ColorInterp=Gray
NoData Value=0
Metadata:
LAYER_TYPE=athematic
gdaldem hillshade works but not slope or any of the other modes:
$ gdaldem slope /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b /dev/stdout -q -of PNG
returns the error:
ERROR 6: PNG driver doesn't support data type Float32. Only eight bit (Byte) and sixteen bit (UInt16) bands supported.
How do I translate the original raster so that conforms with what gdaldem slope and co expect?
gdal gdal-translate gdaldem
New contributor
I'd like to extract a part of a DEM (data.linz.govt.nz wellinton lidar dem) and analyse it using gdaldem:
$ gdalinfo /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Driver: GTiff/GeoTIFF
Files: /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif
Size is 40827, 59684
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1079625.000000000000000,6229400.000000000000000)
Pixel Size = (25.000000000000000,-25.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1079625.000, 6229400.000) (167d22'19.08"E, 33d56'49.88"S)
Lower Left ( 1079625.000, 4737300.000) (166d 6'50.17"E, 47d18'37.53"S)
Upper Right ( 2100300.000, 6229400.000) (178d24'42.42"E, 33d57'24.89"S)
Lower Right ( 2100300.000, 4737300.000) (179d37'20.18"E, 47d19'33.76"S)
Center ( 1589962.500, 5483350.000) (172d52'51.63"E, 40d48' 2.84"S)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
NoData Value=-32768
Metadata:
LAYER_TYPE=athematic
That my source.
$ gdal_translate -q -scale -ot Byte -a_nodata 0 -of GTiff -projwin 1744670.939733, 5432632.999810, 1759079.145998, 5417666.249587 -outsize 256 256 /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
I tried all combinations, with or without scale, ot and a_nodata.
$ gdalinfo /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Driver: GTiff/GeoTIFF
Files: /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b
Size is 256, 256
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
DATUM["New_Zealand_Geodetic_Datum_2000",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6167"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1744650.000000000000000,5432650.000000000000000)
Pixel Size = (56.250000000000000,-58.496093750000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 1744650.000, 5432650.000) (174d43'34.71"E, 41d14'40.64"S)
Lower Left ( 1744650.000, 5417675.000) (174d43'47.53"E, 41d22'46.03"S)
Upper Right ( 1759050.000, 5432650.000) (174d53'53.08"E, 41d14'30.91"S)
Lower Right ( 1759050.000, 5417675.000) (174d54' 7.18"E, 41d22'36.25"S)
Center ( 1751850.000, 5425162.500) (174d48'50.62"E, 41d18'38.57"S)
Band 1 Block=256x32 Type=Byte, ColorInterp=Gray
NoData Value=0
Metadata:
LAYER_TYPE=athematic
gdaldem hillshade works but not slope or any of the other modes:
$ gdaldem slope /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b /dev/stdout -q -of PNG
returns the error:
ERROR 6: PNG driver doesn't support data type Float32. Only eight bit (Byte) and sixteen bit (UInt16) bands supported.
How do I translate the original raster so that conforms with what gdaldem slope and co expect?
gdal gdal-translate gdaldem
gdal gdal-translate gdaldem
New contributor
New contributor
edited Apr 3 at 12:18
Vince
14.8k32849
14.8k32849
New contributor
asked Apr 3 at 4:44
adminopasswordoadminopasswordo
61
61
New contributor
New contributor
2
Think what the error message says and don't try to create png but create a GeoTIFF instead with-ot GTiff
. In the first clipping command leave out-ot Byte
. You should not convert DEM into 8 bit.
– user30184
Apr 3 at 5:10
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06
add a comment |
2
Think what the error message says and don't try to create png but create a GeoTIFF instead with-ot GTiff
. In the first clipping command leave out-ot Byte
. You should not convert DEM into 8 bit.
– user30184
Apr 3 at 5:10
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06
2
2
Think what the error message says and don't try to create png but create a GeoTIFF instead with
-ot GTiff
. In the first clipping command leave out -ot Byte
. You should not convert DEM into 8 bit.– user30184
Apr 3 at 5:10
Think what the error message says and don't try to create png but create a GeoTIFF instead with
-ot GTiff
. In the first clipping command leave out -ot Byte
. You should not convert DEM into 8 bit.– user30184
Apr 3 at 5:10
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06
add a comment |
1 Answer
1
active
oldest
votes
I found my answer in the fine print: slope will output a 32-bit float and so will aspect, so no PNG without post processing.
No idea what type TRI and TPI spit out.
Color-relief however returns RGB or RGBA. I had initially missed the color map file, so this is working now.
gdaldem color-relief /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b color_relief.txt /dev/stdout -q -of PNG -alpha
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
adminopasswordo is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317585%2fpng-driver-chokes-on-raster-gdal-transformed-to-ot-byte%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found my answer in the fine print: slope will output a 32-bit float and so will aspect, so no PNG without post processing.
No idea what type TRI and TPI spit out.
Color-relief however returns RGB or RGBA. I had initially missed the color map file, so this is working now.
gdaldem color-relief /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b color_relief.txt /dev/stdout -q -of PNG -alpha
New contributor
add a comment |
I found my answer in the fine print: slope will output a 32-bit float and so will aspect, so no PNG without post processing.
No idea what type TRI and TPI spit out.
Color-relief however returns RGB or RGBA. I had initially missed the color map file, so this is working now.
gdaldem color-relief /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b color_relief.txt /dev/stdout -q -of PNG -alpha
New contributor
add a comment |
I found my answer in the fine print: slope will output a 32-bit float and so will aspect, so no PNG without post processing.
No idea what type TRI and TPI spit out.
Color-relief however returns RGB or RGBA. I had initially missed the color map file, so this is working now.
gdaldem color-relief /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b color_relief.txt /dev/stdout -q -of PNG -alpha
New contributor
I found my answer in the fine print: slope will output a 32-bit float and so will aspect, so no PNG without post processing.
No idea what type TRI and TPI spit out.
Color-relief however returns RGB or RGBA. I had initially missed the color map file, so this is working now.
gdaldem color-relief /tmp/silverstripe-cache-php7.2.15-1+ubuntu16.04.1+deb.sury.org+1-vagrant/www-data/5ca433d05e16b color_relief.txt /dev/stdout -q -of PNG -alpha
New contributor
New contributor
answered 2 days ago
adminopasswordoadminopasswordo
61
61
New contributor
New contributor
add a comment |
add a comment |
adminopasswordo is a new contributor. Be nice, and check out our Code of Conduct.
adminopasswordo is a new contributor. Be nice, and check out our Code of Conduct.
adminopasswordo is a new contributor. Be nice, and check out our Code of Conduct.
adminopasswordo is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317585%2fpng-driver-chokes-on-raster-gdal-transformed-to-ot-byte%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Think what the error message says and don't try to create png but create a GeoTIFF instead with
-ot GTiff
. In the first clipping command leave out-ot Byte
. You should not convert DEM into 8 bit.– user30184
Apr 3 at 5:10
Your gdaldem slope needs to be output to a format that does support floating point data, like GeoTIFF (-of GTIFF) or ERDAS Imagine (-of HFA) or the lowest form ASCII Grid (-of AAIGRID).. you have told it to output to a PNG which only supports 8 bit unsigned so gdaldem is refusing to write to this driver. Why are you trying to scale your DEM to 8 bit? It should be at least 16 bit integer, most likely 32 bit float or 64 bit float (double), scaling to 8 bit is not fit for any further processing but for display only.
– Michael Stimson
Apr 3 at 5:16
The idea is to generate a 256*256 PNG map tile to use with leaflet.
– adminopasswordo
Apr 3 at 6:13
Is my problem that the input from the translation contains data that is neither byte nor UInt16 or that gdaldem cannot do slopes in PNG? Again hillshade works, just not the others.
– adminopasswordo
Apr 3 at 7:06