Closed knutole closed 8 years ago
Have checked the pixel values, they are fine (ie. they all have normal values between 20 and 200).
pgraster plugin has no knowledge of RasterColorizer, it just provides the raster to the upstream code which decides what to do with it.
The only thing affecting PgRaster fetching of the data is the "band" parameter, which determines which band is being sent to upper levels. In the "snow" case there's a single band so it should always be used for band=0 or band=1
See if removing the "prescale-rasters" parameter changes anything
Dropped pixels persists even without gdalwarp
on import, and without pre-tiling on import (ie. raster2pgsql -I -C $1 $2 | PGPASSWORD=$PGPASSWORD psql --host=$PGHOST --username=$PGUSERNAME $3
)
Problem persists:
For reference, prescale_rasters
and clip_rasters
also have no effect. Neither does preunion_rasters
.
Curiously, it's not the same pixels that are dropped on different zoom levels. Which suggests that this is not an issue with actual pixel values?
Interesting to note that the NODATA
pixels are transparent and with gaussian blur (as expected), but the dropped pixels DO NOT have gaussian blur. In other words, they don't seem to be rendered as a pixel value per se at all.
Compare with gaussian
off:
Problem only arises with use of RasterColorizer/RasterSymbolizer
:
(Ie. the only code-change is removing postgis_settings.band = 1
)
So a probable reason for this is a bug in pgraster handling of "nodata" for data rasters (when band=x is passed and x!=0). The temptative fix is here: https://github.com/mapnik/mapnik/pull/3382
The PR doesn't have an automated test as there's no core automated test for raster, unfortunately.
The fun behavior would be due to the NODATA value taking the value of the latest pixel being read for each input raster, which for tiled rasters would be different for every tile and for prescaled rasters would be different for every zoom level.
This was fixed by @strk in https://github.com/mapnik/mapnik/pull/3382.
Currently master
on Mapnik won't build on Ubuntu 14.04 (see https://github.com/mapnik/mapnik/issues/3384), so we're using "systemapic" branch of knutole/mapnik -> https://github.com/knutole/mapnik/commits/systemapic. (Should try to build mapnik:master
as soon as build issues are resolved, see https://github.com/systemapic/docker-systemapic/issues/67.)
Need to install node-mapnik
with npm install --build-from-source mapnik
.
Getting quite a lot of dropped pixels with
pgraster
RasterColorizer. Cause not known. Suspecting it's a bug in either RasterColorizer or pgraster, as different pixels are dropped on different zoom-levels.Different zoom-level (same area):![screen shot 2016-03-23 at 1 35 28 pm](https://cloud.githubusercontent.com/assets/2197944/13985295/e0d68d4e-f0f3-11e5-9728-65650899de95.png)
The cartocss: