Skip to content

GeofenceGenerator: keep the feature unchanged on download, and crop, search and wrap fixes - #406

Open
j-w9 wants to merge 5 commits into
ArduPilot:mainfrom
j-w9:geofence-generator-fixes
Open

j-w9 wants to merge 5 commits into
ArduPilot:mainfrom
j-w9:geofence-generator-fixes

Conversation

@j-w9

@j-w9 j-w9 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor
  • Download edited the feature itself (dropped the closing point and rotated the rings), so downloading the same lake twice gave different files. Work on a copy.
  • Only the first / and \ in the name were replaced.
  • Crop threw on a LineString feature and stopped there, so later features were missing. Skip anything that isn't a polygon, they aren't shown anyway.
  • A failed search left the old features, so Crop brought them back.
  • wrap_180 didn't wrap below -180 (-270 stayed -270).

j-w9 added 5 commits November 22, 2026 11:19
Download dropped the closing point and rotated the rings of the feature itself, so a second download of the same water body used a different origin and gave a different file, and the popup point count dropped. Work on a copy of each ring.
String replace only changed the first / and the first \, so names with more than one still reached the file name.
turf.intersect throws on a LineString (an unclosed water way), which stopped the crop at that feature and left the later ones off the map. These features are never displayed, so skip them.
The map was cleared at the start of a search but the features were not, so after a failed search Crop brought the previous results back.
JS remainder keeps the sign of the dividend, so angles below -180 were not wrapped (-270 stayed -270). This is reached by longitude differences across the antimeridian.
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