Skip to content

Commit

Permalink
Revert "SQL tweaks to improve Mapnik 3 performance for admin areas"
Browse files Browse the repository at this point in the history
This reverts commit 9109ca1.

This was slowing down performance, as Mapnik wasn't doing a way && !bbox!
check anymore. This could have been added, but the Mapnik 3 issues
seem to be fixed, so the ST_Within isn't needed as much anymore.
  • Loading branch information
pnorman committed Jul 13, 2015
1 parent 3350e94 commit 675586e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n AND NOT ST_Within(!bbox!, way)\n ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering\n) AS admin_high_zoom",
"table": "(SELECT\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering\n) AS admin_high_zoom",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down Expand Up @@ -1901,7 +1901,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n name,\n admin_level\n FROM planet_osm_polygon\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n AND name IS NOT NULL\n AND NOT ST_Within(!bbox!, way)\n ORDER BY admin_level::integer ASC, way_area DESC\n) AS admin_text",
"table": "(SELECT\n way,\n name,\n admin_level\n FROM planet_osm_polygon\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n AND name IS NOT NULL\n ORDER BY admin_level::integer ASC, way_area DESC\n) AS admin_text",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand All @@ -1927,7 +1927,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n name,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels\n FROM planet_osm_polygon\n WHERE (boundary = 'national_park' OR leisure = 'nature_reserve')\n AND name IS NOT NULL\n AND NOT ST_Within(!bbox!, way)\n) AS nature_reserve_text",
"table": "(SELECT\n way,\n name,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels\n FROM planet_osm_polygon\n WHERE (boundary = 'national_park' OR leisure = 'nature_reserve')\n AND name IS NOT NULL\n) AS nature_reserve_text",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down
3 changes: 0 additions & 3 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,6 @@ Layer:
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
AND NOT ST_Within(!bbox!, way)
ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering
) AS admin_high_zoom
properties:
Expand Down Expand Up @@ -2136,7 +2135,6 @@ Layer:
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
AND name IS NOT NULL
AND NOT ST_Within(!bbox!, way)
ORDER BY admin_level::integer ASC, way_area DESC
) AS admin_text
properties:
Expand All @@ -2157,7 +2155,6 @@ Layer:
FROM planet_osm_polygon
WHERE (boundary = 'national_park' OR leisure = 'nature_reserve')
AND name IS NOT NULL
AND NOT ST_Within(!bbox!, way)
) AS nature_reserve_text
properties:
minzoom: 13
Expand Down

0 comments on commit 675586e

Please sign in to comment.