Skip to content

France Departments winding order incompatible with Vega #231

Open
@nickpeihl

Description

@nickpeihl

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 to China 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

{
  $schema: https://vega.github.io/schema/vega/v3.0.json
  config: {
    kibana: {
      type: map
      latitude: 48
      longitude: -5
      zoom: 3
    }
  }
  data: [
    {
      name: countries
      url: {%type%: "emsfile", name: "Spain Provinces"}
      format: {type: "json", property: "features"}
    }
  ]
  marks: [
    {
      type: shape
      from: { data: "countries" }
      encode: {
        "enter": {
          "strokeWidth": {"value": 0.5},
          "stroke": {"value": "#bbb"},
          "fill": {"value": "#e5e8d3"}
        }
      }
      transform: [
        {type: "geoshape", projection: "projection"}
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    dataData related issues and requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions