On 27/11/15 09:44, Gerd Petermann wrote:
Do we have a database design that stores each OSM element
with numerous columns for all possible supported attributes?
I guess that would explain why there are technical limits.
Yes the current schema has one column for each tag, but obviously
limited to certain tags chosen when the database is created.
So there is a highway column, a waterway column, a name column and so
on, which the value being the value of the tag in question, or null if
the object doesn't have that tag.
So it's obviously quite wasteful to create hundreds of columns for
relatively rare tags that will be null for most records.
Hence the reason the tools how have the option to store some or all tags
in a single hstore column - that's basically a column whose value is a
hash of keys and values. You can read more here:
https://github.com/openstreetmap/osm2pgsql/blob/master/docs/usage.md#hstore
So the idea is that at the next reload some of the rarer key values
would be moved into an hstore column, and that extra tags could be
included in that set.
It does need some matching changes to the style sheet though, as the
syntax for SQL queries to select on values in the hstore will be
different to the condition for selecting on a normal column.
Tom
--
Tom Hughes ([email protected])
http://compton.nu/
_______________________________________________
dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/dev