@urbankitstudio/atlas 0.6.34 → 0.6.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -28,9 +28,9 @@ var data_default = {
28
28
  lastUpdated: "2026-10-14",
29
29
  totals: {
30
30
  states: 51,
31
- counties: 394,
32
- endpoints: 412,
33
- countiesWithEndpoint: 385,
31
+ counties: 395,
32
+ endpoints: 413,
33
+ countiesWithEndpoint: 386,
34
34
  countiesUnprobeable: 1
35
35
  },
36
36
  states: [
@@ -374,8 +374,8 @@ var data_default = {
374
374
  slug: "tennessee",
375
375
  name: "Tennessee",
376
376
  abbrev: "TN",
377
- countyCount: 4,
378
- endpointCount: 4,
377
+ countyCount: 5,
378
+ endpointCount: 5,
379
379
  populated: true
380
380
  },
381
381
  {
@@ -31386,7 +31386,7 @@ var tennessee_default = {
31386
31386
  stateSlug: "tennessee",
31387
31387
  stateName: "Tennessee",
31388
31388
  stateAbbrev: "TN",
31389
- lastUpdated: "2026-10-03",
31389
+ lastUpdated: "2026-10-14",
31390
31390
  counties: [
31391
31391
  {
31392
31392
  id: "tn-davidson",
@@ -31619,6 +31619,61 @@ var tennessee_default = {
31619
31619
  email: null
31620
31620
  },
31621
31621
  notes: `Sullivan County, Tennessee (county seat Blountville; Kingsport and Bristol) has no county-run public REST parcel layer with owner names. Its parcels are carried on the City of Johnson City's regional ParcelPublishing/TaxParcels MapServer layer 0 (Tax Parcels), which also holds Washington, Carter, Unicoi and neighbouring counties. Filter with COUNTYNAME='Sullivan County' (78,958 of the layer's 183,538 rows on 2026-10-03); the plain value 'Sullivan' matches nothing. About 313 Sullivan parcels (GISLINK starting 082) carry a NULL or different COUNTYNAME and fall outside this scope, roughly 0.4 percent; COUNTY_ID=82 catches them but admits 314 rows from outside the county, so the name scope stays. The owner is OWNER (with OWNER2); the parcel ID is GISLINK (e.g. 082029B A 01600) with ID as the display form (029B A 016.00), and PARID is NULL for Sullivan rows. ADDRESS stores the street name first and the house number last (BRENTWOOD DR 377), so search on a street word: a number-first LIKE ('%377 BRENTWOOD DR%') returns nothing, and only 647 of 78,737 Sullivan addresses start with a digit, so the free tools' address auto-lookup will miss most Sullivan addresses until they retry number-last. The owner mailing address is MAILADDR with MAILCITY, STATE and ZIP. CARDURL links each parcel to the state's TPAD property card. CORS reflects the request Origin (Access-Control-Allow-Origin echoed back, credentials true); a request without an Origin gets no CORS header. maxRecordCount is 2000. LICENCE: RESTRICTED. The ArcGIS item's licence text reads: "Read access only for all city staff. Delivered products are not to be resold by the purchaser for any reason and may not be reproduced without the written permission of the staff of the Johnson City GIS Division." The item and the REST endpoint are public, but the terms restrict resale and reproduction, so the atlas records only the query URL, stores no copy of the layer beyond the short-lived server cache every live query passes through, and serves this county by live query only; Leo reviewed and accepted that exposure on 2026-10-03. The data was last refreshed in October 2025. Sullivan County's own SULLIVAN service on ArcGIS Online has no owner field, and Tennessee publishes no statewide parcel REST layer. Verified live 2026-10-03: owner SMITH returned rows (first SMITH BETTY TRUSTEE, GISLINK 082029B A 01600, BRENTWOOD DR 377, mailing 377 BRENTWOOD DRIVE KINGSPORT).`
31622
+ },
31623
+ {
31624
+ id: "tn-montgomery",
31625
+ state: "TN",
31626
+ stateName: "Tennessee",
31627
+ stateSlug: "tennessee",
31628
+ county: "Montgomery",
31629
+ countySlug: "montgomery-county",
31630
+ countyFips: "47125",
31631
+ hasPublicRest: true,
31632
+ endpoints: [
31633
+ {
31634
+ url: "https://gis.montgomerytn.gov/gisserver/rest/services/PublicParcels/MapServer/0",
31635
+ serviceType: "MapServer",
31636
+ layerIndex: 0,
31637
+ layerName: "PublicParcels",
31638
+ supportsQuery: true,
31639
+ corsEnabled: true,
31640
+ searchFields: [
31641
+ {
31642
+ name: "ParcelNo",
31643
+ label: "Parcel Number (e.g. 066E A 00600 000)",
31644
+ searchable: true
31645
+ },
31646
+ {
31647
+ name: "GISLINK",
31648
+ label: "GIS Link (Parcel ID, e.g. 063066E A 00600)",
31649
+ searchable: true
31650
+ },
31651
+ {
31652
+ name: "PropertyAddress",
31653
+ label: "Situs Address",
31654
+ searchable: true
31655
+ },
31656
+ {
31657
+ name: "PropertyCity",
31658
+ label: "Situs City",
31659
+ searchable: false
31660
+ }
31661
+ ],
31662
+ sampleQuery: "https://gis.montgomerytn.gov/gisserver/rest/services/PublicParcels/MapServer/0/query?where=UPPER(PropertyAddress)+LIKE+'%25MAIN%25'&outFields=ParcelNo,GISLINK,PropertyAddress,PropertyCity&returnGeometry=false&f=json",
31663
+ license: "unknown",
31664
+ licenseUrl: "http://montgomerytn.gov/assessor/public-parcels",
31665
+ status: "live",
31666
+ lastVerified: "2026-10-14",
31667
+ verifiedBy: "manual"
31668
+ }
31669
+ ],
31670
+ contact: {
31671
+ department: "Montgomery County Assessor of Property",
31672
+ url: "http://montgomerytn.gov/assessor/gis",
31673
+ email: null
31674
+ },
31675
+ notes: "Montgomery County, Tennessee (Clarksville; FIPS 47125). The county's public parcel layer, the one the Assessor of Property's Public Parcels page advertises, is PublicParcels MapServer layer 0 on the county GIS server (gis.montgomerytn.gov, ArcGIS Server): 99,863 rows on 2026-10-14. THIS LAYER PUBLISHES PARCEL IDS AND SITUS ADDRESSES BUT NO OWNER OR MAILING FIELDS, so owner lookups return nothing here; look a parcel up by parcel number, by street address or by point. The parcel id is ParcelNo (e.g. 066E A 00600 000) with GISLINK as the shorter link id (063066E A 00600); the situs is PropertyAddress with PropertyCity. The rows are one per building card, not one per parcel: a parcel with several buildings repeats its parcel id and situs on each row (one sampled parcel returned six), so counts of rows overstate counts of parcels. The layer also carries subdivision, lot and block, deed book and page, property type, taxing district, acreage, assessed and appraised values, building attributes and the last sale. The layer's name is PublicParcels, the wkid is 102736 (Tennessee State Plane, US feet; latestWkid 2274), and outSR=4326 returns longitude and latitude. maxRecordCount is 2000 with pagination. CORS: the server echoes the request Origin in Access-Control-Allow-Origin, so a probe without an Origin header reads it as closed. No license or terms are published on the layer or on the assessor's pages. Verified 2026-10-14: a count of 99,863, a situs LIKE query on MAIN (120 rows) and an outSR=4326 query.",
31676
+ addedAt: "2026-10-14"
31622
31677
  }
31623
31678
  ]
31624
31679
  };
@@ -35899,7 +35954,7 @@ var los_angeles_default = {
35899
35954
  orderField: "adddttm",
35900
35955
  streetNumberType: "text",
35901
35956
  latestRecordDate: "2026-10-09",
35902
- coverage: "Open LADBS code-enforcement cases only, about 29,000, opened 1995 to present. Closed cases are published in a separate dataset (rken-a55j) that this tool does not search. The street is split across columns: with a house number, '139 W 88th St' is matched as 139 on stno and '88th' on stname (one leading direction and one common street type are dropped). Without a house number the text is matched as typed against stname, which holds the bare name, so '88th' finds cases and '88th St' finds none.",
35957
+ coverage: "Open LADBS code-enforcement cases only, about 29,000, opened 1995 to present. Closed cases are published in a separate dataset (rken-a55j) that this tool does not search. The street is split across columns: with a house number, '139 W 88th St' is matched as 139 on stno and '88th' on stname (one leading direction and one common street type are dropped; a street named South or North keeps its name, so '2600 South Blvd' is matched as 'South'; a lettered street keeps its letter, so '1700 E Q St' is matched as 1700 on stno and 'Q' on stname; a house number plus one stray word with no street type, such as '100 E' or '100 %', is searched as typed against stname and finds no rows). Without a house number the name alone gets the same trimming, so '88th St' is matched as '88th' on stname.",
35903
35958
  recordLabel: "Case",
35904
35959
  openedLabel: "Opened",
35905
35960
  fields: {
@@ -35981,7 +36036,7 @@ var fort_worth_default = {
35981
36036
  orderField: "File_Date",
35982
36037
  streetNumberType: "number",
35983
36038
  latestRecordDate: "2026-10-13",
35984
- coverage: "Fort Worth development permits, about 1.6 million records filed 2001 to present. Trade permits (electrical, mechanical, plumbing, backflow) are included alongside building permits. The street is split across columns: with a house number, '8653 Funtier Ct' is matched as 8653 on Addr_No and 'Funtier' on Street_Name (one leading direction and one common street type are dropped). Without a house number the text is matched as typed against Street_Name, which holds the bare name, so 'Funtier' finds permits and 'Funtier Ct' finds none.",
36039
+ coverage: "Fort Worth development permits, about 1.6 million records filed 2001 to present. Trade permits (electrical, mechanical, plumbing, backflow) are included alongside building permits. The street is split across columns: with a house number, '8653 Funtier Ct' is matched as 8653 on Addr_No and 'Funtier' on Street_Name (one leading direction and one common street type are dropped; a street named South or North keeps its name, so '2600 South Blvd' is matched as 'South'; a lettered street keeps its letter, so '1700 E Q St' is matched as 1700 on Addr_No and 'Q' on Street_Name; a house number plus one stray word with no street type, such as '100 E' or '100 %', is searched as typed against Street_Name and finds no rows). Without a house number the name alone gets the same trimming, so 'Funtier Ct' is matched as 'Funtier' on Street_Name.",
35985
36040
  recordLabel: "Permit",
35986
36041
  openedLabel: "Filed",
35987
36042
  fields: {
@@ -36337,13 +36392,14 @@ var orlando_default = {
36337
36392
  datasets: {
36338
36393
  violations: {
36339
36394
  kind: "violations",
36395
+ houseNumberSpaceRuns: 4,
36340
36396
  tabLabel: "Code Violations",
36341
36397
  type: "socrata",
36342
36398
  url: "https://data.cityoforlando.net/resource/k6e8-nw6w.json",
36343
36399
  orderField: "casedt",
36344
36400
  where: "case_type in ('Housing','Lot','Zoning','Abatement','Commercial')",
36345
36401
  latestRecordDate: "2026-09-23",
36346
- coverage: "Orlando code-enforcement cases of the housing, lot, zoning, abatement and commercial types, about 147,000 opened 1994 to present. Business-tax, ticket, sign and other case types in the same table are left out. Lags the calendar: on 2026-10-14 the newest case in the table was opened 2026-09-23. Search by street name alone: 140,344 of the 146,669 case addresses carry two spaces after the house number ('4274 TATUM ST'), so a typed '4274 Tatum St' finds nothing while 'Tatum' finds the case.",
36402
+ coverage: "Orlando code-enforcement cases of the housing, lot, zoning, abatement and commercial types, about 147,000 opened 1994 to present. Business-tax, ticket, sign and other case types in the same table are left out. Lags the calendar: on 2026-10-14 the newest case in the table was opened 2026-09-23. 99,433 of the 146,669 case addresses carry two spaces after the house number ('4274 TATUM ST'); the search matches that gap as a run of one to four spaces, or the spacing as typed, and nothing else, so '4274 Tatum St' finds the case.",
36347
36403
  recordLabel: "Case",
36348
36404
  openedLabel: "Opened",
36349
36405
  closedLabel: "Resolved",
@@ -36358,13 +36414,14 @@ var orlando_default = {
36358
36414
  },
36359
36415
  permits: {
36360
36416
  kind: "permits",
36417
+ houseNumberSpaceRuns: 4,
36361
36418
  tabLabel: "Building Permits",
36362
36419
  type: "socrata",
36363
36420
  url: "https://data.cityoforlando.net/resource/ryhf-m453.json",
36364
36421
  orderField: "processed_date",
36365
36422
  where: "processed_date IS NOT NULL",
36366
36423
  latestRecordDate: "2026-09-23",
36367
- coverage: "Orlando permit applications of every type (building, electrical, plumbing, mechanical, engineering, fire and more), about 1.1 million on record. Lags the calendar: on 2026-10-14 the newest application in the table was processed 2026-09-23. About 5% of permit addresses (56,393 of 1,105,323) carry two spaces after the house number and are found only by street name, so if a full address finds nothing, search the street name alone.",
36424
+ coverage: "Orlando permit applications of every type (building, electrical, plumbing, mechanical, engineering, fire and more), about 1.1 million on record. Lags the calendar: on 2026-10-14 the newest application in the table was processed 2026-09-23. About 5% of permit addresses (55,657 of 1,105,323) carry two or three spaces after the house number; the search matches that gap as a run of one to four spaces, or the spacing as typed, and nothing else, so a typed full address finds them.",
36368
36425
  recordLabel: "Permit",
36369
36426
  openedLabel: "Processed",
36370
36427
  closedLabel: "Finaled",
@@ -36385,7 +36442,7 @@ var orlando_default = {
36385
36442
  url: "https://data.cityoforlando.net/",
36386
36443
  license: "Public record (City of Orlando)",
36387
36444
  portalLabel: "Orlando Open Data (Socrata)",
36388
- currentRecordsNote: `Code-enforcement cases and permit applications are both published on the City of Orlando's open-data portal. On 2026-10-14 the newest record in both tables was dated 2026-09-23, although the portal reported a same-day refresh. Most code-case addresses carry two spaces after the house number ("4274 TATUM ST"), so search code cases by street name alone ("Tatum").`
36445
+ currentRecordsNote: `Code-enforcement cases and permit applications are both published on the City of Orlando's open-data portal. On 2026-10-14 the newest record in both tables was dated 2026-09-23, although the portal reported a same-day refresh. Most code-case addresses carry two spaces after the house number ("4274 TATUM ST"); the search matches that gap as a run of one to four spaces, or the spacing as typed, and nothing else, so a full address ("4274 Tatum St") finds them.`
36389
36446
  }
36390
36447
  };
36391
36448
 
@@ -36477,7 +36534,7 @@ var scottsdale_default = {
36477
36534
  orderField: "DateComplaintReceived",
36478
36535
  streetNumberType: "number",
36479
36536
  latestRecordDate: "2026-10-09",
36480
- coverage: "Scottsdale code complaints received since 2021-09, about 18,900 rows. Closed complaints only: open complaints are not published, and every row's status begins with CLOSED. No result means no closed complaint on file, not that the property has no open violation. The street is split across columns: with a house number, '4201 N Hayden Rd' is matched as 4201 on StreetNumber and 'Hayden' on StreetName (one leading direction and one common street type are dropped). Without a house number the text is matched as typed against StreetName, which holds the bare name, so 'Hayden' finds complaints and 'Hayden Rd' finds none.",
36537
+ coverage: "Scottsdale code complaints received since 2021-09, about 18,900 rows. Closed complaints only: open complaints are not published, and every row's status begins with CLOSED. No result means no closed complaint on file, not that the property has no open violation. The street is split across columns: with a house number, '4201 N Hayden Rd' is matched as 4201 on StreetNumber and 'Hayden' on StreetName (one leading direction and one common street type are dropped; a street named South or North keeps its name, so '2600 South Blvd' is matched as 'South'; a lettered street keeps its letter, so '1700 E Q St' is matched as 1700 on StreetNumber and 'Q' on StreetName; a house number plus one stray word with no street type, such as '100 E' or '100 %', is searched as typed against StreetName and finds no rows). Without a house number the name alone gets the same trimming, so 'Hayden Rd' is matched as 'Hayden' on StreetName.",
36481
36538
  recordLabel: "Complaint",
36482
36539
  openedLabel: "Received",
36483
36540
  closedLabel: "Closed",
@@ -37580,6 +37637,7 @@ var orlando_default2 = {
37580
37637
  type: "socrata",
37581
37638
  url: "https://data.cityoforlando.net/resource/bhxy-4rji.json",
37582
37639
  orderField: "application_date",
37640
+ houseNumberSpaceRuns: 4,
37583
37641
  where: "application_description='Zoning' AND application_date IS NOT NULL",
37584
37642
  latestRecordDate: "2026-09-18",
37585
37643
  fields: {
@@ -37600,7 +37658,7 @@ var orlando_default2 = {
37600
37658
  url: "https://data.cityoforlando.net/",
37601
37659
  license: "Public record (City of Orlando)",
37602
37660
  portalLabel: "Orlando Open Data (Socrata)",
37603
- currentRecordsNote: "Zoning cases come from the city's Planning Applications dataset, scoped to the Zoning application type (about 450 cases since 2002; the same table also holds annexations, variances and master plans). Existing and proposed zoning appear only inside each case's comments, not as columns, and the status is Open or Closed without saying approved or denied. About half the case addresses carry two spaces after the house number, so a street name alone finds more than a full address.",
37661
+ currentRecordsNote: "Zoning cases come from the city's Planning Applications dataset, scoped to the Zoning application type (about 450 cases since 2002; the same table also holds annexations, variances and master plans). Existing and proposed zoning appear only inside each case's comments, not as columns, and the status is Open or Closed without saying approved or denied. About half the case addresses (221 of 407) carry two or three spaces after the house number; the search matches that gap as a run of one to four spaces, or the spacing as typed, and nothing else, so a full address finds them as well as a street name alone does.",
37604
37662
  datasetUrl: "https://data.cityoforlando.net/d/bhxy-4rji"
37605
37663
  }
37606
37664
  };
@@ -37704,6 +37762,26 @@ var CITY_RECORD_LIMIT = 30;
37704
37762
  function esc(s) {
37705
37763
  return s.replace(/'/g, "''");
37706
37764
  }
37765
+ var HOUSE_GAP_LIMIT = 8;
37766
+ var LIKE_GROUP_BUDGET = 3e3;
37767
+ var HOUSE_AND_GAP = /^(\s*(?:\d[A-Za-z0-9]*|\d+-[A-Za-z0-9]+))\s+(?=\S)/;
37768
+ function likeAlternatives(s, maxRun = 0) {
37769
+ const typed = esc(s);
37770
+ const runs = Math.min(Math.floor(maxRun), HOUSE_GAP_LIMIT);
37771
+ if (!(runs >= 1)) return [typed];
37772
+ const m = HOUSE_AND_GAP.exec(s);
37773
+ if (!m || ORDINAL_STREET.test(m[1].trim())) return [typed];
37774
+ const house = esc(m[1]);
37775
+ const rest = esc(s.slice(m[0].length));
37776
+ const out = Array.from({ length: runs }, (_, i) => `${house}${" ".repeat(i + 1)}${rest}`);
37777
+ return out.includes(typed) ? out : [...out, typed];
37778
+ }
37779
+ function likeAny(street, one, maxRun) {
37780
+ const parts = likeAlternatives(street, maxRun).map(one);
37781
+ if (parts.length < 2) return parts[0];
37782
+ const group = `(${parts.join(" OR ")})`;
37783
+ return encodeURIComponent(group).length > LIKE_GROUP_BUDGET ? one(esc(street)) : group;
37784
+ }
37707
37785
  function sqlId(id) {
37708
37786
  return `"${id.replace(/"/g, '""')}"`;
37709
37787
  }
@@ -37725,6 +37803,7 @@ var DIRECTIONALS = /* @__PURE__ */ new Set([
37725
37803
  "SOUTHEAST",
37726
37804
  "SOUTHWEST"
37727
37805
  ]);
37806
+ var FULL_DIRECTIONS = /* @__PURE__ */ new Set(["NORTH", "SOUTH", "EAST", "WEST"]);
37728
37807
  var STREET_SUFFIXES = /* @__PURE__ */ new Set([
37729
37808
  "ST",
37730
37809
  "STREET",
@@ -37775,21 +37854,75 @@ var STREET_SUFFIXES = /* @__PURE__ */ new Set([
37775
37854
  "FWY",
37776
37855
  "FREEWAY"
37777
37856
  ]);
37857
+ var ORDINAL_STREET = /^\d+(?:ST|ND|RD|TH)$/i;
37778
37858
  function splitStreet(street) {
37779
- const m = /^\s*(\d+)(?:-?[A-Za-z0-9]+)?\s+(.+)$/.exec(street);
37780
- if (!m) return null;
37781
- let tokens = m[2].trim().split(/\s+/).filter(Boolean);
37859
+ const m = /^\s*(\d+)(?!\d)(?:-[A-Za-z0-9]+|[A-Za-z0-9]+)?/.exec(street);
37860
+ if (!m || !/\s/.test(street.charAt(m[0].length)) || ORDINAL_STREET.test(street.trim().split(/\s+/)[0])) return null;
37861
+ let at = m[0].length;
37862
+ while (at < street.length && /\s/.test(street.charAt(at))) at++;
37863
+ const rest = street.slice(at);
37864
+ if (!rest || /[\n\r\u2028\u2029]/.test(rest)) return null;
37865
+ const name = bareName(rest.trim().split(/\s+/).filter(Boolean));
37866
+ if (!name) return null;
37867
+ return { number: m[1], name };
37868
+ }
37869
+ function bareName(tokens) {
37782
37870
  if (tokens.length > 1 && DIRECTIONALS.has(tokens[0].toUpperCase())) tokens = tokens.slice(1);
37783
37871
  if (tokens.length > 1 && STREET_SUFFIXES.has(tokens[tokens.length - 1].replace(/\.$/, "").toUpperCase())) {
37784
37872
  tokens = tokens.slice(0, -1);
37785
37873
  }
37786
- const name = tokens.join(" ").trim();
37787
- if (!name) return null;
37788
- return { number: m[1], name };
37874
+ return tokens.join(" ").trim();
37875
+ }
37876
+ var NUMBERED_PARTS = ["number", "direction", "name", "type"];
37877
+ var DIRECTION_LETTERS = /* @__PURE__ */ new Set(["N", "S", "E", "W"]);
37878
+ var PLAIN_STREET_TYPES = /* @__PURE__ */ new Set(["ST", "STREET", "AVE", "AVENUE"]);
37879
+ function letteredStreet(street) {
37880
+ if (!splitStreet(street)) return null;
37881
+ const rest = street.trim().split(/\s+/).slice(1);
37882
+ if (rest.length < 2 || rest.length > 3) return null;
37883
+ if (!STREET_SUFFIXES.has(rest[rest.length - 1].replace(/\.$/, "").toUpperCase())) return null;
37884
+ if (rest.length === 3 && !DIRECTIONALS.has(rest[0].toUpperCase())) return null;
37885
+ const one = rest[rest.length - 2];
37886
+ if (!/^[\p{L}\p{N}]$/u.test(one)) return null;
37887
+ if (rest.length === 2 && DIRECTION_LETTERS.has(one.toUpperCase()) && !PLAIN_STREET_TYPES.has(rest[1].replace(/\.$/, "").toUpperCase())) return null;
37888
+ return one;
37789
37889
  }
37790
37890
  function splitFor(ds, street) {
37791
37891
  if (!ds.fields.streetNumber) return null;
37792
- return splitStreet(street);
37892
+ const s = splitStreet(street);
37893
+ if (!s) return null;
37894
+ const letter = letteredStreet(street);
37895
+ if (letter) return { number: s.number, name: letter };
37896
+ const name = splitAddressStreetName(ds.fields.addressParts ?? NUMBERED_PARTS, ds.fields.addressParts ? ds.fields.address : "name", void 0, street);
37897
+ if (name === street) return null;
37898
+ const words = name.split(" ");
37899
+ if (words.length === 2 && DIRECTIONALS.has(words[0].toUpperCase())) {
37900
+ const type = words[1].replace(/\.$/, "");
37901
+ if (STREET_SUFFIXES.has(type.toUpperCase()) && !PLAIN_STREET_TYPES.has(type.toUpperCase())) return { number: s.number, name: type };
37902
+ }
37903
+ return { number: s.number, name };
37904
+ }
37905
+ function plainNeedle(ds, street) {
37906
+ if (!ds.fields.streetNumber) return street;
37907
+ if (splitStreet(street)) return street;
37908
+ const tokens = street.trim().split(/\s+/).filter(Boolean);
37909
+ const name = bareName(tokens);
37910
+ if (!name || name.split(" ").length >= tokens.length) return street;
37911
+ if (typeWordExposed(tokens, name) && FULL_DIRECTIONS.has(tokens[0].toUpperCase()) && STREET_SUFFIXES.has(name.replace(/\.$/, "").toUpperCase())) {
37912
+ return tokens[0];
37913
+ }
37914
+ if (name.length < 2 || typeWordExposed(tokens, name) || !/[\p{L}\p{N}]/u.test(name)) return street;
37915
+ return name;
37916
+ }
37917
+ function isDirectionOrType(name) {
37918
+ const u = name.replace(/\.$/, "").toUpperCase();
37919
+ return DIRECTIONALS.has(u) || STREET_SUFFIXES.has(u);
37920
+ }
37921
+ function typeWordExposed(tokens, name) {
37922
+ if (tokens.length < 2 || !DIRECTIONALS.has(tokens[0].toUpperCase())) return false;
37923
+ const rest = tokens.slice(1);
37924
+ const typeCameOff = rest.length > 1 && STREET_SUFFIXES.has(rest[rest.length - 1].replace(/\.$/, "").toUpperCase());
37925
+ return !typeCameOff && isDirectionOrType(name);
37793
37926
  }
37794
37927
  function splitAddressStreetName(parts, nameColumn, numberColumn, street) {
37795
37928
  if (!parts || !nameColumn || numberColumn) return street;
@@ -37798,12 +37931,28 @@ function splitAddressStreetName(parts, nameColumn, numberColumn, street) {
37798
37931
  const before = at;
37799
37932
  const after = parts.length - 1 - at;
37800
37933
  let tokens = street.trim().split(/\s+/).filter(Boolean);
37801
- if (before >= 1 && tokens.length > 1 && /^\d+(?:-?[A-Za-z0-9]+)?$/.test(tokens[0])) tokens = tokens.slice(1);
37802
- if (before >= 2 && tokens.length > 1 && DIRECTIONALS.has(tokens[0].toUpperCase())) tokens = tokens.slice(1);
37934
+ const typedTokens = tokens.length;
37935
+ let dirOff = false;
37936
+ let typeOff = false;
37937
+ if (before >= 1 && tokens.length > 1 && /^\d+(?!\d)(?:-[A-Za-z0-9]+|[A-Za-z0-9]+)?$/.test(tokens[0]) && !ORDINAL_STREET.test(tokens[0])) {
37938
+ tokens = tokens.slice(1);
37939
+ }
37940
+ const afterNumber = tokens;
37941
+ if (before >= 2 && tokens.length > 1 && DIRECTIONALS.has(tokens[0].toUpperCase())) {
37942
+ tokens = tokens.slice(1);
37943
+ dirOff = true;
37944
+ }
37803
37945
  if (after >= 1 && tokens.length > 1 && STREET_SUFFIXES.has(tokens[tokens.length - 1].replace(/\.$/, "").toUpperCase())) {
37804
37946
  tokens = tokens.slice(0, -1);
37947
+ typeOff = true;
37805
37948
  }
37806
37949
  const name = tokens.join(" ");
37950
+ if (dirOff && !typeOff && after >= 1 && FULL_DIRECTIONS.has(afterNumber[0].toUpperCase()) && STREET_SUFFIXES.has(name.replace(/\.$/, "").toUpperCase())) {
37951
+ return afterNumber[0];
37952
+ }
37953
+ if (tokens.length < typedTokens && (name.length < 2 || !typeOff && isDirectionOrType(name) || !/[\p{L}\p{N}]/u.test(name))) {
37954
+ return afterNumber.length < typedTokens && afterNumber.join(" ") !== name ? afterNumber.join(" ") : street;
37955
+ }
37807
37956
  return name || street;
37808
37957
  }
37809
37958
  function unmappedNumberColumn(parts, nameColumn, numberColumn) {
@@ -37816,6 +37965,7 @@ function numberLiteral(ds, n) {
37816
37965
  function propertyQueryUrl(ds, street) {
37817
37966
  const address = street;
37818
37967
  const split = address ? splitFor(ds, address) : null;
37968
+ const needle = address ? plainNeedle(ds, address) : "";
37819
37969
  if (ds.type === "socrata") {
37820
37970
  const parts = [];
37821
37971
  const clauses = [];
@@ -37824,7 +37974,7 @@ function propertyQueryUrl(ds, street) {
37824
37974
  `upper(${ds.fields.address}) like upper('%${esc(split.name)}%') AND ${ds.fields.streetNumber} = ${numberLiteral(ds, split.number)}`
37825
37975
  );
37826
37976
  } else if (address) {
37827
- clauses.push(`upper(${ds.fields.address}) like upper('%${esc(address)}%')`);
37977
+ clauses.push(likeAny(needle, (b) => `upper(${ds.fields.address}) like upper('%${b}%')`, ds.houseNumberSpaceRuns));
37828
37978
  }
37829
37979
  if (ds.where) clauses.push(`(${ds.where})`);
37830
37980
  if (clauses.length) parts.push(`$where=${encodeURIComponent(clauses.join(" AND "))}`);
@@ -37839,7 +37989,7 @@ function propertyQueryUrl(ds, street) {
37839
37989
  `${sqlId(ds.fields.address)} ILIKE '%${esc(split.name)}%' AND ${sqlId(ds.fields.streetNumber)} = ${numberLiteral(ds, split.number)}`
37840
37990
  );
37841
37991
  } else if (address) {
37842
- clauses.push(`${sqlId(ds.fields.address)} ILIKE '%${esc(address)}%'`);
37992
+ clauses.push(likeAny(needle, (b) => `${sqlId(ds.fields.address)} ILIKE '%${b}%'`, ds.houseNumberSpaceRuns));
37843
37993
  }
37844
37994
  if (ds.where) clauses.push(`(${ds.where})`);
37845
37995
  const whereSql = clauses.length ? clauses.join(" AND ") : "1=1";
@@ -37855,7 +38005,7 @@ function propertyQueryUrl(ds, street) {
37855
38005
  `${sqlId(ds.fields.address)} ILIKE '%${esc(split.name)}%' AND ${sqlId(ds.fields.streetNumber)} = ${numberLiteral(ds, split.number)}`
37856
38006
  );
37857
38007
  } else if (address) {
37858
- clauses.push(`${sqlId(ds.fields.address)} ILIKE '%${esc(address)}%'`);
38008
+ clauses.push(likeAny(needle, (b) => `${sqlId(ds.fields.address)} ILIKE '%${b}%'`, ds.houseNumberSpaceRuns));
37859
38009
  }
37860
38010
  if (ds.where) clauses.push(`(${ds.where})`);
37861
38011
  const whereSql = clauses.length ? clauses.join(" AND ") : "1=1";
@@ -37870,7 +38020,7 @@ function propertyQueryUrl(ds, street) {
37870
38020
  `UPPER(${ds.fields.address}) LIKE UPPER('%${esc(split.name)}%') AND ${ds.fields.streetNumber} = ${numberLiteral(ds, split.number)}`
37871
38021
  );
37872
38022
  } else if (address) {
37873
- arcClauses.push(`UPPER(${ds.fields.address}) LIKE UPPER('%${esc(address)}%')`);
38023
+ arcClauses.push(likeAny(needle, (b) => `UPPER(${ds.fields.address}) LIKE UPPER('%${b}%')`, ds.houseNumberSpaceRuns));
37874
38024
  }
37875
38025
  if (ds.where) arcClauses.push(`(${ds.where})`);
37876
38026
  const where = arcClauses.length ? arcClauses.join(" AND ") : "1=1";
@@ -37903,7 +38053,7 @@ function casesQueryUrl(src, street, statuses = []) {
37903
38053
  if (lookup !== "address" && street) return null;
37904
38054
  if (src.type === "socrata") {
37905
38055
  const clauses2 = [];
37906
- if (street) clauses2.push(`upper(${src.fields.address}) like upper('%${esc(street)}%')`);
38056
+ if (street) clauses2.push(likeAny(street, (b) => `upper(${src.fields.address}) like upper('%${b}%')`, src.houseNumberSpaceRuns));
37907
38057
  const st2 = statusClause(src, statuses, false);
37908
38058
  if (st2) clauses2.push(st2);
37909
38059
  if (src.where) clauses2.push(`(${src.where})`);
@@ -37914,7 +38064,7 @@ function casesQueryUrl(src, street, statuses = []) {
37914
38064
  return `${src.url}?${parts2.join("&")}`;
37915
38065
  }
37916
38066
  const clauses = [];
37917
- if (street) clauses.push(`UPPER(${src.fields.address}) LIKE UPPER('%${esc(street)}%')`);
38067
+ if (street) clauses.push(likeAny(street, (b) => `UPPER(${src.fields.address}) LIKE UPPER('%${b}%')`, src.houseNumberSpaceRuns));
37918
38068
  const st = statusClause(src, statuses, true);
37919
38069
  if (st) clauses.push(st);
37920
38070
  if (src.where) clauses.push(`(${src.where})`);
@@ -38045,12 +38195,17 @@ function cityPath(slug, kind) {
38045
38195
  }
38046
38196
  var SOCRATA_NOTE = " Socrata throttles anonymous callers: for volume, send an X-App-Token header with your own app token.";
38047
38197
  var WILDCARD_NOTE = "LIKE wildcards in the street stay active, as on the site: '%' matches any run of characters and '_' exactly one.";
38198
+ function spacesNote(runs) {
38199
+ const n = Math.min(Math.floor(runs ?? 0), HOUSE_GAP_LIMIT);
38200
+ if (!(n >= 1)) return "";
38201
+ return ` The space after a leading house number also matches a run of up to ${n} spaces, or the spacing as typed, and nothing else, as in Orlando's '4274 TATUM ST' ('4274 Tatum St' does not find '4274 OLD TATUM ST'). As before, the number is not anchored on its left: '12 Main' also finds '3312 MAIN'.`;
38202
+ }
38048
38203
  function propertyNote(ds) {
38049
38204
  const parts = [];
38050
38205
  const numberColumn = unmappedNumberColumn(ds.fields.addressParts, ds.fields.address, ds.fields.streetNumber);
38051
38206
  if (ds.fields.streetNumber) {
38052
38207
  parts.push(
38053
- `The street is split: type 'number name' ('1422 N Western Ave') and the number is matched on ${ds.fields.streetNumber} while the name is matched on ${ds.fields.address}; a street name alone falls back to a substring match on ${ds.fields.address}.`
38208
+ `The street is split: type 'number name' ('1422 N Western Ave') and the number is matched on ${ds.fields.streetNumber} while the name is matched on ${ds.fields.address}; a street name alone is matched on ${ds.fields.address} too, with the same trimming (a leading direction and a trailing street type come off: 'N Western Ave' matches 'Western').${spacesNote(ds.houseNumberSpaceRuns)}`
38054
38209
  );
38055
38210
  } else if (numberColumn) {
38056
38211
  parts.push(
@@ -38058,7 +38213,7 @@ function propertyNote(ds) {
38058
38213
  );
38059
38214
  } else {
38060
38215
  parts.push(
38061
- `Case-insensitive substring match on ${ds.fields.address}: a street name alone ('Commerce') returns the most, and a number plus name matches only rows whose ${ds.fields.address} contains that exact text.`
38216
+ `Case-insensitive substring match on ${ds.fields.address}: a street name alone ('Commerce') returns the most, and a number plus name matches only rows whose ${ds.fields.address} contains that exact text.${spacesNote(ds.houseNumberSpaceRuns)}`
38062
38217
  );
38063
38218
  }
38064
38219
  parts.push(WILDCARD_NOTE);
@@ -38081,7 +38236,7 @@ function casesNote(src) {
38081
38236
  } else {
38082
38237
  const numberColumn = unmappedNumberColumn(src.fields.addressParts, src.fields.address, void 0);
38083
38238
  parts.push(
38084
- numberColumn ? `Case-insensitive substring match on ${src.fields.address}, which holds the street name (the house number is in ${numberColumn}): the query matches the street name on ${src.fields.address} and returns every row on that street; filter by house number in the results.` : `Case-insensitive substring match on ${src.fields.address}: a street name alone returns the most.`
38239
+ numberColumn ? `Case-insensitive substring match on ${src.fields.address}, which holds the street name (the house number is in ${numberColumn}): the query matches the street name on ${src.fields.address} and returns every row on that street; filter by house number in the results.` : `Case-insensitive substring match on ${src.fields.address}: a street name alone returns the most.${spacesNote(src.houseNumberSpaceRuns)}`
38085
38240
  );
38086
38241
  parts.push(`Filter by status with ${src.fields.status ?? "the status column"} in (...) using the status_buckets values.`);
38087
38242
  parts.push(WILDCARD_NOTE);
package/dist/index.d.cts CHANGED
@@ -413,8 +413,10 @@ interface PropertyFieldMap {
413
413
  addressParts?: string[];
414
414
  /**
415
415
  * Column holding the street NUMBER on its own. When set, a typed "number
416
- * name" street is matched as `address LIKE %name% AND streetNumber = number`;
417
- * unset, the search is the plain substring match.
416
+ * name" street is matched as `address LIKE %name% AND streetNumber = number`,
417
+ * and a name typed without a number is matched on the name alone, with the
418
+ * same leading-direction and trailing-type trimming; unset, the search is the
419
+ * plain substring match.
418
420
  */
419
421
  streetNumber?: string;
420
422
  recordNumber?: string;
@@ -450,6 +452,12 @@ interface PropertyDataset {
450
452
  where?: string;
451
453
  /** How the streetNumber column is typed at the source. Default "text". */
452
454
  streetNumberType?: "text" | "number";
455
+ /**
456
+ * Set only on a table measured to store a run of spaces after the house number
457
+ * (Orlando): the longest run to try, 1 to 8. The address search then ORs the typed
458
+ * text with 1..N spaces in that gap; unset, it matches the typed spacing exactly.
459
+ */
460
+ houseNumberSpaceRuns?: number;
453
461
  /** The newest value of the date column seen at the last verification (YYYY-MM-DD). */
454
462
  latestRecordDate?: string;
455
463
  /** One sober line stating the time span the dataset actually covers. */
@@ -544,6 +552,8 @@ interface CasesSource {
544
552
  * resolve the address to a parcel id, join through a crosswalk dataset.
545
553
  */
546
554
  lookup?: "address" | "location" | "parcel";
555
+ /** As on PropertyDataset: the longest run of spaces after the house number to try, set only where measured. */
556
+ houseNumberSpaceRuns?: number;
547
557
  geocoder?: GeocoderConfig;
548
558
  resolver?: {
549
559
  provider: "nyc-geosearch";
@@ -643,7 +653,8 @@ interface SplitStreet {
643
653
  * "1422 N Western Ave" -> { number: "1422", name: "Western" }. Null when the
644
654
  * typed street carries no leading house number, which makes the caller fall
645
655
  * back to the plain substring match. A unit glued to the number ("1422A",
646
- * "1422-B") is dropped; the name keeps at least one token.
656
+ * "1422-B") is dropped; the name keeps at least one token. A first token that
657
+ * is an ordinal street name ("88th St", "3rd Ave") is no house number.
647
658
  */
648
659
  declare function splitStreet(street: string): SplitStreet | null;
649
660
  /**
@@ -665,7 +676,16 @@ declare function splitStreet(street: string): SplitStreet | null;
665
676
  * unit or range stays with it: "1422A", "1252-1270"), then one leading
666
677
  * directional (N S E W NE NW SE SW, or the full words), then one trailing
667
678
  * street type (optional period). The name keeps at least one token, so a lone
668
- * number or a lone type is sent as typed. Unchanged when the parts give no
679
+ * number or a lone type is sent as typed. A strip that leaves a lone letter, no
680
+ * letter or digit, or a lone direction or type word with no real type after it
681
+ * ('N St' would become 'St', '100 St' too) is not applied. When a real strip
682
+ * came off, the typed tokens go without the house number (the name column owns
683
+ * none): '100 N St' sends 'N St'. When only the number did, the street goes as
684
+ * typed: '100 %' and '100 E' stay as they are, never '%' or 'E'. A type word with
685
+ * a real type after it is a name: '100 Court St' sends 'Court'. A spelled-out
686
+ * direction with a type on a table with a type column ('2600 South Blvd',
687
+ * '100 North Ave') is the street South or North and sends 'South' or 'North'.
688
+ * Unchanged when the parts give no
669
689
  * role: no parts, the name column not among them, or a mapped number column
670
690
  * (then the split clause in propertyQueryUrl owns the number).
671
691
  */
@@ -676,7 +696,7 @@ declare function splitAddressStreetName(parts: readonly string[] | undefined, na
676
696
  * preserving extraction of PropertyReportTabs.fetchDataset: the four provider
677
697
  * branches below are its four branches, and PropertyReportTabs.test.tsx pins
678
698
  * the URLs. The split-address clause only engages when the dataset maps a
679
- * streetNumber column AND the street parses to number + name.
699
+ * streetNumber column AND the street parses to number + a name worth matching.
680
700
  */
681
701
  declare function propertyQueryUrl(ds: PropertyDataset, street: string): string;
682
702
  /**
package/dist/index.d.ts CHANGED
@@ -413,8 +413,10 @@ interface PropertyFieldMap {
413
413
  addressParts?: string[];
414
414
  /**
415
415
  * Column holding the street NUMBER on its own. When set, a typed "number
416
- * name" street is matched as `address LIKE %name% AND streetNumber = number`;
417
- * unset, the search is the plain substring match.
416
+ * name" street is matched as `address LIKE %name% AND streetNumber = number`,
417
+ * and a name typed without a number is matched on the name alone, with the
418
+ * same leading-direction and trailing-type trimming; unset, the search is the
419
+ * plain substring match.
418
420
  */
419
421
  streetNumber?: string;
420
422
  recordNumber?: string;
@@ -450,6 +452,12 @@ interface PropertyDataset {
450
452
  where?: string;
451
453
  /** How the streetNumber column is typed at the source. Default "text". */
452
454
  streetNumberType?: "text" | "number";
455
+ /**
456
+ * Set only on a table measured to store a run of spaces after the house number
457
+ * (Orlando): the longest run to try, 1 to 8. The address search then ORs the typed
458
+ * text with 1..N spaces in that gap; unset, it matches the typed spacing exactly.
459
+ */
460
+ houseNumberSpaceRuns?: number;
453
461
  /** The newest value of the date column seen at the last verification (YYYY-MM-DD). */
454
462
  latestRecordDate?: string;
455
463
  /** One sober line stating the time span the dataset actually covers. */
@@ -544,6 +552,8 @@ interface CasesSource {
544
552
  * resolve the address to a parcel id, join through a crosswalk dataset.
545
553
  */
546
554
  lookup?: "address" | "location" | "parcel";
555
+ /** As on PropertyDataset: the longest run of spaces after the house number to try, set only where measured. */
556
+ houseNumberSpaceRuns?: number;
547
557
  geocoder?: GeocoderConfig;
548
558
  resolver?: {
549
559
  provider: "nyc-geosearch";
@@ -643,7 +653,8 @@ interface SplitStreet {
643
653
  * "1422 N Western Ave" -> { number: "1422", name: "Western" }. Null when the
644
654
  * typed street carries no leading house number, which makes the caller fall
645
655
  * back to the plain substring match. A unit glued to the number ("1422A",
646
- * "1422-B") is dropped; the name keeps at least one token.
656
+ * "1422-B") is dropped; the name keeps at least one token. A first token that
657
+ * is an ordinal street name ("88th St", "3rd Ave") is no house number.
647
658
  */
648
659
  declare function splitStreet(street: string): SplitStreet | null;
649
660
  /**
@@ -665,7 +676,16 @@ declare function splitStreet(street: string): SplitStreet | null;
665
676
  * unit or range stays with it: "1422A", "1252-1270"), then one leading
666
677
  * directional (N S E W NE NW SE SW, or the full words), then one trailing
667
678
  * street type (optional period). The name keeps at least one token, so a lone
668
- * number or a lone type is sent as typed. Unchanged when the parts give no
679
+ * number or a lone type is sent as typed. A strip that leaves a lone letter, no
680
+ * letter or digit, or a lone direction or type word with no real type after it
681
+ * ('N St' would become 'St', '100 St' too) is not applied. When a real strip
682
+ * came off, the typed tokens go without the house number (the name column owns
683
+ * none): '100 N St' sends 'N St'. When only the number did, the street goes as
684
+ * typed: '100 %' and '100 E' stay as they are, never '%' or 'E'. A type word with
685
+ * a real type after it is a name: '100 Court St' sends 'Court'. A spelled-out
686
+ * direction with a type on a table with a type column ('2600 South Blvd',
687
+ * '100 North Ave') is the street South or North and sends 'South' or 'North'.
688
+ * Unchanged when the parts give no
669
689
  * role: no parts, the name column not among them, or a mapped number column
670
690
  * (then the split clause in propertyQueryUrl owns the number).
671
691
  */
@@ -676,7 +696,7 @@ declare function splitAddressStreetName(parts: readonly string[] | undefined, na
676
696
  * preserving extraction of PropertyReportTabs.fetchDataset: the four provider
677
697
  * branches below are its four branches, and PropertyReportTabs.test.tsx pins
678
698
  * the URLs. The split-address clause only engages when the dataset maps a
679
- * streetNumber column AND the street parses to number + name.
699
+ * streetNumber column AND the street parses to number + a name worth matching.
680
700
  */
681
701
  declare function propertyQueryUrl(ds: PropertyDataset, street: string): string;
682
702
  /**