systemapic / pile

PostGIS tile server
0 stars 2 forks source link

Styling of rasters with pgraster #41

Open knutole opened 8 years ago

knutole commented 8 years ago

Currently, it's not possible to style rasters directly, ie. using RasterColorizer using pgraster (from what I understand). Only the GDAL plugin supports this.

In other words, in order to style colors of PostGIS rasters, they need to be vectorized first.

I have tried to use the gdal postgis plugin to read rasters from postgis (exchanging file param for a conn_string), but to no avail.

Would be great to have RasterColorizer support in pgraster, if at all feasible.

strk commented 8 years ago

pgraster does actually support RasterColorizer. See RFC here: https://github.com/mapnik/mapnik/wiki/RFC:-Raster-color-interpretation

For what concerns pile, all it takes to support the colorizer is to specify which band to use as the databand. band=1 would most likely do it. The only problem is deciding when to pass or not such parameter.

strk commented 8 years ago

The problem is that passing the band parameter disables any grayscale or RGB interpretation, so it should only be passed if and when a RasterColorizer style is used, and in case there are multiple bands, a guess should be made about which band is to be used as the data band (and I'm not sure things would work).

I've just created documentation for the plugin, which was missing, see https://github.com/mapnik/mapnik/wiki/PgRaster

knutole commented 8 years ago

Great, I will test it.