@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/README.md +15 -5
- package/data/city-property/fort-worth.json +1 -1
- package/data/city-property/los-angeles.json +1 -1
- package/data/city-property/orlando.json +5 -3
- package/data/city-property/scottsdale.json +1 -1
- package/data/city-zoning/orlando.json +2 -1
- package/data/index.json +5 -5
- package/data/tennessee.json +56 -1
- package/dist/index.cjs +186 -31
- package/dist/index.d.cts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.js +186 -31
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -26,9 +26,9 @@ var data_default = {
|
|
|
26
26
|
lastUpdated: "2026-10-14",
|
|
27
27
|
totals: {
|
|
28
28
|
states: 51,
|
|
29
|
-
counties:
|
|
30
|
-
endpoints:
|
|
31
|
-
countiesWithEndpoint:
|
|
29
|
+
counties: 395,
|
|
30
|
+
endpoints: 413,
|
|
31
|
+
countiesWithEndpoint: 386,
|
|
32
32
|
countiesUnprobeable: 1
|
|
33
33
|
},
|
|
34
34
|
states: [
|
|
@@ -372,8 +372,8 @@ var data_default = {
|
|
|
372
372
|
slug: "tennessee",
|
|
373
373
|
name: "Tennessee",
|
|
374
374
|
abbrev: "TN",
|
|
375
|
-
countyCount:
|
|
376
|
-
endpointCount:
|
|
375
|
+
countyCount: 5,
|
|
376
|
+
endpointCount: 5,
|
|
377
377
|
populated: true
|
|
378
378
|
},
|
|
379
379
|
{
|
|
@@ -31384,7 +31384,7 @@ var tennessee_default = {
|
|
|
31384
31384
|
stateSlug: "tennessee",
|
|
31385
31385
|
stateName: "Tennessee",
|
|
31386
31386
|
stateAbbrev: "TN",
|
|
31387
|
-
lastUpdated: "2026-10-
|
|
31387
|
+
lastUpdated: "2026-10-14",
|
|
31388
31388
|
counties: [
|
|
31389
31389
|
{
|
|
31390
31390
|
id: "tn-davidson",
|
|
@@ -31617,6 +31617,61 @@ var tennessee_default = {
|
|
|
31617
31617
|
email: null
|
|
31618
31618
|
},
|
|
31619
31619
|
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).`
|
|
31620
|
+
},
|
|
31621
|
+
{
|
|
31622
|
+
id: "tn-montgomery",
|
|
31623
|
+
state: "TN",
|
|
31624
|
+
stateName: "Tennessee",
|
|
31625
|
+
stateSlug: "tennessee",
|
|
31626
|
+
county: "Montgomery",
|
|
31627
|
+
countySlug: "montgomery-county",
|
|
31628
|
+
countyFips: "47125",
|
|
31629
|
+
hasPublicRest: true,
|
|
31630
|
+
endpoints: [
|
|
31631
|
+
{
|
|
31632
|
+
url: "https://gis.montgomerytn.gov/gisserver/rest/services/PublicParcels/MapServer/0",
|
|
31633
|
+
serviceType: "MapServer",
|
|
31634
|
+
layerIndex: 0,
|
|
31635
|
+
layerName: "PublicParcels",
|
|
31636
|
+
supportsQuery: true,
|
|
31637
|
+
corsEnabled: true,
|
|
31638
|
+
searchFields: [
|
|
31639
|
+
{
|
|
31640
|
+
name: "ParcelNo",
|
|
31641
|
+
label: "Parcel Number (e.g. 066E A 00600 000)",
|
|
31642
|
+
searchable: true
|
|
31643
|
+
},
|
|
31644
|
+
{
|
|
31645
|
+
name: "GISLINK",
|
|
31646
|
+
label: "GIS Link (Parcel ID, e.g. 063066E A 00600)",
|
|
31647
|
+
searchable: true
|
|
31648
|
+
},
|
|
31649
|
+
{
|
|
31650
|
+
name: "PropertyAddress",
|
|
31651
|
+
label: "Situs Address",
|
|
31652
|
+
searchable: true
|
|
31653
|
+
},
|
|
31654
|
+
{
|
|
31655
|
+
name: "PropertyCity",
|
|
31656
|
+
label: "Situs City",
|
|
31657
|
+
searchable: false
|
|
31658
|
+
}
|
|
31659
|
+
],
|
|
31660
|
+
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",
|
|
31661
|
+
license: "unknown",
|
|
31662
|
+
licenseUrl: "http://montgomerytn.gov/assessor/public-parcels",
|
|
31663
|
+
status: "live",
|
|
31664
|
+
lastVerified: "2026-10-14",
|
|
31665
|
+
verifiedBy: "manual"
|
|
31666
|
+
}
|
|
31667
|
+
],
|
|
31668
|
+
contact: {
|
|
31669
|
+
department: "Montgomery County Assessor of Property",
|
|
31670
|
+
url: "http://montgomerytn.gov/assessor/gis",
|
|
31671
|
+
email: null
|
|
31672
|
+
},
|
|
31673
|
+
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.",
|
|
31674
|
+
addedAt: "2026-10-14"
|
|
31620
31675
|
}
|
|
31621
31676
|
]
|
|
31622
31677
|
};
|
|
@@ -35897,7 +35952,7 @@ var los_angeles_default = {
|
|
|
35897
35952
|
orderField: "adddttm",
|
|
35898
35953
|
streetNumberType: "text",
|
|
35899
35954
|
latestRecordDate: "2026-10-09",
|
|
35900
|
-
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
|
|
35955
|
+
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.",
|
|
35901
35956
|
recordLabel: "Case",
|
|
35902
35957
|
openedLabel: "Opened",
|
|
35903
35958
|
fields: {
|
|
@@ -35979,7 +36034,7 @@ var fort_worth_default = {
|
|
|
35979
36034
|
orderField: "File_Date",
|
|
35980
36035
|
streetNumberType: "number",
|
|
35981
36036
|
latestRecordDate: "2026-10-13",
|
|
35982
|
-
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
|
|
36037
|
+
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.",
|
|
35983
36038
|
recordLabel: "Permit",
|
|
35984
36039
|
openedLabel: "Filed",
|
|
35985
36040
|
fields: {
|
|
@@ -36335,13 +36390,14 @@ var orlando_default = {
|
|
|
36335
36390
|
datasets: {
|
|
36336
36391
|
violations: {
|
|
36337
36392
|
kind: "violations",
|
|
36393
|
+
houseNumberSpaceRuns: 4,
|
|
36338
36394
|
tabLabel: "Code Violations",
|
|
36339
36395
|
type: "socrata",
|
|
36340
36396
|
url: "https://data.cityoforlando.net/resource/k6e8-nw6w.json",
|
|
36341
36397
|
orderField: "casedt",
|
|
36342
36398
|
where: "case_type in ('Housing','Lot','Zoning','Abatement','Commercial')",
|
|
36343
36399
|
latestRecordDate: "2026-09-23",
|
|
36344
|
-
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.
|
|
36400
|
+
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.",
|
|
36345
36401
|
recordLabel: "Case",
|
|
36346
36402
|
openedLabel: "Opened",
|
|
36347
36403
|
closedLabel: "Resolved",
|
|
@@ -36356,13 +36412,14 @@ var orlando_default = {
|
|
|
36356
36412
|
},
|
|
36357
36413
|
permits: {
|
|
36358
36414
|
kind: "permits",
|
|
36415
|
+
houseNumberSpaceRuns: 4,
|
|
36359
36416
|
tabLabel: "Building Permits",
|
|
36360
36417
|
type: "socrata",
|
|
36361
36418
|
url: "https://data.cityoforlando.net/resource/ryhf-m453.json",
|
|
36362
36419
|
orderField: "processed_date",
|
|
36363
36420
|
where: "processed_date IS NOT NULL",
|
|
36364
36421
|
latestRecordDate: "2026-09-23",
|
|
36365
|
-
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 (
|
|
36422
|
+
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.",
|
|
36366
36423
|
recordLabel: "Permit",
|
|
36367
36424
|
openedLabel: "Processed",
|
|
36368
36425
|
closedLabel: "Finaled",
|
|
@@ -36383,7 +36440,7 @@ var orlando_default = {
|
|
|
36383
36440
|
url: "https://data.cityoforlando.net/",
|
|
36384
36441
|
license: "Public record (City of Orlando)",
|
|
36385
36442
|
portalLabel: "Orlando Open Data (Socrata)",
|
|
36386
|
-
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")
|
|
36443
|
+
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.`
|
|
36387
36444
|
}
|
|
36388
36445
|
};
|
|
36389
36446
|
|
|
@@ -36475,7 +36532,7 @@ var scottsdale_default = {
|
|
|
36475
36532
|
orderField: "DateComplaintReceived",
|
|
36476
36533
|
streetNumberType: "number",
|
|
36477
36534
|
latestRecordDate: "2026-10-09",
|
|
36478
|
-
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
|
|
36535
|
+
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.",
|
|
36479
36536
|
recordLabel: "Complaint",
|
|
36480
36537
|
openedLabel: "Received",
|
|
36481
36538
|
closedLabel: "Closed",
|
|
@@ -37578,6 +37635,7 @@ var orlando_default2 = {
|
|
|
37578
37635
|
type: "socrata",
|
|
37579
37636
|
url: "https://data.cityoforlando.net/resource/bhxy-4rji.json",
|
|
37580
37637
|
orderField: "application_date",
|
|
37638
|
+
houseNumberSpaceRuns: 4,
|
|
37581
37639
|
where: "application_description='Zoning' AND application_date IS NOT NULL",
|
|
37582
37640
|
latestRecordDate: "2026-09-18",
|
|
37583
37641
|
fields: {
|
|
@@ -37598,7 +37656,7 @@ var orlando_default2 = {
|
|
|
37598
37656
|
url: "https://data.cityoforlando.net/",
|
|
37599
37657
|
license: "Public record (City of Orlando)",
|
|
37600
37658
|
portalLabel: "Orlando Open Data (Socrata)",
|
|
37601
|
-
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
|
|
37659
|
+
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.",
|
|
37602
37660
|
datasetUrl: "https://data.cityoforlando.net/d/bhxy-4rji"
|
|
37603
37661
|
}
|
|
37604
37662
|
};
|
|
@@ -37702,6 +37760,26 @@ var CITY_RECORD_LIMIT = 30;
|
|
|
37702
37760
|
function esc(s) {
|
|
37703
37761
|
return s.replace(/'/g, "''");
|
|
37704
37762
|
}
|
|
37763
|
+
var HOUSE_GAP_LIMIT = 8;
|
|
37764
|
+
var LIKE_GROUP_BUDGET = 3e3;
|
|
37765
|
+
var HOUSE_AND_GAP = /^(\s*(?:\d[A-Za-z0-9]*|\d+-[A-Za-z0-9]+))\s+(?=\S)/;
|
|
37766
|
+
function likeAlternatives(s, maxRun = 0) {
|
|
37767
|
+
const typed = esc(s);
|
|
37768
|
+
const runs = Math.min(Math.floor(maxRun), HOUSE_GAP_LIMIT);
|
|
37769
|
+
if (!(runs >= 1)) return [typed];
|
|
37770
|
+
const m = HOUSE_AND_GAP.exec(s);
|
|
37771
|
+
if (!m || ORDINAL_STREET.test(m[1].trim())) return [typed];
|
|
37772
|
+
const house = esc(m[1]);
|
|
37773
|
+
const rest = esc(s.slice(m[0].length));
|
|
37774
|
+
const out = Array.from({ length: runs }, (_, i) => `${house}${" ".repeat(i + 1)}${rest}`);
|
|
37775
|
+
return out.includes(typed) ? out : [...out, typed];
|
|
37776
|
+
}
|
|
37777
|
+
function likeAny(street, one, maxRun) {
|
|
37778
|
+
const parts = likeAlternatives(street, maxRun).map(one);
|
|
37779
|
+
if (parts.length < 2) return parts[0];
|
|
37780
|
+
const group = `(${parts.join(" OR ")})`;
|
|
37781
|
+
return encodeURIComponent(group).length > LIKE_GROUP_BUDGET ? one(esc(street)) : group;
|
|
37782
|
+
}
|
|
37705
37783
|
function sqlId(id) {
|
|
37706
37784
|
return `"${id.replace(/"/g, '""')}"`;
|
|
37707
37785
|
}
|
|
@@ -37723,6 +37801,7 @@ var DIRECTIONALS = /* @__PURE__ */ new Set([
|
|
|
37723
37801
|
"SOUTHEAST",
|
|
37724
37802
|
"SOUTHWEST"
|
|
37725
37803
|
]);
|
|
37804
|
+
var FULL_DIRECTIONS = /* @__PURE__ */ new Set(["NORTH", "SOUTH", "EAST", "WEST"]);
|
|
37726
37805
|
var STREET_SUFFIXES = /* @__PURE__ */ new Set([
|
|
37727
37806
|
"ST",
|
|
37728
37807
|
"STREET",
|
|
@@ -37773,21 +37852,75 @@ var STREET_SUFFIXES = /* @__PURE__ */ new Set([
|
|
|
37773
37852
|
"FWY",
|
|
37774
37853
|
"FREEWAY"
|
|
37775
37854
|
]);
|
|
37855
|
+
var ORDINAL_STREET = /^\d+(?:ST|ND|RD|TH)$/i;
|
|
37776
37856
|
function splitStreet(street) {
|
|
37777
|
-
const m = /^\s*(\d+)(
|
|
37778
|
-
if (!m) return null;
|
|
37779
|
-
let
|
|
37857
|
+
const m = /^\s*(\d+)(?!\d)(?:-[A-Za-z0-9]+|[A-Za-z0-9]+)?/.exec(street);
|
|
37858
|
+
if (!m || !/\s/.test(street.charAt(m[0].length)) || ORDINAL_STREET.test(street.trim().split(/\s+/)[0])) return null;
|
|
37859
|
+
let at = m[0].length;
|
|
37860
|
+
while (at < street.length && /\s/.test(street.charAt(at))) at++;
|
|
37861
|
+
const rest = street.slice(at);
|
|
37862
|
+
if (!rest || /[\n\r\u2028\u2029]/.test(rest)) return null;
|
|
37863
|
+
const name = bareName(rest.trim().split(/\s+/).filter(Boolean));
|
|
37864
|
+
if (!name) return null;
|
|
37865
|
+
return { number: m[1], name };
|
|
37866
|
+
}
|
|
37867
|
+
function bareName(tokens) {
|
|
37780
37868
|
if (tokens.length > 1 && DIRECTIONALS.has(tokens[0].toUpperCase())) tokens = tokens.slice(1);
|
|
37781
37869
|
if (tokens.length > 1 && STREET_SUFFIXES.has(tokens[tokens.length - 1].replace(/\.$/, "").toUpperCase())) {
|
|
37782
37870
|
tokens = tokens.slice(0, -1);
|
|
37783
37871
|
}
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37872
|
+
return tokens.join(" ").trim();
|
|
37873
|
+
}
|
|
37874
|
+
var NUMBERED_PARTS = ["number", "direction", "name", "type"];
|
|
37875
|
+
var DIRECTION_LETTERS = /* @__PURE__ */ new Set(["N", "S", "E", "W"]);
|
|
37876
|
+
var PLAIN_STREET_TYPES = /* @__PURE__ */ new Set(["ST", "STREET", "AVE", "AVENUE"]);
|
|
37877
|
+
function letteredStreet(street) {
|
|
37878
|
+
if (!splitStreet(street)) return null;
|
|
37879
|
+
const rest = street.trim().split(/\s+/).slice(1);
|
|
37880
|
+
if (rest.length < 2 || rest.length > 3) return null;
|
|
37881
|
+
if (!STREET_SUFFIXES.has(rest[rest.length - 1].replace(/\.$/, "").toUpperCase())) return null;
|
|
37882
|
+
if (rest.length === 3 && !DIRECTIONALS.has(rest[0].toUpperCase())) return null;
|
|
37883
|
+
const one = rest[rest.length - 2];
|
|
37884
|
+
if (!/^[\p{L}\p{N}]$/u.test(one)) return null;
|
|
37885
|
+
if (rest.length === 2 && DIRECTION_LETTERS.has(one.toUpperCase()) && !PLAIN_STREET_TYPES.has(rest[1].replace(/\.$/, "").toUpperCase())) return null;
|
|
37886
|
+
return one;
|
|
37787
37887
|
}
|
|
37788
37888
|
function splitFor(ds, street) {
|
|
37789
37889
|
if (!ds.fields.streetNumber) return null;
|
|
37790
|
-
|
|
37890
|
+
const s = splitStreet(street);
|
|
37891
|
+
if (!s) return null;
|
|
37892
|
+
const letter = letteredStreet(street);
|
|
37893
|
+
if (letter) return { number: s.number, name: letter };
|
|
37894
|
+
const name = splitAddressStreetName(ds.fields.addressParts ?? NUMBERED_PARTS, ds.fields.addressParts ? ds.fields.address : "name", void 0, street);
|
|
37895
|
+
if (name === street) return null;
|
|
37896
|
+
const words = name.split(" ");
|
|
37897
|
+
if (words.length === 2 && DIRECTIONALS.has(words[0].toUpperCase())) {
|
|
37898
|
+
const type = words[1].replace(/\.$/, "");
|
|
37899
|
+
if (STREET_SUFFIXES.has(type.toUpperCase()) && !PLAIN_STREET_TYPES.has(type.toUpperCase())) return { number: s.number, name: type };
|
|
37900
|
+
}
|
|
37901
|
+
return { number: s.number, name };
|
|
37902
|
+
}
|
|
37903
|
+
function plainNeedle(ds, street) {
|
|
37904
|
+
if (!ds.fields.streetNumber) return street;
|
|
37905
|
+
if (splitStreet(street)) return street;
|
|
37906
|
+
const tokens = street.trim().split(/\s+/).filter(Boolean);
|
|
37907
|
+
const name = bareName(tokens);
|
|
37908
|
+
if (!name || name.split(" ").length >= tokens.length) return street;
|
|
37909
|
+
if (typeWordExposed(tokens, name) && FULL_DIRECTIONS.has(tokens[0].toUpperCase()) && STREET_SUFFIXES.has(name.replace(/\.$/, "").toUpperCase())) {
|
|
37910
|
+
return tokens[0];
|
|
37911
|
+
}
|
|
37912
|
+
if (name.length < 2 || typeWordExposed(tokens, name) || !/[\p{L}\p{N}]/u.test(name)) return street;
|
|
37913
|
+
return name;
|
|
37914
|
+
}
|
|
37915
|
+
function isDirectionOrType(name) {
|
|
37916
|
+
const u = name.replace(/\.$/, "").toUpperCase();
|
|
37917
|
+
return DIRECTIONALS.has(u) || STREET_SUFFIXES.has(u);
|
|
37918
|
+
}
|
|
37919
|
+
function typeWordExposed(tokens, name) {
|
|
37920
|
+
if (tokens.length < 2 || !DIRECTIONALS.has(tokens[0].toUpperCase())) return false;
|
|
37921
|
+
const rest = tokens.slice(1);
|
|
37922
|
+
const typeCameOff = rest.length > 1 && STREET_SUFFIXES.has(rest[rest.length - 1].replace(/\.$/, "").toUpperCase());
|
|
37923
|
+
return !typeCameOff && isDirectionOrType(name);
|
|
37791
37924
|
}
|
|
37792
37925
|
function splitAddressStreetName(parts, nameColumn, numberColumn, street) {
|
|
37793
37926
|
if (!parts || !nameColumn || numberColumn) return street;
|
|
@@ -37796,12 +37929,28 @@ function splitAddressStreetName(parts, nameColumn, numberColumn, street) {
|
|
|
37796
37929
|
const before = at;
|
|
37797
37930
|
const after = parts.length - 1 - at;
|
|
37798
37931
|
let tokens = street.trim().split(/\s+/).filter(Boolean);
|
|
37799
|
-
|
|
37800
|
-
|
|
37932
|
+
const typedTokens = tokens.length;
|
|
37933
|
+
let dirOff = false;
|
|
37934
|
+
let typeOff = false;
|
|
37935
|
+
if (before >= 1 && tokens.length > 1 && /^\d+(?!\d)(?:-[A-Za-z0-9]+|[A-Za-z0-9]+)?$/.test(tokens[0]) && !ORDINAL_STREET.test(tokens[0])) {
|
|
37936
|
+
tokens = tokens.slice(1);
|
|
37937
|
+
}
|
|
37938
|
+
const afterNumber = tokens;
|
|
37939
|
+
if (before >= 2 && tokens.length > 1 && DIRECTIONALS.has(tokens[0].toUpperCase())) {
|
|
37940
|
+
tokens = tokens.slice(1);
|
|
37941
|
+
dirOff = true;
|
|
37942
|
+
}
|
|
37801
37943
|
if (after >= 1 && tokens.length > 1 && STREET_SUFFIXES.has(tokens[tokens.length - 1].replace(/\.$/, "").toUpperCase())) {
|
|
37802
37944
|
tokens = tokens.slice(0, -1);
|
|
37945
|
+
typeOff = true;
|
|
37803
37946
|
}
|
|
37804
37947
|
const name = tokens.join(" ");
|
|
37948
|
+
if (dirOff && !typeOff && after >= 1 && FULL_DIRECTIONS.has(afterNumber[0].toUpperCase()) && STREET_SUFFIXES.has(name.replace(/\.$/, "").toUpperCase())) {
|
|
37949
|
+
return afterNumber[0];
|
|
37950
|
+
}
|
|
37951
|
+
if (tokens.length < typedTokens && (name.length < 2 || !typeOff && isDirectionOrType(name) || !/[\p{L}\p{N}]/u.test(name))) {
|
|
37952
|
+
return afterNumber.length < typedTokens && afterNumber.join(" ") !== name ? afterNumber.join(" ") : street;
|
|
37953
|
+
}
|
|
37805
37954
|
return name || street;
|
|
37806
37955
|
}
|
|
37807
37956
|
function unmappedNumberColumn(parts, nameColumn, numberColumn) {
|
|
@@ -37814,6 +37963,7 @@ function numberLiteral(ds, n) {
|
|
|
37814
37963
|
function propertyQueryUrl(ds, street) {
|
|
37815
37964
|
const address = street;
|
|
37816
37965
|
const split = address ? splitFor(ds, address) : null;
|
|
37966
|
+
const needle = address ? plainNeedle(ds, address) : "";
|
|
37817
37967
|
if (ds.type === "socrata") {
|
|
37818
37968
|
const parts = [];
|
|
37819
37969
|
const clauses = [];
|
|
@@ -37822,7 +37972,7 @@ function propertyQueryUrl(ds, street) {
|
|
|
37822
37972
|
`upper(${ds.fields.address}) like upper('%${esc(split.name)}%') AND ${ds.fields.streetNumber} = ${numberLiteral(ds, split.number)}`
|
|
37823
37973
|
);
|
|
37824
37974
|
} else if (address) {
|
|
37825
|
-
clauses.push(`upper(${ds.fields.address}) like upper('%${
|
|
37975
|
+
clauses.push(likeAny(needle, (b) => `upper(${ds.fields.address}) like upper('%${b}%')`, ds.houseNumberSpaceRuns));
|
|
37826
37976
|
}
|
|
37827
37977
|
if (ds.where) clauses.push(`(${ds.where})`);
|
|
37828
37978
|
if (clauses.length) parts.push(`$where=${encodeURIComponent(clauses.join(" AND "))}`);
|
|
@@ -37837,7 +37987,7 @@ function propertyQueryUrl(ds, street) {
|
|
|
37837
37987
|
`${sqlId(ds.fields.address)} ILIKE '%${esc(split.name)}%' AND ${sqlId(ds.fields.streetNumber)} = ${numberLiteral(ds, split.number)}`
|
|
37838
37988
|
);
|
|
37839
37989
|
} else if (address) {
|
|
37840
|
-
clauses.push(`${sqlId(ds.fields.address)} ILIKE '%${
|
|
37990
|
+
clauses.push(likeAny(needle, (b) => `${sqlId(ds.fields.address)} ILIKE '%${b}%'`, ds.houseNumberSpaceRuns));
|
|
37841
37991
|
}
|
|
37842
37992
|
if (ds.where) clauses.push(`(${ds.where})`);
|
|
37843
37993
|
const whereSql = clauses.length ? clauses.join(" AND ") : "1=1";
|
|
@@ -37853,7 +38003,7 @@ function propertyQueryUrl(ds, street) {
|
|
|
37853
38003
|
`${sqlId(ds.fields.address)} ILIKE '%${esc(split.name)}%' AND ${sqlId(ds.fields.streetNumber)} = ${numberLiteral(ds, split.number)}`
|
|
37854
38004
|
);
|
|
37855
38005
|
} else if (address) {
|
|
37856
|
-
clauses.push(`${sqlId(ds.fields.address)} ILIKE '%${
|
|
38006
|
+
clauses.push(likeAny(needle, (b) => `${sqlId(ds.fields.address)} ILIKE '%${b}%'`, ds.houseNumberSpaceRuns));
|
|
37857
38007
|
}
|
|
37858
38008
|
if (ds.where) clauses.push(`(${ds.where})`);
|
|
37859
38009
|
const whereSql = clauses.length ? clauses.join(" AND ") : "1=1";
|
|
@@ -37868,7 +38018,7 @@ function propertyQueryUrl(ds, street) {
|
|
|
37868
38018
|
`UPPER(${ds.fields.address}) LIKE UPPER('%${esc(split.name)}%') AND ${ds.fields.streetNumber} = ${numberLiteral(ds, split.number)}`
|
|
37869
38019
|
);
|
|
37870
38020
|
} else if (address) {
|
|
37871
|
-
arcClauses.push(`UPPER(${ds.fields.address}) LIKE UPPER('%${
|
|
38021
|
+
arcClauses.push(likeAny(needle, (b) => `UPPER(${ds.fields.address}) LIKE UPPER('%${b}%')`, ds.houseNumberSpaceRuns));
|
|
37872
38022
|
}
|
|
37873
38023
|
if (ds.where) arcClauses.push(`(${ds.where})`);
|
|
37874
38024
|
const where = arcClauses.length ? arcClauses.join(" AND ") : "1=1";
|
|
@@ -37901,7 +38051,7 @@ function casesQueryUrl(src, street, statuses = []) {
|
|
|
37901
38051
|
if (lookup !== "address" && street) return null;
|
|
37902
38052
|
if (src.type === "socrata") {
|
|
37903
38053
|
const clauses2 = [];
|
|
37904
|
-
if (street) clauses2.push(`upper(${src.fields.address}) like upper('%${
|
|
38054
|
+
if (street) clauses2.push(likeAny(street, (b) => `upper(${src.fields.address}) like upper('%${b}%')`, src.houseNumberSpaceRuns));
|
|
37905
38055
|
const st2 = statusClause(src, statuses, false);
|
|
37906
38056
|
if (st2) clauses2.push(st2);
|
|
37907
38057
|
if (src.where) clauses2.push(`(${src.where})`);
|
|
@@ -37912,7 +38062,7 @@ function casesQueryUrl(src, street, statuses = []) {
|
|
|
37912
38062
|
return `${src.url}?${parts2.join("&")}`;
|
|
37913
38063
|
}
|
|
37914
38064
|
const clauses = [];
|
|
37915
|
-
if (street) clauses.push(`UPPER(${src.fields.address}) LIKE UPPER('%${
|
|
38065
|
+
if (street) clauses.push(likeAny(street, (b) => `UPPER(${src.fields.address}) LIKE UPPER('%${b}%')`, src.houseNumberSpaceRuns));
|
|
37916
38066
|
const st = statusClause(src, statuses, true);
|
|
37917
38067
|
if (st) clauses.push(st);
|
|
37918
38068
|
if (src.where) clauses.push(`(${src.where})`);
|
|
@@ -38043,12 +38193,17 @@ function cityPath(slug, kind) {
|
|
|
38043
38193
|
}
|
|
38044
38194
|
var SOCRATA_NOTE = " Socrata throttles anonymous callers: for volume, send an X-App-Token header with your own app token.";
|
|
38045
38195
|
var WILDCARD_NOTE = "LIKE wildcards in the street stay active, as on the site: '%' matches any run of characters and '_' exactly one.";
|
|
38196
|
+
function spacesNote(runs) {
|
|
38197
|
+
const n = Math.min(Math.floor(runs ?? 0), HOUSE_GAP_LIMIT);
|
|
38198
|
+
if (!(n >= 1)) return "";
|
|
38199
|
+
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'.`;
|
|
38200
|
+
}
|
|
38046
38201
|
function propertyNote(ds) {
|
|
38047
38202
|
const parts = [];
|
|
38048
38203
|
const numberColumn = unmappedNumberColumn(ds.fields.addressParts, ds.fields.address, ds.fields.streetNumber);
|
|
38049
38204
|
if (ds.fields.streetNumber) {
|
|
38050
38205
|
parts.push(
|
|
38051
|
-
`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
|
|
38206
|
+
`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)}`
|
|
38052
38207
|
);
|
|
38053
38208
|
} else if (numberColumn) {
|
|
38054
38209
|
parts.push(
|
|
@@ -38056,7 +38211,7 @@ function propertyNote(ds) {
|
|
|
38056
38211
|
);
|
|
38057
38212
|
} else {
|
|
38058
38213
|
parts.push(
|
|
38059
|
-
`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
|
|
38214
|
+
`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)}`
|
|
38060
38215
|
);
|
|
38061
38216
|
}
|
|
38062
38217
|
parts.push(WILDCARD_NOTE);
|
|
@@ -38079,7 +38234,7 @@ function casesNote(src) {
|
|
|
38079
38234
|
} else {
|
|
38080
38235
|
const numberColumn = unmappedNumberColumn(src.fields.addressParts, src.fields.address, void 0);
|
|
38081
38236
|
parts.push(
|
|
38082
|
-
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
|
|
38237
|
+
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)}`
|
|
38083
38238
|
);
|
|
38084
38239
|
parts.push(`Filter by status with ${src.fields.status ?? "the status column"} in (...) using the status_buckets values.`);
|
|
38085
38240
|
parts.push(WILDCARD_NOTE);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbankitstudio/atlas",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "JS SDK for the UrbanKit County Parcel REST API Atlas:
|
|
3
|
+
"version": "0.6.36",
|
|
4
|
+
"description": "JS SDK for the UrbanKit County Parcel REST API Atlas: 395 counties across all 50 US states and DC, 413 verified public ArcGIS REST endpoints for county parcel data, with searchable field metadata, sample queries and license info, plus verified city code-violation, building-permit and zoning-case datasets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parcel",
|
|
7
7
|
"arcgis",
|