perf: simplify WFIGS perimeter geometry at query time

Ask ArcGIS for 500 features, 5-decimal precision, and ~250m offset so
fire rings are outlines instead of tens of thousands of vertices.
This commit is contained in:
Sirius DevOps 2026-08-27 21:16:53 -04:00
commit 9c14b899ee
2 changed files with 15 additions and 2 deletions

View file

@ -597,12 +597,14 @@ async def upsert_vessel(marker: dict) -> None:
}
def _wfigs_params(bbox: str | None) -> dict:
def _wfigs_params(bbox: str | None, *, offset_m: float = 250.0) -> dict:
params = {
"where": "1=1",
"outSR": "4326",
"f": "geojson",
"resultRecordCount": 2000,
"resultRecordCount": 500,
"maxAllowableOffset": offset_m / 111_320.0, # metres → degrees
"geometryPrecision": 5,
}
if bbox:
minlon, minlat, maxlon, maxlat = quantize_bbox(*parse_bbox(bbox))