mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-21 23:24:47 +02:00
landclass: filter antimeridian-wrapping PAD-US records
47 PAD-US units (Aleutian/Bering-Sea BOEM marine features, all is_valid=False) are stored as antimeridian-wrapping polygons whose bbox spans ~360 deg of longitude. Their invalid planar geometry forms latitude bands that ST_Intersects false-matches for non-US points (e.g. London/Germany at ~51N matched "Rat Islands" ogc_fid 3974). Fix: add `AND (ST_XMax(geom) - ST_XMin(geom)) < 60` to the lookup_landclass SELECT. No DB writes; two cheap ST_XMax/XMin evals on the already spatial-index-filtered result set. Verified live: total 651088 rows, filtered 651041 (exactly 47 excluded); Yosemite/Grand Canyon retained, London/Germany now empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
573347a2ee
commit
484dfbd1e0
2 changed files with 47 additions and 0 deletions
|
|
@ -214,6 +214,9 @@ def lookup_landclass(lat, lon):
|
|||
des_tp, gap_sts, pub_access, category, gis_acres, state_nm
|
||||
FROM pad_units
|
||||
WHERE ST_Intersects(geom, ST_SetSRID(ST_MakePoint(%s, %s), 4326))
|
||||
-- exclude antimeridian-wrapping polygons: 47 BOEM marine artifacts
|
||||
-- span ~360 deg longitude and false-match non-US points at their lat band
|
||||
AND (ST_XMax(geom) - ST_XMin(geom)) < 60
|
||||
ORDER BY gis_acres ASC
|
||||
LIMIT 10""",
|
||||
(lon, lat)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue