Page MenuHomePhabricator

geomask discards inner rings
Open, Needs TriagePublic

Description

The geomask/shape-inverse type discards inner polygons, resulting in incorrect rendering.

image.png (509×333 px, 85 KB)

Example at https://en.wikipedia.org/w/index.php?title=User:Jleedev/Sandbox&oldid=907008259

This should either be documented or fixed; https://en.wikipedia.org/wiki/Pittsburgh is currently using shape-inverse apparently for aesthetic reasons, and it really shouldn't given this behavior.

Event Timeline

Original implementation: T146582: Geoshape service should return map mask polygon with holes
The mapdata plugin is also used by the static map server. Dependency wikimedia/mapdata

This is a relatively easy fix, which i've not yet made, because i was trying to figure out if there is some sort of historical reason for omitting the innershapes. I couldn't find one.

Requires:

  • patch to wikimedia-mapdata module
  • merging that patch into Kartographer
  • updating Kartotherian to new version of wikimedia-mapdata.

@TheDJ any update? We recently implemented geomask in our main map module on the Norwegian Bokmål Wikipedia, and the lack of inner rings is very noticeable for municipalities in Viken, where Oslo should be excluded. See e.g. https://no.wikipedia.org/wiki/Nesodden (open the map in full screen to see the full geomask).

Right, so I know what the reason is, I think. The idea behind not having holes for geomasks was that holes with more than 1 of those thick red line holes, make for very messy shapes that often heavily obscure that part of the map, especially for the thumbnails.

I'm not sure I agree.. but that was the reason.

If there was a reason for this behavior to be implemented, does that mean it is not a bug but a feature? If that is the case, where can a suggestion be made to change that policy? Look at http://en.wikipedia.org/wiki/San_Antonio for example; that city has multiple holes, but they are not showing up in the map. The issue with a decision like this is that it favors aesthetically pleasing maps over accuracy. The map incorrectly suggests that San Antonio has no holes within its city limits, but that is not the case. If this is a bug and not a feature, are there any plans to fix it?

If there was a reason for this behavior to be implemented, does that mean it is not a bug but a feature?

I my analysis from 3 years ago is correct, then yes. (not sure, it'd have to go dig through the commit history again).

If that is the case, where can a suggestion be made to change that policy?

Here. But there are currently no resources assigned to do feature changes for this part of the software, so it's not very likely to actually happen unless someone volunteers to do it.

Look at http://en.wikipedia.org/wiki/San_Antonio for example; that city has multiple holes, but they are not showing up in the map. The issue with a decision like this is that it favors aesthetically pleasing maps over accuracy. The map incorrectly suggests that San Antonio has no holes within its city limits, but that is not the case. If this is a bug and not a feature, are there any plans to fix it?

My suggestion would be: Don't use geomask for those particular localities..

@TheDJ Thanks for your reply. It would be nice to see this issue fixed, because it creates inaccurate maps. And the inverse maps are just as "messy" as the non-inverse maps which have the same shapes.

Alternatively, there could be two options: geomask with holes and geomask without holes.

Right, so I know what the reason is, I think. The idea behind not having holes for geomasks was that holes with more than 1 of those thick red line holes, make for very messy shapes that often heavily obscure that part of the map, especially for the thumbnails.

I'm not sure I agree.. but that was the reason.

It's hard to believe that holes are intentionally skipped due to this reason. Complex and thick lines in some cases do render somewhat blurry but this is true for all lines, not only those that make up a hole. I'd consider it a minor concern compared to rendering a partial and and entirely misleading shape.