-
Notifications
You must be signed in to change notification settings - Fork 8
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
France Departments winding order incompatible with Vega #231
Comments
We should make this a test to find any other dataset that is breaking in Vega. |
I've been investigating this a bit more. With geojsonhint I've checked and 61 of our current datasets have one or more warnings about the right-hand rule:
As Elastic Maps and Landing Page, they render correctly in Vega as well. Just to take Kibana out of the equation you can test this code in the Vega Editor for Bolivia departments:
And this file has warnings when validating it:
Checking the previous version of the France departments there's a big wrong polygon in the South. I will continue debugging the file when I'm back from PTO. |
OK, I did a few more tests and the issue is as @nickpeihl stated the conformity of the France departments GeoJSON file to the RFC 7946 spec. This was already discussed in detail in 2018 on this issue with @thomasneirynck and @nyurik. I'm sorry I did not find that issue before 😞 I will explore adding a step in the build process to enforce a winding order with geojson-rewind, ensuring all our published GeoJSON files are consistent, one way or the other. Still, the main point of the discussion remains. I'm more inclined to ensure all our GeoJSON files follow the RFC 7946 standard, finding a way for our Vega users to get them properly rendered by d3-geo. |
After sync discussion with @nickpeihl and @thomasneirynck we agreed that EMS data needs to follow industry standards so we need to
|
I'm all for using "standards" (even when standards were created after an established industry practice, and contradicts it). My only concern is that we must not break existing users -- once we introduce an automatic rewinding for Vega users (should be fairly easy to do), we should introduce a new version of the EMS file service that serves different set of files (same files but different winding order). This way existing users will continue using things as is, and eventually all will migrate to the new service. |
It looks like the coordinate winding order for France Departments is not compatible with Vega. This causes Vega to fill the entire area outside the polygon instead of the internal polygon.
Other layers in EMS such as China Provinces render correctly because the coordinate winding order is reversed. To see this change the
data[0].url.name
toChina Provinces
in the example code below.I'm not sure if there is a way we can fix this in Vega or if we need to fix this in EMS. I'd rather see if we could fix this in Vega and just maintain the RFC7946 winding order for all EMS layers. But I also think Elastic Maps is more lenient on winding order. And GeoJSON Upload also appears to wind correctly the coordinate order.
If we fix this in EMS, we also need to check which other layers may cause winding issues with Vega.
Example Vega code
The text was updated successfully, but these errors were encountered: