Skip to content
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

Protected areas and national parks do not render unless they are relations or area=yes #3819

Closed
kennykb opened this issue Jul 8, 2019 · 10 comments

Comments

@kennykb
Copy link

commented Jul 8, 2019

Consider the area feature https://www.openstreetmap.org/way/418346662 (I know its tagging is controversial, since it isn't formally a 'National Park' - but that's not the point.)

Or the area feature https://www.openstreetmap.org/way/47798759, which appears to be a good example of correct protected_area tagging for a species-protected area.

These do not show at all on the map, despite being tagged boundary=national_park and boundary=protected_area respectively, because they go into the database as lines rather than polygons. The culprit is that boundary is a linear feature in the style file, with no override in the tag transformer.

A workaround is to make the offending features multipolygon or boundary relations, or to add area=yes.

Expected behavior

Render the affected features as national park or protected area, respectively.

Actual behavior

Nothing appears on the map.

Links and screenshots illustrating the problem

https://www.openstreetmap.org/way/418346662 and https://www.openstreetmap.org/way/47798759 render nothing.

Possible fix

It looks as if adding

    boundary = { national_park = true, protected_area = true },

to the polygon_values table in openstreetmap-carto.lua might be a fix, but I don't have an OSM-carto instance available to test on at the moment.

@imagico

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

Since boundaries of all kinds in OSM traditionally can be tagged on both the linear ways and polygons there is some ambiguity in semantics here. For administrative boundaries it is commonly accepted that administrative units may only be mapped with boundary relations and not with closed ways - which strongly simplifies interpretation. We take this into account in rendering here (#3762). For nature reserves and protected areas this is not that clear - but you could interpret these boundaries in analogy to administrative boundaries.

@kennykb

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

Yes. You could interpret it that way.

On the other hand, the instructions at https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dprotected_area begin:

For small protected ares, draw a closed way to define the area.

Taginfo shows about sixty thousand closed ways with the tag.

It appears to me as if that train already left the station.

@matkoniecz

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

Please, try to phrase things in a bit less aggressive form. It is not helpful.

Especially in case where it is possible to make a good argument.

Taginfo shows about sixty thousand closed ways with the tag.

Where I can see count of a closed ways on the taginfo?

@kennykb

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

Oops, sorry, the 'closed' came out accidentally from my fingers because I had the Wiki page with those instructions open at the time. There are 60,000 ways with the tag; an unknown fraction as yet are closed. I suspect that it is a large fraction, owing to the fact that the Wiki page indicates that boundary=protected_area is an inappropriate tag for an unclosed way. (If I'm reading the icons correctly.)

I'll be able to answer the question about statistics for North America, but it will likely take a few days, because I want to get my North America database rebuilt with the proposed fix first. I can't answer for the whole planet, since I don't have the resources to host a planet-scale database.

@kennykb

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

In North America, using an import with osm2pgsql's default.style (which has the same issue as OSM Carto's), I find that there are roughly three thousand closed ways that are tagged boundary=national_park or boundary=protected_area, are not part of any relation, and are not otherwise recognized as polygons. This count excludes, for instance, the objects doubly tagged boundary=protected_area and leisure=nature_reserve, since they will become polygons by virtue of the latter key. I am certain there are some thousands of these dual-tagged features, because I've imported over two thousand myself. The figure of sixty thousand therefore does not astonish (my imports were confined to only one of the fifty states of the US).

It is perhaps noteworthy that adding nature_reserve to a protected_area is widely viewed as 'legacy' tagging for the benefit of renderers that do not render boundary=protected_area correctly.

As I previously noted, this is for North America alone. I don't have a ready way of answering this question for the planet.

For the record, the information was obtained by running the following SQL query on an osm2pgsql import of GeoFabrik's north-america-latest.osm.pbf using the default style. The return value was 2961.

select count(1) from na_osm_line l
where l.boundary in ('protected_area', 'national_park')
and l.osm_id > 0 -- excludes relations
and ST_StartPoint(l.way) = ST_EndPoint(l.way) -- includes only closed ways
and not exists (select 1 from na_osm_polygon p where p.osm_id = l.osm_id) -- excludes polygons
and not exists (select 1 from na_osm_rels r where l.osm_id = any(r.parts)) -- excludes relation members

I modified the query to return OSM ID and name (LIMIT 20) and spot-checked the twenty features that it returned; all were indeed closed ways that were tagged boundary=protected_area, and none appears on the rendered map, so I have no reason to suspect that the query is defective. (If someone points out a defect, I'll be happy to rerun with a correction.)

This usage therefore appears to have become widely established, at least if having it explicitly suggested on the Wiki and used in the suggested way on three thousand features in North America alone makes it 'widely established'. (On a map with billions of features, I suppose this is not a foregone conclusion - perhaps the three thousand amounts to an insignificant number.)

What is perhaps surprising is that nobody noticed the unwanted behaviour earlier. A possible explanation is that mappers were adding protected_area tagging for at least a couple of years before OSM-Carto was capable of rendering it, confident that the tag would eventually be recognized, and would therefore be unsurprised at having their features fail to appear in the main map. I know that I did not go back and check the rendering on any of the protected areas that I mapped after the feature was deployed (but with that said, I had indeed dual-tagged all of them as an interim measure, so I wouldn't have seen anything amiss.)

@Adamant36

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

my imports were confined to only one of the fifty states of the US

I take it the state your talking about is New York?

I know its tagging is controversial, since it isn't formally a 'National Park' - but that's not the point

Semi off topic, but do you mind if I ask why you controversially tagged a state park as a national park? I ask because I got in a pretty argument with another user over it and he was never able to give me a good justification for doing it. I seem to remember you mentioning it on the USA mailing list maybe, but I don't think it was explained good there either or if you thought it should be a wider, country wide practice. Is it mainly for rendering purposes or what?

Thanks

@kennykb

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

I take it the state your talking about is New York?

Yes, my imports were confined to New York. (I'm in the planning stage one in the neighbouring state of Connecticut, which is being edited on the Wiki but has not yet been formally announced - it surely will be before actual editing begins.)

The tagging of the completed (rather, ongoing: they're updated sporadically) imports was discussed extensively, and there's not a boundary=national_park among them.
https://wiki.openstreetmap.org/wiki/NYS_DEC_Lands
https://wiki.openstreetmap.org/wiki/Import:_NYCDEP_Watershed_Recreation_Areas

I've also mapped (manually, assisted by data from public-domain tax rolls) many of New York's State Parks. The ones I did are tagged fairly consistently

boundary=protected_area
protect_class=21                      (or 22 for historic sites, museums, etc.)
protection_object=recreation
protection_title="State Park"    (or "State Historic Site", etc.)
operator=*, management=*, etc.

along with whatever appears to be the primary land use (usually one of leisure=nature_reserve, leisure=park, landuse=recreation_ground, leisure=golf_course, tourism=museum, ...)

Even this tagging engenders controversy, because some mappers expect all land uses to be homogeneous. There is no good choice for tagging a State Park that encompasses sport pitches, picnic areas, playgrounds, a lake for swimming and boating, several museums, hotels, restaurants, and a few thousand hectares of backcountry for hiking and primitive camping. Of course, the separate facilities within the park can and should be mapped, albeit with indefinite boundaries to their land use (another controversial point!), but that does nothing for the name and definite boundary of the park as a whole, which American users surely expect to see on a map.

Semi off topic, but do you mind if I ask why you controversially tagged a state park as a national park?

I rather do mind, not because I do not choose to answer, but because it is off topic and because I've seen the edit wars. Forgive me if I decline to participate in those.

I did that with exactly two 'parks': the Catskill and Adirondack Parks. They are sui generis entities, not State Parks. (They are enshrined in the state constitution, and enjoy stronger protection than any National Park - the latter can be erased in a moment by an act of Congress; the former require a constitutional amendment.) I do not argue for it as a general practice. It is the "least bad" tagging to deal with a very specific legal situation that I believe to be unique to New York.

More detail at https://www.openstreetmap.org/user/ke9tv/diary/390233.

As I mention in the diary entry, I'm also willing to tolerate a 'corner case' for a feature that's bigger than some European countries. (The Adirondack Park is bigger than Slovenia or Luxembourg, a little smaller than Belgium.) If it is indeed a mistagging, if it's limited to features of that significance, at least it won't proliferate!

Please take further discussion of this issue somewhere else. It doesn't belong here. I will not answer you again in this thread, and I apologize to the developers for taking the bait.

@Adamant36

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Thanks for the indepth explination. I appreciate you have put some thought into it and admit that it is controversal. Its obviously a complex topic, with no simple answer (although its clear to me that tagging all state parks as national parks like some users suggest is the wrong way to go) and I don't expect any more detail then you provided. It was actually more then I wanted, but it is still helpful. So not done in vain. Its unfortunate that you would charactorize my question as "bait" or an attempt at anything beside genuine intelectectual curiosity. As that is truely what it is. There should be an assumption of good faith granted to people on here. Its unfortunate you decided to forgo it in this case. Progress will never be made on this topic or any others without us giving each other the benefit of the doubt that we all have the best intentions.

Also, me and the other user never edit wared each other and I don't appreciate the insunation that we did. We argued about it, in an extremely unpleasent way, but that was it. I have zero urge to do that here or to letigate past actions. Like said, your answer was fine and nothing more needs to said about it. So, thanks for the answer. Just not for the other, uncessary bits. Btw, even the admins go off topic once in a while themselves. So, I'm sure they don't mind it in this case. As long its only constrained to a few messages. As it will be. Since I have zero wish to waste my time disscussing it with you here, or really anywhere else, anymore then it already has been.

Adamant1

@kennykb

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

Somehow my sight was narrowed when I opened this ticket, and so I missed that it duplicates #468, #713 and #1141 - the last of these is the one that appears to be used in tracking it. #1141, in fact, proposes exactly the same fix.

Is the consensus of the maintainers that this is a problem with the Wiki documentation for boundary=national_park and boundary=protected_area, and that multipolygon or boundary relations must be used for these features? (#3819 (comment) suggests that it may be.) If so, it would be good to have the Wiki updated sooner rather than later, and to have a discussion opened about how the large number of existing ways with erroneous tagging are to be corrected. (I could certainly start work on working up a mechanical edit proposal for the ways that I'm responsible for.) If, instead, there's still a possibility that this issue will be eventually resolved, then I'd rather hold off on planning such an extensive change.

The fact that #1141 is still open gives me hope that the change might be considered, in light of the number of existing objects that it affects. I am guessing that until the audit I describe in #3819 (comment), there was no hard data about the extent of the problem.

@imagico

This comment has been minimized.

Copy link
Collaborator

commented Jul 11, 2019

Is the consensus of the maintainers that this is a problem with the Wiki documentation

No, we have not developed a consensus on the matter and the wiki only concerns us as far as it reflects mapping practice and community consensus.

If you'd submit a PR implementing the change suggested here that would not be accepted right away as a self evident improvement but you would have to argue for the benefits for the goals of the style.

To explain the ambiguity of boundary tagging of ways in case closed ways are interpreted as polygons: See for example this

https://www.openstreetmap.org/relation/2785126

If the outer ring of this relation was represented with a single way that way would accurately be tagged admin_level=2 according to the established rules of boundary tagging on ways. If that closed way was then however automatically be interpreted as an admin_level=2 administrative entity that would be wrong because it is only an admin_level=8 entity (that is a disjunct part of an admin_level=2 entity).

I am sure similar situations exist with protected areas and national parks.

I am closing this in favor of #1141 - thanks for pointing this out.

@imagico imagico closed this Jul 11, 2019
@imagico imagico added the duplicate label Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.