enzet / map-machine

Python renderer for OpenStreetMap with custom icons intended to display as many map features as possible
MIT License
507 stars 33 forks source link

Render indoor=room #139

Open mfbehrens99 opened 2 years ago

mfbehrens99 commented 2 years ago

Currently, indoor=room is not rendered at all when rendering indoor maps which makes some maps look interestingly empty.

enzet commented 2 years ago

Hi @mfbehrens99!

Thank you for the request. Yes, I should have added support for this tag pretty much earlier.

enzet commented 2 years ago

Good place for testing:

map-machine render -c 48.8674410,2.3642951 -z 19 --level -1
enzet commented 2 years ago

Hi, @mfbehrens99,

I made a quick fix for this issue. Please, take a look. Do you want any more indoor features to be supported?

map-machine render -c=-0.1762640,-78.4793002 -z 19 --level 1

Before:

139_before

After:

139_after

mfbehrens99 commented 2 years ago

Wow that looks good to me!

Question: Do names of rooms get displayed if you have a room with only a name (not shop=* which gets rendered anyway)

indoor=room
name=My room

Edit: Nvm, yes the do!

enzet commented 2 years ago

Do names of rooms get displayed if you have a room with only a name (not shop=* which gets rendered anyway)

Yes, they should:

map-machine draw area "indoor=room,name=My room"

element

Please, let me know if something is broken.

mfbehrens99 commented 2 years ago

Looks pretty good!

I have some other things that would be good: What about rendering for indoor=wall. Shouldn't there be a wall around indoor=corridor? grafik Looks kind of interesting here The rendering for indoor=column should probably also be a lot darker as it is right now grafik

enzet commented 2 years ago

I made columns darker and added border for corridors. As for corridors, I'm not sure it is a right solution. It is worth seeing whether it will work in other cases.

enzet commented 2 years ago
map-machine render -c 4.5977848,-74.0750941 -z 20 --level 0

map

mfbehrens99 commented 2 years ago

I am sorry. People on OSM Wiki are saying that only indoor=room has implicit walls. https://wiki.openstreetmap.org/wiki/Talk:Tag:indoor%3Dcorridor

However, then I would display the walls from building=*.

enzet commented 2 years ago

I am sorry. People on OSM Wiki are saying that only indoor=room has implicit walls.

I think, the current solution is a tolerable tradeoff. It is impossible to accurately display walls using just polygon strokes, they should be computed separately.

However, then I would display the walls from building=*.

Even computing right shape of the building wall for the specified level is not trivial. So I think, I should do some research and find more general solution in the future.

mikedld commented 1 year ago

Getting warnings like

WARNING Cannot parse level description from -3-2.

This is documented in https://wiki.openstreetmap.org/wiki/Key:level#Multiple_values:

Use a minus sign to specify a range of positive numbers with no missing values. e.g. The elevator of a 32 storey highrise with two basement levels: level=-2;-1; 0-31 This shows connectivity to multiple levels for indoor navigation.

I realize that docs list negative levels as separate list items, so not sure if this should be supported. In my mind, -3-2 meant -3 through 2, and e.g. -3--2 is -3 through -2.