elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.12k forks source link

Enforce the GeoJSON polygon orientation in Vega Maps #122569

Open jsanz opened 2 years ago

jsanz commented 2 years ago

Vega uses d3-geo to render GeoJSON features into a Map. Unfortunately the convention used by this library is to expect polygon rings to be clockwise (more details about the reasoning here). This convention is not followed by current GeoJSON IETF RFC7946 standard where polygons are expected to be counterclockwise:

A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.

On the other hand, EMS is nowadays serving some datasets on different conventions, making them to work inconsistently in Kibana Vega Maps: example issue in EMS File Service: elastic/ems-file-service#231

The agreement in the aforementioned issue is to make EMS to follow the industry standard and make in 8.1 all datasets to follow RFC7946. If we don't do anything that would make none of them to work in Kibana Vega, so we need to implement a mechanism to "rewind" the data when being loaded, maybe using this library.

elasticmachine commented 2 years ago

Pinging @elastic/kibana-gis (Team:Geo)

elasticmachine commented 1 year ago

Pinging @elastic/kibana-presentation (Team:Presentation)