← back to Nationalrealestate
Commercial from_parcel: add bare-'Commercial' fallback classifier + Salt Lake County (13199 commercial, plausible office/industrial/retail split). Verified+rejected Cook/NY/TX (class-code use_desc, not descriptive — needs code-map; Cook came back 100%% industrial)
b3ca8a19424ace1eea47cb5a3ac1ddcad63b005a · 2026-07-30 21:17:54 -0700 · steve@designerwallcoverings.com
Files touched
M src/ingest/commercial/engine.tsM src/lib/commercial_types.ts
Diff
commit b3ca8a19424ace1eea47cb5a3ac1ddcad63b005a
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Thu Jul 30 21:17:54 2026 -0700
Commercial from_parcel: add bare-'Commercial' fallback classifier + Salt Lake County (13199 commercial, plausible office/industrial/retail split). Verified+rejected Cook/NY/TX (class-code use_desc, not descriptive — needs code-map; Cook came back 100%% industrial)
---
src/ingest/commercial/engine.ts | 4 ++++
src/lib/commercial_types.ts | 3 +++
2 files changed, 7 insertions(+)
diff --git a/src/ingest/commercial/engine.ts b/src/ingest/commercial/engine.ts
index 835af0e..05bcc61 100644
--- a/src/ingest/commercial/engine.ts
+++ b/src/ingest/commercial/engine.ts
@@ -11,6 +11,10 @@ const ADAPTERS: Record<string, () => Promise<{ run: () => Promise<{ upserted: nu
'la-arcgis': async () => ({ run: (await import('./arcgis_commercial.ts')).ingestArcgisCommercial('la') }),
// Materialize commercial from already-loaded parcels (use_desc is descriptive) — $0.
king: async () => ({ run: (await import('./from_parcel.ts')).ingestCommercialFromParcel('53033', 'King County WA (Seattle)') }),
+ saltlake: async () => ({ run: (await import('./from_parcel.ts')).ingestCommercialFromParcel('49035', 'Salt Lake County UT') }),
+ // NOTE: Cook(17031)/NY(36061)/Bexar-TX(48029) use CLASS CODES ('Class 5-93','C7','F1')
+ // not descriptive text, so from_parcel can't classify them (verified: Cook came back
+ // 100% industrial — implausible). They need a per-county class-code map (future task).
};
async function main() {
diff --git a/src/lib/commercial_types.ts b/src/lib/commercial_types.ts
index 8ed2f19..009aeef 100644
--- a/src/lib/commercial_types.ts
+++ b/src/lib/commercial_types.ts
@@ -61,6 +61,9 @@ export function classifyCommercialByDesc(desc: string | null): CommercialType |
const d = (desc || '').trim();
if (!d) return null;
for (const [re, type] of RULES) if (re.test(d)) return type;
+ // Fallback for counties that label only a top-level category (e.g. Salt Lake 'Commercial').
+ // 'Industrial' already matches a RULE above; a bare 'Commercial' → generic 'other'.
+ if (/\bcommercial\b/i.test(d)) return 'other';
return null;
}
← d55600a Add classifyCommercialByDesc + from_parcel materializer: ext
·
back to Nationalrealestate
·
Add San Diego full (SANDAG 1.09M): authoritative ASR_ZONE->l 6ad5d70 →