[object Object]

← back to Nationalrealestate

TK-16: add CA Ring 3 — San Joaquin (06077) + Fresno (06019) + Monterey (06053) — pass 9

d549281b781b12d242bbba66f09c3a7132c14753 · 2026-08-10 16:10:26 -0700 · Steve Abrams

Further out from LA. All COVERAGE-only (AB-1785, priced=0):
- San Joaquin 06077: 252,719, richest (FULL_ADDRESS + use + string value + characteristics), centroid latlng.
- Fresno 06019: ~412k real-APN (largest; enterprise SDE MapServer, SITEADDRESS2 city/zip parsed,
  NAME1 owner, geometry+centroid latlng).
- Monterey 06053: 122,448, value+use (no situs), centroid latlng, City 'None'->null.

Verified e2e vs local usre (2000 each): 100% latlng all three; SJ 100% addr, Fresno owner+value+partial
situs, Monterey value-only as designed. tsc clean (my files). Local master, NOT pushed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit d549281b781b12d242bbba66f09c3a7132c14753
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 10 16:10:26 2026 -0700

    TK-16: add CA Ring 3 — San Joaquin (06077) + Fresno (06019) + Monterey (06053) — pass 9
    
    Further out from LA. All COVERAGE-only (AB-1785, priced=0):
    - San Joaquin 06077: 252,719, richest (FULL_ADDRESS + use + string value + characteristics), centroid latlng.
    - Fresno 06019: ~412k real-APN (largest; enterprise SDE MapServer, SITEADDRESS2 city/zip parsed,
      NAME1 owner, geometry+centroid latlng).
    - Monterey 06053: 122,448, value+use (no situs), centroid latlng, City 'None'->null.
    
    Verified e2e vs local usre (2000 each): 100% latlng all three; SJ 100% addr, Fresno owner+value+partial
    situs, Monterey value-only as designed. tsc clean (my files). Local master, NOT pushed.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 SOURCES.md                         |  6 +++++
 src/ingest/parcels/arcgis_sales.ts | 54 ++++++++++++++++++++++++++++++++++++++
 src/ingest/parcels/engine.ts       |  3 +++
 src/jobs/hourly_loop.ts            |  3 +++
 4 files changed, 66 insertions(+)

diff --git a/SOURCES.md b/SOURCES.md
index 7273a41..83ca367 100644
--- a/SOURCES.md
+++ b/SOURCES.md
@@ -129,3 +129,9 @@ The next ring out from LA (pass 8, all COVERAGE-only — AB-1785, no price/event
 - **Santa Barbara County CA (06083)** — `https://maps.calagpermits.org/arcgis/rest/services/SantaBarbara/Parcels/MapServer/0`, **132,504** parcels. The richest CA roll: `APN`, `Situs1` (→ address), `SCity`, `SZip`, `LandUse` (text use-desc), `Net_AV` (→ total_value), `YearBuilt`/`SqFootage`/`Bedrooms`/`Bathrooms` (blank as `' '`/`0` on commercial → `num()` nulls), `Owner` (→ owner_name). OID field is `OBJECTID_1`; `maxRecordCount=1000`. lat/lng via `geometry:true` + ring `centroid()` (returnCentroid NOT honored; native SR 3310, `outSR=4326`).
 - **Imperial County CA (06025)** — `https://services7.arcgis.com/RomaVqqozKczDNgd/ArcGIS/rest/services/Parcels_Oct_2023/FeatureServer/0` (the `Parcels_Default_2026` sibling is a 253-row tax-default subset — do NOT use), **88,170** parcels. Explicit `Longitude`/`Latitude` fields (cleanest lat/lng, `geometry:false`). `APN`, `F_Situs1` (→ address), `Sit_Zip`, `LandUse1` (assessor code only), `Land`/`Imp_` (STRING → `anyPrice()` parses; summed → total_value), `Assessee` (→ owner_name). OID field is `FID`; `maxRecordCount=2000`.
 - **San Bernardino County CA (06071)** — `https://services.arcgis.com/aA3snZwJfFkVyDuP/arcgis/rest/services/Parcels_for_San_Bernardino_County/FeatureServer/0`, **~839,795** parcels (largest CA county by area — big coverage win). NO situs address on this roll. `ParcelNumber` (→ apn), `AssessClass` (→ use_desc), `LandValue`/`ImprovementValue` (COMMA-formatted strings `'42,345'` → `anyPrice()` strips commas; plain `Number()` yields NaN — summed → total_value), `OwnerName` (mostly redacted `"Protected Per CA Gov Code 7928.205"` → filtered to null). `maxRecordCount=1000`; lat/lng via `geometry:true` + ring `centroid()`. All three verified end-to-end against the local `usre` DB; `tsc` clean.
+
+Ring 3 out from LA (pass 9, all COVERAGE-only — AB-1785):
+
+- **San Joaquin County CA (06077)** — `https://services2.arcgis.com/GQhSReJEO6f7tsvy/arcgis/rest/services/Parcels/FeatureServer/0`, **252,719** parcels. Rich: `APN`, `FULL_ADDRESS` (one-line incl city/state/zip → address), `SITUSZIP`, `DESCRIPTION` (use), `LAND_VALUE`/`IMPROVEMENT_VALUE` (STRING, no commas → `anyPrice()`; summed → total_value), `YEAR_BUILT`, `TOTALLIV_AREA` (→ sqft), `BEDROOMS`, `BATHROOM_WHOLE`. `maxRecordCount=2000`, OID `OBJECTID`. lat/lng via `centroid:true` (returnCentroid honored).
+- **Fresno County CA (06019)** — `https://gisprod10.co.fresno.ca.us/server/rest/services/FC_PARCEL_SELECT/MapServer/0`, **~412k** parcels with real APN (`where=APN<>''` skips empty-APN head rows). Enterprise SDE MapServer (a `SHAPE.STArea()` helper exists → always explicit outFields). `APN`, `SITEADDRESS1` (street → address), `SITEADDRESS2` (city+zip packed, e.g. "DOS PALOS 93620" → parsed), `TOTAL_ASSESSED_VALUE` (int), `NAME1` (→ owner_name). `maxRecordCount=2000`, OID `OBJECTID` (works though `objectIdField` reports None). lat/lng via `geometry:true` + ring `centroid()` (returnCentroid unsupported).
+- **Monterey County CA (06053)** — `https://services2.arcgis.com/nOGTdfb4kF4dZljH/arcgis/rest/services/Parcels_Data/FeatureServer/0`, **122,448** parcels. No situs address — qualifies via value. `APN`, `Land_Use` (use desc), `Land_Value`/`Imp_Value` (int, summed → total_value), `City` (often literal "None" → null). `maxRecordCount=2000`, OID `OBJECTID`. lat/lng via `centroid:true`. All three verified end-to-end against the local `usre` DB; `tsc` clean.
diff --git a/src/ingest/parcels/arcgis_sales.ts b/src/ingest/parcels/arcgis_sales.ts
index b3b7901..9bb77e8 100644
--- a/src/ingest/parcels/arcgis_sales.ts
+++ b/src/ingest/parcels/arcgis_sales.ts
@@ -455,6 +455,60 @@ const SOURCES: Record<string, Source> = {
       return { fips: '06071', apn, lat, lng, use: clean(a.AssessClass),
         totalValue: (land || 0) + (imp || 0) || null, grantee: owner, raw: a } as Rec; }).filter(Boolean) as Rec[],
   },
+  'san-joaquin': {
+    // San Joaquin County CA (Stockton/Tracy) — Ring 3. AB-1785 → COVERAGE config. Rich roll:
+    // FULL_ADDRESS (one-line incl city/state/zip), use desc, value (STRING, no commas), full characteristics.
+    // lat/lng via returnCentroid (centroid:true).
+    key: 'san-joaquin', label: 'San Joaquin County CA', cursorKey: 'san_joaquin',
+    geometry: false, centroid: true, orderBy: 'OBJECTID', pageSize: 2000,
+    layer: 'https://services2.arcgis.com/GQhSReJEO6f7tsvy/arcgis/rest/services/Parcels/FeatureServer/0',
+    where: 'APN IS NOT NULL',
+    outFields: 'APN,FULL_ADDRESS,SITUSZIP,DESCRIPTION,LAND_VALUE,IMPROVEMENT_VALUE,YEAR_BUILT,TOTALLIV_AREA,BEDROOMS,BATHROOM_WHOLE',
+    fieldMap: { source_id: 'APN', address: 'FULL_ADDRESS', zip: 'SITUSZIP', use_desc: 'DESCRIPTION',
+      total_value: 'LAND_VALUE+IMPROVEMENT_VALUE', year_built: 'YEAR_BUILT', sqft: 'TOTALLIV_AREA',
+      beds: 'BEDROOMS', baths: 'BATHROOM_WHOLE', lat: 'centroid.y', lng: 'centroid.x' },
+    toRecords: (fs) => fs.map(f => { const a = f.attributes; const apn = s(a.APN); if (!apn) return null;
+      const c = f.centroid || {}; const land = anyPrice(a.LAND_VALUE), imp = anyPrice(a.IMPROVEMENT_VALUE);
+      return { fips: '06077', apn, address: clean(a.FULL_ADDRESS), zip: s(a.SITUSZIP), use: clean(a.DESCRIPTION),
+        lat: num(c.y), lng: num(c.x), year: num(a.YEAR_BUILT), sqft: num(a.TOTALLIV_AREA),
+        beds: num(a.BEDROOMS), baths: num(a.BATHROOM_WHOLE),
+        totalValue: (land || 0) + (imp || 0) || null, raw: a } as Rec; }).filter(Boolean) as Rec[],
+  },
+  fresno: {
+    // Fresno County CA — Ring 3, largest here (~412k with real APN; empty-APN head rows filtered by where).
+    // AB-1785 → COVERAGE config. Enterprise SDE MapServer: attribute names are plain but a SHAPE.STArea()
+    // helper exists → always request explicit outFields. City+zip are packed into SITEADDRESS2
+    // ("DOS PALOS 93620") → parsed. Integer value fields. lat/lng via geometry+ring centroid (returnCentroid unsupported).
+    key: 'fresno', label: 'Fresno County CA', cursorKey: 'fresno',
+    geometry: true, orderBy: 'OBJECTID', pageSize: 2000,
+    layer: 'https://gisprod10.co.fresno.ca.us/server/rest/services/FC_PARCEL_SELECT/MapServer/0',
+    where: "APN<>''",
+    outFields: 'APN,SITEADDRESS1,SITEADDRESS2,ASSESS_LAND_VAL,ASSESS_IMP_VAL,TOTAL_ASSESSED_VALUE,NAME1',
+    fieldMap: { source_id: 'APN', address: 'SITEADDRESS1', city: 'SITEADDRESS2(city)', zip: 'SITEADDRESS2(zip)',
+      total_value: 'TOTAL_ASSESSED_VALUE', owner_name: 'NAME1' },
+    toRecords: (fs) => fs.map(f => { const a = f.attributes; const apn = s(a.APN); if (!apn) return null;
+      const [lng, lat] = centroid(f.geometry);
+      const sa2 = clean(a.SITEADDRESS2) || ''; const zip = (sa2.match(/\b(\d{5})\b/) || [])[1] || null;
+      const city = clean(sa2.replace(/\s*\d{5}.*$/, '')) || null;
+      return { fips: '06019', apn, address: clean(a.SITEADDRESS1), city, zip,
+        lat, lng, totalValue: num(a.TOTAL_ASSESSED_VALUE), grantee: clean(a.NAME1), raw: a } as Rec; }).filter(Boolean) as Rec[],
+  },
+  monterey: {
+    // Monterey County CA — Ring 3. AB-1785 → COVERAGE config. No situs address; qualifies via assessed
+    // value. Land_Use (desc) + integer Land_Value/Imp_Value. City is often the literal string "None" → null.
+    // lat/lng via returnCentroid (centroid:true).
+    key: 'monterey', label: 'Monterey County CA', cursorKey: 'monterey',
+    geometry: false, centroid: true, orderBy: 'OBJECTID', pageSize: 2000,
+    layer: 'https://services2.arcgis.com/nOGTdfb4kF4dZljH/arcgis/rest/services/Parcels_Data/FeatureServer/0',
+    where: 'APN IS NOT NULL',
+    outFields: 'APN,City,Land_Use,Land_Value,Imp_Value',
+    fieldMap: { source_id: 'APN', city: 'City', use_desc: 'Land_Use', total_value: 'Land_Value+Imp_Value', lat: 'centroid.y', lng: 'centroid.x' },
+    toRecords: (fs) => fs.map(f => { const a = f.attributes; const apn = s(a.APN); if (!apn) return null;
+      const c = f.centroid || {}; const land = num(a.Land_Value), imp = num(a.Imp_Value);
+      let city = clean(a.City); if (city && /^none$/i.test(city)) city = null;
+      return { fips: '06053', apn, city, use: clean(a.Land_Use), lat: num(c.y), lng: num(c.x),
+        totalValue: (land || 0) + (imp || 0) || null, raw: a } as Rec; }).filter(Boolean) as Rec[],
+  },
 };
 
 const execFileP = promisify(execFile);
diff --git a/src/ingest/parcels/engine.ts b/src/ingest/parcels/engine.ts
index b8fb1ff..7d421db 100644
--- a/src/ingest/parcels/engine.ts
+++ b/src/ingest/parcels/engine.ts
@@ -44,6 +44,9 @@ const ADAPTERS: Record<string, () => Promise<{ run: () => Promise<{ upserted: nu
   'santa-barbara': async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('santa-barbara') }; },
   imperial: async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('imperial') }; },
   'san-bernardino': async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('san-bernardino') }; },
+  'san-joaquin': async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('san-joaquin') }; },
+  fresno: async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('fresno') }; },
+  monterey: async () => { const m = await import('./arcgis_sales.ts'); return { run: m.ingestArcgisSales('monterey') }; },
 };
 
 async function main() {
diff --git a/src/jobs/hourly_loop.ts b/src/jobs/hourly_loop.ts
index a8c3b91..2bbab55 100644
--- a/src/jobs/hourly_loop.ts
+++ b/src/jobs/hourly_loop.ts
@@ -80,6 +80,9 @@ const JOBS: Job[] = [
   { name: 'parcels-sb',    script: 'src/ingest/parcels/engine.ts',    args: ['santa-barbara'], minIntervalHours: 2, runSources: ['santa_barbara'] },
   { name: 'parcels-imperial',script:'src/ingest/parcels/engine.ts',  args: ['imperial'],      minIntervalHours: 2, runSources: ['imperial'] },
   { name: 'parcels-sbd',   script: 'src/ingest/parcels/engine.ts',    args: ['san-bernardino'], minIntervalHours: 2, runSources: ['san_bernardino'] },
+  { name: 'parcels-sanjoaquin',script:'src/ingest/parcels/engine.ts', args: ['san-joaquin'],  minIntervalHours: 2, runSources: ['san_joaquin'] },
+  { name: 'parcels-fresno',script:'src/ingest/parcels/engine.ts',     args: ['fresno'],        minIntervalHours: 2, runSources: ['fresno'] },
+  { name: 'parcels-monterey',script:'src/ingest/parcels/engine.ts',   args: ['monterey'],      minIntervalHours: 2, runSources: ['monterey'] },
   // TK-5: full San Diego County (1.09M) via SANDAG — zoning + assessed value; was in engine but missing from rotation.
   { name: 'parcels-sd-sandag', script: 'src/ingest/parcels/engine.ts', args: ['san-diego-sandag'], minIntervalHours: 2, runSources: ['san_diego_sandag'] },
   // TK-5: Santa Clara County CA (San Jose, 493k) — situs address; was in engine but missing from rotation.

← abd259f auto-data-snapshot: 2026-08-10T16:09:17 (1 data files) — SOU  ·  back to Nationalrealestate  ·  TK-16: add CA Ring 4 — Solano (06095) + Butte (06007) + Sacr dcae6a5 →