Skip to content

fix(map): Normalize winding order to CCW & replace d3-geo with turf LINDASSUP-247#2542

Open
hupf wants to merge 1 commit intomainfrom
bug/LINDASSUP-247
Open

fix(map): Normalize winding order to CCW & replace d3-geo with turf LINDASSUP-247#2542
hupf wants to merge 1 commit intomainfrom
bug/LINDASSUP-247

Conversation

@hupf
Copy link
Copy Markdown
Contributor

@hupf hupf commented Mar 26, 2026

Closes LINDASSUP-247

  • Previously the received winding order of polygons has not been modified. This caused issues with helpers relying on a specific winding order. We now "rewind" all polygons to CCW ("right hand rule"), right after parsing, as is the standard with GeoJSON.
  • The d3-geo helpers rely on a CW winding order, which would require a rewinding before each call. Therefore d3-geo is now replaced with equivalent helpers from turf, that use the CCW winding order, or polylabel which is winding order agnostic.

How to test

  • Create a map visualization for Heavy Metal Soil Contamination: The map should be zoomed to Switzerland, not the whole world (this was the current bug).
  • Symbols on maps should render correctly → see "Verkehrsleistung auf den Flugplätzen"
  • Overlapping smaller regions should be in front of larger regions such they can be hovered and display a tooltip → see "NFI: Topics by extent of damage gaps (10 classes)"
  • Data points should be centered correctly to the areas → see "NFI: Topics by extent of damage gaps (10 classes)", then add "Symbols" and choose "Canton"

  • I added a CHANGELOG entry
  • I made a self-review of my own code
  • I wrote tests for the changes (if applicable)
  • I wrote configurator and chart config migrations (if applicable)

@hupf hupf self-assigned this Mar 26, 2026
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
visualization-tool Ready Ready Preview, Comment Apr 27, 2026 11:46am

Request Review

- Previously the received winding order of polygons has not been
  modified. This caused issues with helpers relying on a specific
  winding order. We now "rewind" all polygons to CCW ("right hand
  rule"), right after parsing, as is the standard with GeoJSON.
- The d3-geo helpers rely on a CW winding order, which would require a
  rewinding before each call. Therefore d3-geo is now replaced with
  equivalent helpers from turf, that use the CCW winding order, or
  polylabel which is winding order agnostic.
@hupf hupf force-pushed the bug/LINDASSUP-247 branch from 4ac4542 to ed41ba2 Compare April 27, 2026 11:36
@hupf hupf marked this pull request as ready for review April 27, 2026 11:37
@hupf hupf requested a review from ludovicm67 April 27, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants