Skip to content

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

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

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.

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).
  • Create a map visualization for Heavy Metal Soil Contamination: The map should (still) be zoomed to Switzerland.
  • Symbols on maps should render correctly (how to test?)
  • Overlapping smaller regions should be in front of larger regions such they can be hovered and display a tooltip.

  • 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 Error Error Mar 27, 2026 7:48am

Request Review

…INDASSUP-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.
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.

1 participant