fix(cadastre): filter Point/LineString geometry in upsert_parcel/zouit (worker crash root cause) #184

Merged
lekss361 merged 1 commit from fix/cadastre-parcel-geometry-type-filter into main 2026-05-15 15:37:29 +00:00

1 commit

Author SHA1 Message Date
lekss361
adc1eb1366 fix(cadastre): filter Point/LineString geometry in upsert_parcel/zouit
cad_parcels.geom is geometry(Polygon, 4326) — strict schema. NSPD
occasionally returns Point geometry for parcels without detailed
boundary, causing INSERT failure:
  psycopg.errors.InvalidParameterValue:
  Geometry type (Point) does not match column type (Polygon)

This killed pilot v8 at quarter 66:41:0104002 — worker autoretry
exhausted, job hung at 25/50 (heartbeat stale).

Fix: filter geometry.type at Python level in upsert_parcel + upsert_zouit
(same pattern as upsert_quarter_geom_from_feature). Non-Polygon
geometry → geom=NULL, raw_props preserved.

Tables with permissive GEOMETRY schema (cad_buildings, cad_constructions,
cad_enk, cad_oncs) unaffected — they accept any geometry type.

Tests: 3 new (Point parcel → geom=NULL, Polygon happy path, LineString zouit).
2026-05-15 18:32:50 +03:00