gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 822 forks source link

Render names of power=plant tagged as site relation #2940

Closed boothym closed 6 years ago

boothym commented 6 years ago

Many wind farms are correctly tagged as site relations yet their names do not get rendered on the map unless an additional power=plant way is added around them. This should be fixed to avoid duplication.

For example: http://www.openstreetmap.org/relation/6949277 - name not rendered http://www.openstreetmap.org/way/492184731 - same wind farm, name rendered

matkoniecz commented 6 years ago

Good label placement would be tricky, even for human it is not easy to select good location of label for http://www.openstreetmap.org/relation/6949277

See #2108 that was closed due a poor documentation, but it seems that documentation was improved.

SomeoneElseOSM commented 6 years ago

I actually looked at rendering site relations (in a different map style) but in the UK site relation usage was so inconsistent that it made it impractical. Also, as @matkoniecz label placement is going to be difficult (especially in urban or other busy areas).

Another problem is that I don't think that osm2pgsql processes node relation members at all currently (that's something I'm planning to change in a fork for a different reason, but that's some way off).

Maybe you could have a go at defining which site relations should be rendered, and also how? It should then be possible to "mock up" a rendering in a test server, even without osm2pgsql support.

boothym commented 6 years ago

Good label placement would be tricky, even for human it is not easy to select good location of label for http://www.openstreetmap.org/relation/6949277

I suppose it should just be in the middle - it's the same problem for other large ways and relations. As you can see from: http://overpass-turbo.eu/s/sSM most of the them aren't that too large, so the name in the middle should be ok.

I didn't realise there was a problem with type=site relations, but I see this type=mulitpolygon is rendered http://www.openstreetmap.org/relation/2507475 - so what needs to happen to allowed type=site to be rendered?

matkoniecz commented 6 years ago

The problem is that "inside" of an area is well defined, and set of points has no "inside".

Can you make a picture with expected placement of the label?

so what needs to happen to allowed type=site to be rendered?

For start, one would need to verify whatever Mapnik od capable of labelling sets of points (likely not, and somebody would need to design, write and test this code) and check whatever osm2pgsql is supporting sets of nodes (likely not and or would again require designing, writing, reviewing and testing code).

SomeoneElseOSM commented 6 years ago

Re "what needs to happen" to osm2pgql there's a brief reference to part of the problem at https://github.com/openstreetmap/osm2pgsql/issues/791 .

http://www.openstreetmap.org/relation/2507475 consists of ways, http://www.openstreetmap.org/relation/6949277 mostly of nodes. When the tag transform code is called for a relation only the ways are passed through (or were, the last time I looked). As far as I'm aware, there's currently no code in there that can build a geometry of just a set of points. Maybe you could start digging through previous questions about this sort of thing to see what you can find out about the problems in osm2pgsql/mapnik.

In addition to that there are the selection ("which site relations?") and rendering ("how?") side of things to think about. All in all, it's not a simple problem to solve.

boothym commented 6 years ago

I see. Here's an example of a way which connects to all of the outer wind turbines: http://www.openstreetmap.org/way/478476077

Maybe a way could somehow be added to the other relations so that it helps define the outer limits of the site? Not sure how the tagging would work.

SomeoneElseOSM commented 6 years ago

I'm not convinced about the tagging there, TBH. If you look at https://map.atownsend.org.uk/maps/map/map.html#zoom=13&lat=55.77155&lon=-3.7278 for example, it renders the whole of the area in a different background colour (compare for example https://map.atownsend.org.uk/maps/map/map.html#zoom=14&lat=53.72154&lon=-1.28438 ).

I'm sure if you walk up Black Law https://map.atownsend.org.uk/maps/map/map.html#zoom=16&lat=55.78012&lon=-3.73186 there are wind turbines all around you, but you're not really in the generating station are you?

mboeringa commented 6 years ago

A couple of remarks here:

kocio-pl commented 6 years ago

Just for the record: we have a PR ready for rendering power=plant outline (#2839), but it looks like a hard problem too. If nobody help me fix this code to the acceptable form, I plan to close it without merging.

matkoniecz commented 6 years ago

I propose to close this issue per

They are ill defined, with lots of degrees of freedom in terms of what can be stored in them (nodes, ways, and even other (multipolygon-)relations), meaning they can be hard to process and making them hard to translate to a relational database schema as e.g. in PostGIS, and difficult to symbolize. Potentially, type=site relations could contain an endless chain of nested relations, as nothing in the Wiki page prohibits or even discourages endless nesting of relations (http://wiki.openstreetmap.org/wiki/Relations/Proposed/Site). I would definitely recommend limiting processing of type=site relations to very specific and hopefully better/well defined sub-cases (if they exist...).

by @mboeringa