Instructions on how to use with out-of-db files.
parent
2dd3abc601
commit
fdb41ffa74
1 changed files with 15 additions and 1 deletions
16
PgRaster.md
16
PgRaster.md
|
@ -42,7 +42,21 @@ To check if the gdal plugin built and was installed correctly you can do:
|
|||
| max_async_connection | integer | max number of PostGIS queries for rendering one map in asynchronous mode. Full doc [here](Postgis-async). | 1 |
|
||||
| band | integer | request for a specific raster band index (1-based). 0 means to read all bands. Note that a band read from a single band raster gets interpreted as Grayscale if band=0 is specified while they retain their original value when explicitly referenced with the "band" parameter. This affects effectiveness of [[RasterColorizer]] | 0 |
|
||||
|
||||
|
||||
# Styling
|
||||
|
||||
To style a layer from PgRaster use the [[RasterSymbolizer]]
|
||||
|
||||
# Using out-of-db rasters
|
||||
|
||||
If you are using out-of-db raster files, then the ["outasin" parameter](http://postgis.net/docs/RT_ST_AsBinary.html) of PostGIS must be used otherwise PostGIS just returns the file path. Mapnik does not support this parameter yet but you can achieve the same with a subquery for the `table` parameter:
|
||||
```
|
||||
<Parameter name="table">(SELECT ST_AsBinary("rast", TRUE) FROM <table_name> WHERE "rast" && !bbox!) as rast</Parameter>
|
||||
```
|
||||
|
||||
Additionally make sure you have set the `POSTGIS_ENABLE_OUTDB_RASTERS` and `POSTGIS_GDAL_ENABLED_DRIVERS`environment variables for PostGIS. See the [PostGIS installation page](http://postgis.net/docs/postgis_installation.html).
|
||||
|
||||
On Ubuntu these variables are set in file `/etc/postgresql/<postgresql_version/main/environment`:
|
||||
```
|
||||
POSTGIS_ENABLE_OUTDB_RASTERS=1
|
||||
POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL
|
||||
```
|
Loading…
Reference in a new issue