[Tile-serving] [osm2pgsql] Adding new tags to stylesheets (#88)

AndrewBuck notifications at github.com
Mon Sep 30 04:16:56 UTC 2013


ONe other thing to consider is the issue of special tables for things like roads, buildings, etc.  Right now we have a table just for roads and then a table for all other line features.  Since we are re-desinging the layout of the DB anyway, we could switch to a design using 4 or 5 "special" tables for very common features that tend to have only one "class" of tags on them, and then a final "catch all" table which has hstore columns to capture all the other objects.

The special tables would contain only objects who have sum specific list of tags and no others on them and then any object with even a single tag on it that doesn't fit into one of these columns would get put in the "catch all" table with the hstore column.  This would not only allow for very quick rendering of the most common object types (since they come from the special tables with dedicated columns), but it would also speed up queries on the "catch all" table, since after you remove buildings, roads, and landuse, from that table the catch all will end up being signifigatly smaller so whether or not indexes are employed, queries out of that table will end up being a lot faster anyway.

The disadvantage of this system is that a query to show a common object like a building would end up needing two queries, one to the special table to get the bulk of them, and then one to the "catch all" table to get the remaining handful that just happen to have an extra odd tag or two on them that forces them into the hstore table.  This second query could be eliminated however by including all the objects that have _any_ of the special tags on them in all of the special tables and then having an hstore column on each special table with the remaining tags for the straggler objects.  This means only one table should ever need to be queried to get a particular feature type, but it will result in some objects appearing in multiple tables.

-AndrewBuck

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/88#issuecomment-25336943
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20130929/24e18f33/attachment.html>


More information about the Tile-serving mailing list