The OSM bbox sync was picking up `landuse=industrial` polygons that sit
just across the borders in Laos, Thailand, Cambodia and southern China.
After the bulk promote we ended up with 220 of those in the public
catalog — Vientiane SEZ, Phnom Penh SEZ, Sihanoukville SEZ, several
Thai industrial estates etc.
Two-part fix:
1. `scripts/data/vn-country-polygon.ts` — a hand-traced ~30-vertex
GeoJSON polygon that follows VN's land + sea border. The eastern
edge is generous (110°E) so every coastal industrial zone (Vũng Áng
/ Formosa, Dung Quất, Nhơn Hội, Vũng Tàu / Long Sơn) sits comfortably
inside; the western/northern edges trace the actual neighbour
borders. Includes a pure-JS `isPointInVietnam(lng, lat)` ray-cast
helper for the sync script (no extra dep).
2. `scripts/prune-non-vietnam-osm.ts` — one-shot cleaner. Uses PostGIS
`ST_Within(location, polygon)` to delete every OSM row whose centroid
falls outside. Verified the polygon doesn't reject genuine VN parks
(Formosa Hà Tĩnh, Dung Quất, Nhơn Hội, KCN Đất Đỏ etc. all pass).
3. `sync-osm-industrial-parks.ts` `parseFeature()` now calls
`isPointInVietnam` after computing the centroid and bails early on a
miss, so the next monthly cron run won't re-import them.
Run on dev: removed 220 rows. Final catalog 1,483 KCN, all inside the
Vietnam mainland polygon.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>