Discussion:
[talk-au] Academic question about tags
Bob Cameron
2021-04-29 09:49:59 UTC
Permalink
On reading about OSM feature data structures

Are there ever any problems "mixing/adding" what would commonly be
separate tags for the one entity?

eg

amenity=pub plus tourism=hotel plus shop=alcohol

highway=rest_area plus amenity=parking plus tourism=camp_site

I am thinking in terms of rendering, mkgmap or other downstream uses. I
guess there would be an icon/avatar precedence issue but I wonder what else.

tnx
Warin
2021-04-29 10:17:36 UTC
Permalink
Post by Bob Cameron
On reading about OSM feature data structures
Are there ever any problems "mixing/adding" what would commonly be
separate tags for the one entity?
OSM guide- one feature = one OSM entry
Post by Bob Cameron
eg
amenity=pub plus tourism=hotel plus shop=alcohol
The pub, hotel and bottlo could have separate hours, phone... and
locations.

The pub ... I'd put a node at the front bar.

The hotel ... I'd put a node at the registration 'desk'.

The bottlo ... I'd put a node at the pay point.
Post by Bob Cameron
highway=rest_area plus amenity=parking plus tourism=camp_site
The parking would be a smaller area than the rest area (that would
include hopefully a toilet, bench and a bin).
Post by Bob Cameron
I am thinking in terms of rendering, mkgmap or other downstream uses.
I guess there would be an icon/avatar precedence issue but I wonder
what else.
Best to avoid the issue and keep them separate entries.
Warin
2021-04-29 10:23:54 UTC
Permalink
Post by Bob Cameron
On reading about OSM feature data structures
Are there ever any problems "mixing/adding" what would commonly be
separate tags for the one entity?
eg
amenity=pub plus tourism=hotel plus shop=alcohol
highway=rest_area plus amenity=parking plus tourism=camp_site
I am thinking in terms of rendering, mkgmap or other downstream uses.
I guess there would be an icon/avatar precedence issue but I wonder
what else.
tnx
PS lots more on the wiki..

https://wiki.openstreetmap.org/wiki/One_feature,_one_OSM_element
Andy Townsend
2021-04-29 11:10:22 UTC
Permalink
Post by Bob Cameron
Are there ever any problems "mixing/adding" what would commonly be
separate tags for the one entity?
Yes.  I can give you an example from the perspective of one map renderer.

The "amenity=pub; tourism=hotel" combination is pretty common in lots of
places.  For a map that I created I had to decide what to show them as,
so for pubs that are both I decided to show them as pubs.  The code that
does this in my case is at
https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/ba9a9be18426fb776289e99758a055241fc7e194/style.lua#L1894
(that's fairly easy to understand, even if you don't understand the
language).

You'll notice that that also adds an "accommodation=yes" tag internally
(not to the data in OSM), and that causes the "blue hotel-like roof"
that you see on pubs such as like
https://map.atownsend.org.uk/maps/map/map.html#zoom=20&lat=54.4356236&lon=-0.766422
(https://www.openstreetmap.org/node/248811440 in OSM).

Obviously a map that was more interested in showing places to stay
rather than places to drink would show something like that as a hotel
rather than a pub.  OSM's "standard" map tiles are an example that shows
that as a hotel rather than a pub.
Post by Bob Cameron
I am thinking in terms of rendering, mkgmap or other downstream uses.
I guess there would be an icon/avatar precedence issue but I wonder
what else.
If you're "counting hotels" and "counting pubs" and adding the two
together than you'll get a higher number than "counting the things that
are either hotels or pubs" - it's up to the person doing the counting to
ensure that they don't make that mistake if they want an accurate number
(of what is mapped in OSM so far).

If there are two POIs close together the count will be OK but renderers
will still need to decide which to show.  They might have a concept of
layers, or or concept of an order to display things within layers, but
any automatic process will produce oddities.  Have a look at what cities
appear in the Netherlands at
https://www.openstreetmap.org/#map=7/52.308/4.724 at different zoom
levels - the administrative capital (Den Haag) disappears and reappears,
because it overlaps with other features.

Best Regards,

Andy

Loading...