Opened 9 years ago

Closed 5 years ago

#3395 closed defect (fixed)

[landcover] rendering barrier=hedge as closed area

Reported by: thiesp Owned by: mapnik-team@…
Priority: minor Milestone:
Component: mapnik Version:
Keywords: barrier, hedge, area Cc: pnorman, rohieb

Description

Look here:

http://www.openstreetmap.org/?lat=55.372914&lon=10.404336&zoom=18&layers=M

This is the corresponding changeset:

http://www.openstreetmap.org/browse/changeset/6664276

The hedges mapped as areas aren't rendered as expected. I expected they would be filled green, instead of the color from the polygon below.

I even added area=yes to try to enforce it, but no luck.

Change History (11)

comment:1 Changed 9 years ago by pnorman

Cc: pnorman added

comment:2 Changed 9 years ago by steve8@…

Resolution: fixed
Status: newclosed

Added in version just committed (r25076), will show when deployed - if using area=yes

comment:3 Changed 8 years ago by craigloftus

Resolution: fixed
Status: closedreopened

This fix does not allow one to mark the boundary of an area as having the barrier hedge (but still lets you do it for every other kind of barrier). I think it has changed the behaviour from that described in the documentation and from what I think many users will expect.

I'm not clear this is a regression, or just an inconsistency in treatment of hedge vs other linear barriers; I can certainly understand the use-case described by @thiesp.

Examples

The following tags have the area filled 'hedge' green (#79975283):

  landuse=farmland
  barrier=hedge

The following tags have the area filled 'garden' green with a black line around the boundary (#79975283):

  leisure=garden
  barrier=wall

comment:4 in reply to:  3 ; Changed 8 years ago by Ldp

Replying to craigloftus:

The following tags have the area filled 'hedge' green (#79975283):

  landuse=farmland
  barrier=hedge

barrier=hedge has an explicit area variant, so it's drawn as an area in this case, overpainting the landuse=farmland.

The following tags have the area filled 'garden' green with a black line around the boundary (#79975283):

  leisure=garden
  barrier=wall

barrier=wall has no area variant. Hence only the linear version is drawn.

I'm not sure what can be done about this. How is the renderer to discern between a closed way where the hedge is only around the perimeter vs. a closed way where the entire interior is hedge? They both look exactly the same to it.

comment:5 in reply to:  4 ; Changed 8 years ago by craigloftus

Replying to Ldp:

barrier=hedge has an explicit area variant, so it's drawn as an area in this case, overpainting the landuse=farmland.

Would you explain why barrier=hedge has "an explicit area variant" but barrier=wall doesn't? The tagging documentation (Tag:barrier=hedge) doesn't say that? In fact the documentation seems to state the opposite when it says that barrier=hedge can be used to "mark the boundary of an area. Useful in conjunction with Tag:landuse=farm to mark field boundaries."?

I'm not sure what can be done about this. How is the renderer to discern between a closed way here the hedge is only around the perimeter vs. a closed way where the entire interior is hedge? They both look exactly the same to it.

Perhaps an explicit area=yes tag on the hedge way would be appropriate?

comment:6 in reply to:  5 Changed 8 years ago by Ldp

Replying to craigloftus:

Would you explain why barrier=hedge has "an explicit area variant" but barrier=wall doesn't?

... in the mapnik stylesheet. Could've made that clearer.

Useful in conjunction with Tag:landuse=farm to mark field boundaries."?

How would you get onto the field when there's a hedge all around it? :)

Perhaps an explicit area=yes tag on the hedge way would be appropriate?

Area handling being the default in this case, that would accomplish exactly nothing.

As I said, it's a tricky one, with no clear answer just yet.

comment:7 Changed 8 years ago by rohieb

Cc: rohieb added

I have just discovered this behaviour. I have allotments which are surrounded by a hedge with gates in it. So I used a closed way tagged with landuse=allotments,barrier=hedge and barrier=gate for the nodes where the hedge crosses the paths going through it.

However, the area of the way is completely green, not filled with the allotments pattern (see http://www.openstreetmap.org/browse/way/23713197).

While I acknowledge the usefulness of the "area variant" of barrier=hedge, I think it's generally a bad idea to default to it, at least in this case. When I use {{barrier=wall}} instead, it shows the exact behaviour I would expect (allotments pattern with a grey border), so defaulting to the non-area variant of barrier=hedge follows the principle of least surprise. Furthermore, it is still possible to use area=yes if one explicitly wants the area variant.

comment:8 Changed 8 years ago by rohieb

I just tried area=no on the closed way. The hedge is now only a line around the border, but the allotment pattern is gone too...! So this is actually a regression which makes it impossible to render an area enclosed by a hedge correctly.

comment:9 in reply to:  8 Changed 8 years ago by Ldp

Replying to rohieb:

I just tried area=no on the closed way. The hedge is now only a line around the border, but the allotment pattern is gone too...!

Well, yes, of course. You're attaching two conflicting meanings onto a single way. That single way is processed based on its tags. If it has a landuse=*, it will be processed as a polygon, not as a line. No matter what other tags are present. In fact, if there are other tags, like barrier=*, that the renderer also understands, it can also only process them as a polygon as well.

This is what's happening with barrier=hedge. There is a polygon variant in the stylesheet, so it can draw it as such. There is no polygon variant for barrier=wall, so it will not render a barrier, neither as a polygon nor as a line.

So this is actually a regression which makes it impossible to render an area enclosed by a hedge correctly.

Sure you can model this: Don't cram two conflicting meanings onto a single way. Use two ways.

You're going to have a hard time with this situation anyway (using a single way) once OSM progresses to an area datatype.

comment:10 Changed 5 years ago by math1985

Summary: rendering barrier=hedge as closed area[landcover] rendering barrier=hedge as closed area

comment:11 Changed 5 years ago by Mateusz Konieczny

Resolution: fixed
Status: reopenedclosed

Nowadays it is fixed.

Note: See TracTickets for help on using tickets.