[mapserver-users] WMS - Change color map of a DEM dynamically
Stephen Woodbridge
woodbri at swoodbridge.com
Tue May 30 17:09:46 PDT 2017
I don't use QGIS so maybe someone else has some idea how to do what you
want with that. I think I might try something along these lines:
Create a GDAL VRT file for each theme and add appropriate color tables
for them. You might need to write a script to generate the color ramps
as color table entries, but once you have them you should be good.
The VRT files can all reference the same DEM.tif file so you are only
create VRT file for the color tables.
Then create appropriate layers in the mapfile each referencing one of
the VRT files. Then the user can select the appropriate WMS layer from
the mapfile dor the styling they want.
-Steve W
On 5/30/2017 7:56 PM, Eduardo Kanegae wrote:
> Hi,
>
> I'm running MapServer 7.0.5 with GDAL 2.2.0 (CentOS x64) and have a 6Gb
> DEM tiff(float32) with overviews. Currently I set up a color ramp in
> QGIS based on values/colors of some GRASS color tables such as ETOPO2,
> SRTM and Terrain.
> Then in mapfile I used a color ramp (colorrange, datarange, rangeitem)
> coying colors and limit values from QGIS themes.
>
> I'd like to let users to dynamically change the WMS raster output using
> QGIS. Then, it could avoid to duplicating LAYERS declarations such as
> "dem_srtmtheme", "dem_etopo2theme" and so on.
> Or this (such as SLD) will be possible only for 8bit rasters and vectors?
>
> thanks in advance.
>
> Here's the dump(gdalinfo) of my raster file:
>
> Driver: GTiff/GeoTIFF
> Files: /myfile.tif
> /myfile.tif.ovr
> Size is 45369, 38050
> Coordinate System is:
> PROJCS["SIRGAS 2000 / UTM zone 23S",
> GEOGCS["SIRGAS 2000",
> DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",
> SPHEROID["GRS 1980",6378137,298.257222101,
> AUTHORITY["EPSG","7019"]],
> TOWGS84[0,0,0,0,0,0,0],
> AUTHORITY["EPSG","6674"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.0174532925199433,
> AUTHORITY["EPSG","9122"]],
> AUTHORITY["EPSG","4674"]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",-45],
> PARAMETER["scale_factor",0.9996],
> PARAMETER["false_easting",500000],
> PARAMETER["false_northing",10000000],
> UNIT["metre",1,
> AUTHORITY["EPSG","9001"]],
> AXIS["Easting",EAST],
> AXIS["Northing",NORTH],
> AUTHORITY["EPSG","31983"]]
> Origin = (268724.500000000000000,7485552.500000000000000)
> Pixel Size = (1.000000000000000,-1.000000000000000)
> Metadata:
> AREA_OR_POINT=Area
> Image Structure Metadata:
> INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left ( 268724.500, 7485552.500) ( 47d15' 6.30"W, 22d43'17.44"S)
> Lower Left ( 268724.500, 7447502.500) ( 47d15'26.74"W, 23d 3'53.89"S)
> Upper Right ( 314093.500, 7485552.500) ( 46d48'36.78"W, 22d43'37.63"S)
> Lower Right ( 314093.500, 7447502.500) ( 46d48'53.22"W, 23d 4'14.43"S)
> Center ( 291409.000, 7466527.500) ( 47d 2' 0.78"W, 22d53'46.41"S)
> Band 1 Block=45369x1 Type=Float32, ColorInterp=Gray
> NoData Value=-32768
> Overviews: 22685x19025, 11343x9513, 5672x4757, 2836x2379
>
>
> Eduardo Patto Kanegae
> http://www.webmapit.com.br | @webmapit
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the MapServer-users
mailing list