[object Object]

← back to La Socrata Ingester

GIS: parcel polygons via hosted FeatureServer (421,684 w/ geometry); no-order offset for gateway layers

0ccaea8dd07edc48c1438523fcb525a8b62de77c · 2026-08-11 09:27:04 -0700 · steve

NavigateLA MapServer gateway 502s/500s on bulk geometry past ~offset 44k;
parcels repointed to hosted Assessor_Parcels_Land_2025 FeatureServer (reliable).
zoning partial (43,957), landuse blocked — need hosted-FeatureServer equivalents.

Files touched

Diff

commit 0ccaea8dd07edc48c1438523fcb525a8b62de77c
Author: steve <steve@designerwallcoverings.com>
Date:   Tue Aug 11 09:27:04 2026 -0700

    GIS: parcel polygons via hosted FeatureServer (421,684 w/ geometry); no-order offset for gateway layers
    
    NavigateLA MapServer gateway 502s/500s on bulk geometry past ~offset 44k;
    parcels repointed to hosted Assessor_Parcels_Land_2025 FeatureServer (reliable).
    zoning partial (43,957), landuse blocked — need hosted-FeatureServer equivalents.
---
 src/adapters/arcgis.js |  6 +++++-
 src/sources.js         | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/adapters/arcgis.js b/src/adapters/arcgis.js
index 32177ed..0246d9f 100644
--- a/src/adapters/arcgis.js
+++ b/src/adapters/arcgis.js
@@ -61,7 +61,11 @@ export async function* arcgisPages(src, opts = {}) {
   for (;;) {
     const count = Math.min(pageSize, maxRows - offset);
     if (count <= 0) break;
-    const p = new URLSearchParams({ ...common, where, orderByFields: src.orderBy || oidField, resultOffset: String(offset), resultRecordCount: String(count) });
+    const params = { ...common, where, resultOffset: String(offset), resultRecordCount: String(count) };
+    // src.noOrder: omit orderByFields — the NavigateLA gateway 502s on sorted
+    // geometry queries; MapServer returns natural OBJECTID order anyway.
+    if (!src.noOrder) params.orderByFields = src.orderBy || oidField;
+    const p = new URLSearchParams(params);
     const url = `${base}?${p}`;
     const data = await fetchJson(url);
     if (data.error) throw new Error(`ArcGIS error: ${JSON.stringify(data.error).slice(0, 200)}`);
diff --git a/src/sources.js b/src/sources.js
index 0890723..a60cc8f 100644
--- a/src/sources.js
+++ b/src/sources.js
@@ -186,16 +186,20 @@ const gisSrc = (layer, layerId, nameFields, extra = {}) => ({
 });
 
 Object.assign(SOURCES, {
-  // Parcel polygons (2.4M) — join to permits/assessor by ain. OID-cursor + geometry.
+  // Parcel polygons — the NavigateLA 397 layer (2.4M) 502s the gateway on any
+  // feature query; the hosted Assessor_Parcels_Land_2025 FeatureServer (421k,
+  // reliable geometry) is used instead. APN -> ain for the permit join.
   gis_parcels: {
-    platform: 'arcgis', endpoint: `${NAV}/397`, geometry: true, paginate: 'oid', oidField: 'OBJECTID',
+    platform: 'arcgis',
+    endpoint: 'https://services5.arcgis.com/Y8jwjGUWbRjuqpG5/arcgis/rest/services/Assessor_Parcels_Land_2025/FeatureServer/0',
+    geometry: true, paginate: 'oid', oidField: 'OBJECTID',
     table: 'la_parcel_geom', conflict: ['oid'],
-    map: (r) => ({ oid: r.OBJECTID, ain: str(r.AIN), geom: r.__geometry }),
+    map: (r) => ({ oid: r.OBJECTID, ain: str(r.APN || r.APN9 || r.AIN), geom: r.__geometry }),
   },
-  // Zoning + land use (~50–59k each; offset paging, 20k/page).
-  // geometry-heavy polygon layers: small pages + OID-cursor (20k/page 500s or truncates)
-  gis_zoning:  gisSrc('zoning',  71, ['ZONE_CMPLT', 'ZONE_CLASS'], { pageSize: 3000, paginate: 'oid' }),
-  gis_landuse: gisSrc('landuse', 70, ['GPLU_Legend', 'GPLU'],     { pageSize: 3000, paginate: 'oid' }),
+  // Zoning + land use (~50–59k). NavigateLA gateway 502s on sorted geometry -> use
+  // offset paging with NO orderByFields (noOrder) + small pages.
+  gis_zoning:  gisSrc('zoning',  71, ['ZONE_CMPLT', 'ZONE_CLASS'], { pageSize: 2000, noOrder: true }),
+  gis_landuse: gisSrc('landuse', 70, ['GPLU_Legend', 'GPLU'],     { pageSize: 2000, noOrder: true }),
   // Boundaries (small).
   gis_council_districts:     gisSrc('council_district',    418, ['District_Name', 'NAME', 'District'], { pageSize: 20000 }),
   gis_neighborhood_councils: gisSrc('neighborhood_council', 439, ['NAME'], { pageSize: 20000 }),

← cc12805 GIS layers (NavigateLA ArcGIS) + CSLB contractor loader  ·  back to La Socrata Ingester  ·  GIS land use via hosted LADCP FeatureServer (56,901 features 4862c20 →