diff --git a/OptimizeRenderingWithPostGIS.md b/OptimizeRenderingWithPostGIS.md index 1aadd40..90d01ea 100644 --- a/OptimizeRenderingWithPostGIS.md +++ b/OptimizeRenderingWithPostGIS.md @@ -214,7 +214,7 @@ If there is any active connection Postgresql will wait until it is closed, so if ## Use an extent parameter If an extent parameter is not set, mapnik will perform a query like this... -``` +```sql SELECT ST_XMin(ext),ST_YMin(ext),ST_XMax(ext),ST_YMax(ext) FROM (SELECT ST_Extent(geom) as ext from planet_osm_line) as tmp ``` @@ -222,7 +222,10 @@ FROM (SELECT ST_Extent(geom) as ext from planet_osm_line) as tmp ...which requires PostGIS to walk the entire result set of the queried table each time the DataSource is used for the first time in a rendering session. There are three parameters available for use to avoid this process: ### extent_from_subquery -E.g. `true` +E.g. +```xml +true +``` **Pros:** * Precise estimate of extent @@ -239,7 +242,10 @@ E.g. `true` * tile server where render requests return small features sets or any render requests with large feature sets are pre-rendered and cached ### extent -E.g. `-20037508,-19929239,20037508,19929239` +E.g. +```xml +-20037508,-19929239,20037508,19929239 +``` **Pros:** * No database overhead @@ -259,7 +265,10 @@ E.g. `-20037508,-19929239,20037508,19929239 * Seldom changing result set with few updates ### estimate_extent -E.g. `true` +E.g. +```xml +true +```xml **Pros:** * Faster than not setting any extent parameters; significantly for large result sets