plepe / pgmapcss

PGMapCSS is a library for PostgreSQL/PostGIS which works between an osm2pgsql based database and Mapnik (and maybe other renderers). It processes database (usually OpenStreetMap) objects according to MapCSS rules and calculates resulting colors, widths and other properties for Symbolizers, even geometric modifications.
GNU Affero General Public License v3.0
35 stars 8 forks source link

Improve SQL selects for relation members #21

Closed plepe closed 9 years ago

plepe commented 10 years ago

If you have a selector relation[type=route] way, all ways in the current bounding box will be selected from the database and for each of the ways a query whether it is member of a relation of type=route will be made. This is not very efficient.

To query all relations in the current bounding box is not possible, as there's no geometry column on the planet_osm_rels table and only some relations will be added to planet_osm_line resp. planet_osm_polygon. But for later relations it would be possible to optimize the select statements.

The following relations are added to planet_osm_line:

The following relations are added to planet_osm_polygon:

Another problem: the 'type' is neither added to planet_osm_line.type nor .tags.

plepe commented 9 years ago

Overpass support has been implemented in #94.

plepe commented 9 years ago

osm2pgsql support has been implemented in #95