-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render addr:flats #4082
Render addr:flats #4082
Conversation
Thank you for the test code, @richlv. Have you downloaded docker? The instructions on setting up a test rendering DOCKER.md are fairly clear, if you have some experience. This comment gives more detailed instructions: #3782 (comment) Or try out this guide: https://www.openstreetmap.org/user/SomeoneElse/diary/43041 You might also read https://ircama.github.io/osm-carto-tutorials/ if you want to set up a test server directly in Linux. |
Thank you, that was in some aspects simpler than expected, and more complicated in others :) Test area 1 (flat numbers on entrances) - https://www.openstreetmap.org/#map=18/56.98831/24.24307 Test area 2 (flats + housenumber) - https://www.openstreetmap.org/#map=19/57.07449/24.11386 |
Thank you for the test @Adamant36, it took me quite a while to get it all running, and then preparing all the screenshots - and having it tested on more areas is very helpful. |
@Adamant36, this might be a data issue - in your second screenshot there are two instances of:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should render both addr:unit and addr:flats on the same object.
Dividing the numbers onto 2 different lines looks a bit odd.
Also, the wiki page claims "If there is gap in numeration, mark numbers and intervals with semicolon: addr:flats=3-7;10;14;16-18." - and there are over 2000 addr:flats features which include a semicolon.
How should we handle this?
Regarding semicolon separated entries, it seems that the best is to display them all as-is - or am I missing some concern here? |
If we are rendering something like "addr:flats=3-7;10;14;16-18", it might be more legibile if we replace the semicolons with a more common separator, such as a comma, space, or both: 3-7;10;14;16-18 |
Converting semicolons could indeed increase readability, but then I thought a bit about looking at that as a mapper. |
That's a good point.
What do you mean by addr:entrance? I see it's documented as an old proposal only: https://wiki.openstreetmap.org/wiki/Proposed_features/Key:addr:entrance "addr:street=Zhelezni vrata + addr:housenumber=24 + addr:entrance=А" When you say they are duplicates of
One concern I have is that the page has previously suggested that I've also seen a number of cases where the Eg, this was the first place I found in Kaliningrad with addr:flats, shown with your proposed rendering: Every entrance has the housenumber, and then underneath there is |
@imagico, can I get your cartographic opinion on this idea? |
Yes, and with a very low usage count. If unit is used for individual flats and also for entrances, it puts it both above and below addr:flats.
It might be possible to shift such usage of addr:unit to addr:entrance (would likely need wiki updates and even rendering support), but that is out of scope here. And then there's addr:flatnumber which might be a better for the latter usecase, but only used 194 times (and will cause semantic concern for some people if to be used on non-flats). Though I'm afraid that this is getting too much in the weeds on a higher complexity level.
Yes, for example - https://www.openstreetmap.org/node/5470093221 .
Saw your edit to the page. There's an overlap between addr:flats and addr:unit in either case (now it means shifting between the tags depending on the number of, er, numbers), but nothing we can resolve here.
That's an interesting numbering scheme that I have not seen before. I suspect that trying to figure out how many entrances a building has and how many have addr:flats tagged to adjust rendering will be complicated and error prone. Unrelated to such entrances, there are also cases of mapping that is unclear, for example https://www.openstreetmap.org/node/3840036300 . It has "addr:flats=III" and "addr:unit=50". |
I am not really familiar with this kind of address tagging. To me addr:flats for collective mapping of several units and and addr:unit for the separate mapping of individual units seem to be competing concepts and it might be counterproductive to render both of them. I am also not sure how often flat numbers are actually verifiable data and how often the just come from address imports without local verifiability. Cartographically it seems that undifferentiated multi-line labels could be hard to read - it is likely often not clear if this is one label or separate label. Also z17 seems to early for anything but a simple house number - even in areas with moderate size buildings at moderate latitudes it is quite frequent that even those do not all fit to be shown. |
Very verifiable in many cases, https://www.mapillary.com/map/im/e5bOY0-2Jhgc_CKht9xJcQ .
addr:unit is currently rendered on the same line with just a space, and starts at z17. Similarly currently multi-line rendering is already used:
I just latched onto the existing rendering. |
It's a bit odd that tagging has settled on plural "flats" and singular "unit", but in taginfo there is a pretty clear separation. Only a couple thousand I'm glad that
Perhaps @richlv could try rendering these from z18 only, and in a slightly different style (smaller text size perhaps?). At z17 too often they overlap and are blocked by adjacent address labels. While the multi-line rendering makes sense when there is both a number and a name, these are all numbers, and probably should be all on one line, as with |
Before making additional changes would like to confirm the intent.
Does the above sound correct? You mentioned them overlapping and being blocked at z17 - is this with the multiline approach? |
Check https://www.openstreetmap.org/#map=17/54.73472/20.47319 - this is the main place the tag is used in Kaliningrad, where I first checked:
That sounds right
Possibly |
…ine. Make addr:flats override addr:unit.
Demoted addr:flats and addr:unit to z18, moved addr:flats to the same line, made addr:flats override addr:unit. Does that look acceptable? |
Thank you. I would also like to see a slightly different style (smaller text size perhaps?) for @imagico - any thoughts about this cartographically? |
Looking at other places, it's hard to find many cities or countries which have In Buenos Aires, there are 3 shop or office features which also have There's only one in Brussels, on a church, oddly. In Asturias, Spain there are 3 nodes on a building like https://www.openstreetmap.org/node/3008585185 which have addr:flats=3 even though the housenumber is different. Two others have both addr:housenumber and addr:flats with a single number (like addr:unit): https://www.openstreetmap.org/node/3677624217 and https://www.openstreetmap.org/node/5740130190 In Oregon it is used on 9 nodes, but all of these also have amenity=* and a name, so would not be rendered. And here again In Estonia there are only 7 nodes. In Lithuania there are 72 nodes, and most seem to be used as intended: with a range of flat numbers separated by a dash: https://overpass-turbo.eu/s/S00 Most Eastern European countries have a few hundred, though Latvia has over 800: https://overpass-turbo.eu/s/S01 So the great majority are in Belarus, Russia and Ukraine: eg https://overpass-turbo.eu/s/S02 - over half in Russia alone: https://overpass-turbo.eu/s/S03 Perhaps this tag is not widespread enough to be supported by this global style. |
Yeah, the point of the pull request is to motivate contributors to collect this information :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to treat addr:unit and addr:flats the same, it might make sense to do it in SQL rather than outline all the different combinations in MSS.
Something like
(SELECT
way
array_to_string(array[
NULLIF(array_to_string(array[addr_housenumber,COALESCE(addr_unit, addr_flats)]),''), -- Combine hounumber and unit/flats to one line
addr_housename], E'\n') AS address -- Add housename on a new line if necessary
FROM
(SELECT
ST_PointOnSurface(way) AS way,
osm_id,
"addr:housenumber" AS addr_housenumber
"addr:housename" AS addr_housename,
tags->'addr:unit' AS addr_unit,
tags->'addr:flats' AS addr_flats,
way_area
FROM planet_osm_polygon
WHERE way && !bbox!
AND building IS NOT NULL
AND way_area < 4000000*POW(!scale_denominator!*0.001*0.28,2)
UNION ALL
way,
osm_id,
"addr:housenumber" AS addr_housenumber
"addr:housename" AS addr_housename,
tags->'addr:unit' AS addr_unit,
tags->'addr:flats' AS addr_flats,
NULL
FROM planet_osm_point
WHERE way && !bbox!) AS addr_points
WHERE "addr:housenumber" IS NOT NULL
OR "addr:housename" IS NOT NULL
OR tags ? 'addr:unit'
OR tags ? 'addr:flats'
ORDER BY way_area DESC NULLS LAST,
osm_id
) AS addresses
@pnorman, thank you for showing the way to merge the info in SQL, looks like a great way. @jeisenbe, the point of this pull request is to motivate contributors to collect this information, which often is easily verifiable. |
I'm willing to support this PR if the other maintainers agree. But right now there are changes requested above, which need to be addressed: #4082 (review) Also, I still don't think addr:unit and addr:flats should ever be rendered on the same feature. Please fix this. |
Do you mean merging information in SQL?
That shouldn't be the case now, unless I have misunderstood how all this thing works. |
Sorry, I did not realize that had been fixed. In testing, when both addr:flats= and addr:unit are tagged (often the addr:unit is duplicating the ref of the entrance, in the former USSR), then it appears addr:flats only will be rendered, now. I'm not quite sure why addr:flats is rendered first, rather than addr:unit - perhaps due to alphabetical order? Re: merging information in SQL - @pnorman was this a required change, or just a suggestion? |
That is intentional, as flats is higher semantically. I'm not aware of any case where these have been used together in a way that is consistent with the current wiki documentation, though - it's either duplicates, or addr:unit being used for entrances (like A, B, C...), and addr:flats being used for, well, flats in each entrance (a few buildings in Finland). Given that tagging would likely have to be changed in all instances, I'm not too attached to the priority one way or another. |
If others feel the nested MSS is understandable I'm okay keeping the complexity there. |
Oh, I agree. What I meant to say is that I don't quite understand why the current mss code works properly. @pnorman do you understand why |
The relevant MSS is ["addr_unit" != null]["addr_housenumber" = null] {
text-name: [addr_unit];
}
["addr_flats" != null]["addr_housenumber" = null] {
text-name: [addr_flats];
} It's been awhile since I done much MSS with priorities, but my recollection is that the case of addr_unit and addr_flats matches both parts of the MSS, both parts have the same number of selectors, so it goes with the last one when generating the XML. |
Thank you, now that makes sense, though it is a little surprising. |
Thank you @richlv and congratulations on your first PR with Openstreetmap Carto! If you might enjoy contributing further, we have a list of "Good First Issues" as well as some harder issues labeled "Help Wanted" if you are looking for a challenge. |
Aaaaamazing. Thank you so much for all the tips and help. A question, though - what is still missing for the rendering on osm.org to update? |
This style releases every few weeks a new version. The next one will be on this friday (#4106). |
Fixes #3988
Changes proposed in this pull request:
Render addr:flats similar to addr:unit.
Accounting for combinations with addr:housenumber, addr:unit, addr:housename.
Test rendering with links to the example places: