fix(generator): place receivers on land using Natural Earth coastline#1
Open
VladKochetov007 wants to merge 1 commit into
Open
fix(generator): place receivers on land using Natural Earth coastline#1VladKochetov007 wants to merge 1 commit into
VladKochetov007 wants to merge 1 commit into
Conversation
Receivers were positioned by distance/bearing from the tower with only coarse US bounding-box water rejection, so coastal and display-fuzzed positions could fall in the ocean (synth-US nodes off Pacifica; Sydney TCN-9 sat in the Pacific from a latitude sign error). Add a shapely + Natural Earth land check (_get_land_check): a point is water if it is outside every land polygon (ne_10m_land) or inside an inland lake (ne_50m_lakes), via STRtree lookups built lazily on first use. _place_rx_on_land now validates both the real RX position and the frontend display-fuzzed position (nodes are drawn at the fuzzed location), with random, spiral, and curated coastal-land fallbacks. The old US bounding boxes remain only as a fallback when shapely or the data is unavailable. Fix the Sydney latitude sign. Bundle the two Natural Earth GeoJSON layers as package data and add the shapely dependency so the check ships to deploy. ~120 MB RAM, ~0.5 s, lazy-loaded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Synthetic receivers (and their display-fuzzed map positions) landed in the ocean — e.g. synth-US nodes off Pacifica, Sydney TCN-9 in the Pacific.
Cause
RX positions were water-rejected only by a handful of coarse US bounding boxes. Coastal points fell through the gaps (Pacifica sat between the Pacific box and the SF-bay box), the frontend display-fuzz (±~400 m) drew the dot in water even when the real RX was on land, and Sydney had a latitude sign error.
Fix
shapely + Natural Earth land check (
_get_land_check): a point is water if it is outside every land polygon (ne_10m_land) or inside an inland lake (ne_50m_lakes), via lazily-built STRtree lookups._place_rx_on_landnow validates both the real RX and the display-fuzzed position, with random / spiral / curated-coastal fallbacks. The old US bounding boxes remain only as a fallback when shapely or the data is unavailable. Sydney latitude sign fixed.Cost / footprint
~120 MB RAM, ~0.5 s, lazy (only during fleet generation, released after), ~11 MB bundled GeoJSON. Replaces the rejected global-land-mask (921 MB, always resident).
Verified
0 water nodes across the deploy config (api=True, seed 42, 200/us, 8×1), real and display positions. Tests: 30 passed.
Note
Adds
shapely>=2.0dependency and bundles two GeoJSON layers as package data (Dockerfilepip installships them to deploy).