I'm trying to manage raster files from PostGIS, which to be rendered using Mapnik. I used raster2pgsql to load those GeoTIFF images to PostGIS, and I think the loading process turned out OK. The problem is to render from Mapnik XML using the PostGIS datasource: the rasters rendered out blank.. The raster files rendered perfectly with Mapnik XML using GDAL datasource, so I suspect my PostGIS raster configuration is at fault here..
Is there any documentation out there that resembles what I am trying to do?
Below is a snippet of my XML file to be used by Mapnik:
<Datasource>
<Parameter name="type">postgis</Parameter>
<Parameter name="user">postgres</Parameter>
<Parameter name="dbname">gis</Parameter>
<Parameter name="geometry_field">rast</Parameter>
<Parameter name="estimate_extent">false</Parameter>
<Parameter name="table">staging.hillshade</Parameter>
<Parameter name="extent">101,3,103,4</Parameter>
</Datasource>
I appreciate any help, thanks!
Best Answer
For those who will stumble on this question like me..
It appears that the plugin has been generated (https://github.com/strk/mapnik/tree/2.3.x-pgraster) and has been merged in official Mapnik Repo.
The branch is 2.3.x (https://github.com/mapnik/mapnik/tree/2.3.x)
Now you can build Mapnik from the branch and use PGRaster plugin to use Raster data from Postgis. The xml configuration could be as follows,