Quantcast

[gdal-dev] gdaldem color-relief transparency

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] gdaldem color-relief transparency

Paolo Cavallini
Hi all,
sorry if this is not the right list. Please redirect me elsewhere in case.
I cannot give a transparency to NULL when creating a coloured raster:

gdaldem color-relief -alpha temp_clip.tif byr.txt temp_col.tif -of GTiff

where byr.txt is:

0% 5 113 176 255
25% 146 197 222 255
50% 247 247 247 255
75% 244 165 130 255
100% 202 0 32 255
nv 255 255 255 0

I tried several other combinations, but I cannot hava a transparency of
NULLs.
Where am I wrong?
All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdaldem color-relief transparency

Even Rouault-2

Paolo,

 

This works for me as expected with the following input raster (and using your palette):

 

$ cat wrk/in.asc

ncols 2

nrows 2

xllcorner 440720.000000000000

yllcorner 3750120.000000000000

cellsize 60.000000000000

NODATA_value 0

107 123

0 100

 

$ gdaldem color-relief -alpha wrk/in.asc wrk/palette.txt wrk/out.tif

 

$ gdal_translate wrk/out.tif /vsistdout/ -of aaigrid -b 4

ncols 2

nrows 2

xllcorner 440720.000000000000

yllcorner 3750120.000000000000

cellsize 60.000000000000

255 255

0 255

 

 

Perhaps there's an issue with the nodata value of your raster ?

 

Even

 

 

> Hi all,

> sorry if this is not the right list. Please redirect me elsewhere in case.

> I cannot give a transparency to NULL when creating a coloured raster:

>

> gdaldem color-relief -alpha temp_clip.tif byr.txt temp_col.tif -of GTiff

>

> where byr.txt is:

>

> 0% 5 113 176 255

> 25% 146 197 222 255

> 50% 247 247 247 255

> 75% 244 165 130 255

> 100% 202 0 32 255

> nv 255 255 255 0

>

> I tried several other combinations, but I cannot hava a transparency of

> NULLs.

> Where am I wrong?

> All the best.

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdaldem color-relief transparency

Paolo Cavallini
Hi Even,

Il 22/12/2016 16:57, Even Rouault ha scritto:

> Perhaps there's an issue with the nodata value of your raster ?

maybe; I have created it with:

gdalwarp -q -cutline mcp_buf.shp -tr 0.0015703125 0.00038671875
temperature.tif temp_clip.tif

How do I check?

Thanks.

--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdaldem color-relief transparency

Even Rouault-2

On jeudi 22 d├ęcembre 2016 17:14:33 CET Paolo Cavallini wrote:

> Hi Even,

>

> Il 22/12/2016 16:57, Even Rouault ha scritto:

> > Perhaps there's an issue with the nodata value of your raster ?

>

> maybe; I have created it with:

>

> gdalwarp -q -cutline mcp_buf.shp -tr 0.0015703125 0.00038671875

> temperature.tif temp_clip.tif

 

Look at the nodata value reported with

 

gdalinfo temp_clip.tif

 

If there's none, then you've spotted the issue and you need to define one with -dstnodata

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdaldem color-relief transparency

Paolo Cavallini
Il 22/12/2016 17:21, Even Rouault ha scritto:

> If there's none, then you've spotted the issue and you need to define
> one with -dstnodata

exactly, it works now with

gdalwarp -dstnodata -999 -q -cutline mcp_buf.shp -tr 0.0015703125
0.00038671875 output/temperature.tif output/temp_clip.tif

thanks a lot
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...