@mailwoman/tiger 10.0.0 → 10.2.0
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/lib/block-group.ts +7 -7
- package/lib/class-code.ts +387 -266
- package/lib/constants.ts +7 -6
- package/lib/county/subdivision.ts +7 -7
- package/lib/{county/index.ts → county.ts} +7 -7
- package/lib/files.ts +37 -20
- package/lib/functional-status.ts +6 -4
- package/lib/geoid.ts +44 -26
- package/lib/index.ts +1 -1
- package/lib/legal-statistical-area.ts +7 -5
- package/lib/{sdk/schema.ts → schema.ts} +32 -42
- package/lib/state.ts +26 -23
- package/lib/tabulation-block.ts +4 -4
- package/lib/tract.ts +3 -3
- package/out/block-group.d.ts +7 -7
- package/out/class-code.d.ts +387 -266
- package/out/class-code.d.ts.map +1 -1
- package/out/class-code.js +387 -266
- package/out/class-code.js.map +1 -1
- package/out/constants.d.ts +7 -6
- package/out/constants.d.ts.map +1 -1
- package/out/constants.js +3 -3
- package/out/county/subdivision.d.ts +7 -7
- package/out/{county/index.d.ts → county.d.ts} +8 -8
- package/out/county.d.ts.map +1 -0
- package/out/{county/index.js → county.js} +2 -2
- package/out/county.js.map +1 -0
- package/out/files.d.ts +21 -13
- package/out/files.d.ts.map +1 -1
- package/out/files.js +27 -13
- package/out/files.js.map +1 -1
- package/out/functional-status.d.ts +6 -4
- package/out/functional-status.d.ts.map +1 -1
- package/out/functional-status.js +6 -4
- package/out/functional-status.js.map +1 -1
- package/out/geoid.d.ts +34 -16
- package/out/geoid.d.ts.map +1 -1
- package/out/geoid.js +16 -10
- package/out/geoid.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/index.js.map +1 -1
- package/out/legal-statistical-area.d.ts +7 -5
- package/out/legal-statistical-area.d.ts.map +1 -1
- package/out/legal-statistical-area.js +7 -5
- package/out/legal-statistical-area.js.map +1 -1
- package/out/{sdk/schema.d.ts → schema.d.ts} +26 -20
- package/out/schema.d.ts.map +1 -0
- package/out/{sdk/schema.js → schema.js} +12 -31
- package/out/schema.js.map +1 -0
- package/out/sdk/download.d.ts +7 -15
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +6 -15
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/fetch.d.ts +36 -29
- package/out/sdk/fetch.d.ts.map +1 -1
- package/out/sdk/fetch.js +18 -53
- package/out/sdk/fetch.js.map +1 -1
- package/out/sdk/redistricting.d.ts +29 -15
- package/out/sdk/redistricting.d.ts.map +1 -1
- package/out/sdk/redistricting.js +47 -36
- package/out/sdk/redistricting.js.map +1 -1
- package/out/sdk/state/TIGERTabulatedBlockEntity.d.ts +2 -2
- package/out/sdk/state/TIGERTabulatedBlockEntity.d.ts.map +1 -1
- package/out/sdk/state/TIGERTabulatedBlockEntity.js +3 -3
- package/out/sdk/state/TIGERTabulatedBlockEntity.js.map +1 -1
- package/out/sdk/state/TIGERTractEntity.d.ts.map +1 -1
- package/out/sdk/state/TIGERTractEntity.js.map +1 -1
- package/out/sdk/state/block-operations.d.ts +3 -2
- package/out/sdk/state/block-operations.d.ts.map +1 -1
- package/out/sdk/state/block-operations.js +4 -3
- package/out/sdk/state/block-operations.js.map +1 -1
- package/out/sdk/{state/index.d.ts → state.d.ts} +1 -1
- package/out/sdk/state.d.ts.map +1 -0
- package/out/sdk/{state/index.js → state.js} +1 -1
- package/out/sdk/state.js.map +1 -0
- package/out/sdk/tsconfig.tsbuildinfo +1 -0
- package/out/state.d.ts +18 -15
- package/out/state.d.ts.map +1 -1
- package/out/state.js +17 -14
- package/out/state.js.map +1 -1
- package/out/tabulation-block.d.ts +4 -4
- package/out/tools/race/dots/map.d.ts +23 -9
- package/out/tools/race/dots/map.d.ts.map +1 -1
- package/out/tools/race/dots/map.js +9 -5
- package/out/tools/race/dots/map.js.map +1 -1
- package/out/tools/race/dots.d.ts +47 -0
- package/out/tools/race/dots.d.ts.map +1 -0
- package/out/tools/race/{dots/index.js → dots.js} +10 -27
- package/out/tools/race/dots.js.map +1 -0
- package/out/tools/serve-range.d.ts +13 -7
- package/out/tools/serve-range.d.ts.map +1 -1
- package/out/tools/serve-range.js +10 -8
- package/out/tools/serve-range.js.map +1 -1
- package/out/tools/tsconfig.tsbuildinfo +1 -0
- package/out/tract.d.ts +3 -3
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +61 -44
- package/sdk/download.ts +41 -0
- package/{lib/sdk → sdk}/fetch.ts +58 -62
- package/{lib/sdk → sdk}/redistricting.ts +57 -40
- package/{lib/sdk → sdk}/state/TIGERTabulatedBlockEntity.ts +3 -3
- package/{lib/sdk → sdk}/state/block-operations.ts +5 -4
- package/{lib/tools → tools}/race/dots/map.ts +30 -12
- package/{lib/tools/race/dots/index.ts → tools/race/dots.ts} +14 -31
- package/{lib/tools → tools}/serve-range.ts +17 -10
- package/lib/sdk/download.ts +0 -49
- package/lib/sdk/index.ts +0 -10
- package/lib/tools/index.ts +0 -11
- package/out/county/index.d.ts.map +0 -1
- package/out/county/index.js.map +0 -1
- package/out/sdk/index.d.ts +0 -10
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -10
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/schema.d.ts.map +0 -1
- package/out/sdk/schema.js.map +0 -1
- package/out/sdk/state/index.d.ts.map +0 -1
- package/out/sdk/state/index.js.map +0 -1
- package/out/tools/index.d.ts +0 -11
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -11
- package/out/tools/index.js.map +0 -1
- package/out/tools/race/dots/index.d.ts +0 -61
- package/out/tools/race/dots/index.d.ts.map +0 -1
- package/out/tools/race/dots/index.js.map +0 -1
- /package/{lib/sdk → sdk}/state/TIGERTractEntity.ts +0 -0
- /package/{lib/sdk/state/index.ts → sdk/state.ts} +0 -0
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
* @copyright Sister Software.
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* TIGER SQLite schema, as a string so it loads in both `tsx` source mode and the compiled CLI
|
|
7
|
-
* (`tsc` doesn't copy `.sql` assets into `out/`). Geometry is GeoJSON text — NOT SpatiaLite. The
|
|
8
|
-
* prior SpatiaLite path (`load_extension` of a hardcoded macOS dylib + WKB `GEOM` columns) never
|
|
9
|
-
* loaded on Linux; plain text keeps the build dependency-free and `node:sqlite`-native (read it
|
|
10
|
-
* back with `JSON.parse`).
|
|
11
5
|
*/
|
|
12
6
|
|
|
13
7
|
import { sql, type Kysely } from "kysely"
|
|
14
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Re-exports Kysely's `Generated` column marker alongside the table types,
|
|
11
|
+
* so schema consumers need not import Kysely for it.
|
|
12
|
+
*/
|
|
15
13
|
export { type Generated } from "kysely"
|
|
16
14
|
|
|
15
|
+
/**
|
|
16
|
+
* The Kysely row type for `tabblock20`, one row per 2020 Census tabulation block
|
|
17
|
+
* with its geography codes, counts and geometry.
|
|
18
|
+
*/
|
|
17
19
|
export interface TIGERBlockTable {
|
|
18
20
|
GEOID: string
|
|
19
21
|
state_code: string
|
|
@@ -31,9 +33,9 @@ export interface TIGERBlockTable {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
|
-
* Kysely row type for `pl_block
|
|
35
|
-
*
|
|
36
|
-
* `pop_total`.
|
|
36
|
+
* The Kysely row type for `pl_block`, one row per tabulation block from the 2020 P.L.
|
|
37
|
+
* 94-171 tables P2 and H1, keyed on the same `GEOID` as {@link TIGERBlockTable}.
|
|
38
|
+
* The eight race and ethnicity columns partition `pop_total`.
|
|
37
39
|
*/
|
|
38
40
|
export interface PLBlockTable {
|
|
39
41
|
GEOID: string
|
|
@@ -46,22 +48,27 @@ export interface PLBlockTable {
|
|
|
46
48
|
nhpi: number
|
|
47
49
|
other: number
|
|
48
50
|
multi: number
|
|
51
|
+
|
|
49
52
|
/**
|
|
50
|
-
* P.L. 94-171 table H1
|
|
53
|
+
* Total housing units in the block, from P.L. 94-171 table H1.
|
|
51
54
|
*/
|
|
52
55
|
housing_units: number
|
|
56
|
+
|
|
53
57
|
/**
|
|
54
|
-
*
|
|
58
|
+
* Occupied housing units from table H1.
|
|
59
|
+
*
|
|
60
|
+
* `occupied + vacant` always equals `housing_units`, because the reader refuses any row where it does not.
|
|
55
61
|
*/
|
|
56
62
|
occupied: number
|
|
63
|
+
|
|
57
64
|
/**
|
|
58
|
-
* H1
|
|
65
|
+
* Vacant housing units from table H1.
|
|
59
66
|
*/
|
|
60
67
|
vacant: number
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
/**
|
|
64
|
-
* Kysely row type for `tiger_streets` (
|
|
71
|
+
* Kysely row type for `tiger_streets` (addrfeat — street segments with names and ZIPs, per county).
|
|
65
72
|
*/
|
|
66
73
|
export interface TIGERStreetTable {
|
|
67
74
|
linearid: string
|
|
@@ -72,7 +79,7 @@ export interface TIGERStreetTable {
|
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
/**
|
|
75
|
-
* Kysely row type for `tiger_places` (
|
|
82
|
+
* Kysely row type for `tiger_places` (place — incorporated/census places, per state).
|
|
76
83
|
*/
|
|
77
84
|
export interface TIGERPlaceTable {
|
|
78
85
|
geoid: string
|
|
@@ -84,7 +91,7 @@ export interface TIGERPlaceTable {
|
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
/**
|
|
87
|
-
* The
|
|
94
|
+
* The tiger database schema, for `new DatabaseClient<TIGERDatabase>(...)`.
|
|
88
95
|
*/
|
|
89
96
|
export interface TIGERDatabase {
|
|
90
97
|
tabblock20: TIGERBlockTable
|
|
@@ -94,36 +101,16 @@ export interface TIGERDatabase {
|
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
/**
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Build-tuning PRAGMAs, run raw before any table is created (`page_size`/`auto_vacuum` only take effect on an empty DB,
|
|
102
|
-
* and PRAGMA has no Kysely builder). The consumer execs this, then calls {@link initializeTIGERSchema} for the tables +
|
|
103
|
-
* indexes.
|
|
104
|
+
* The build-tuning pragmas to execute before {@link initializeTIGERSchema},
|
|
105
|
+
* since `page_size` and `auto_vacuum` take effect only on an empty database.
|
|
104
106
|
*/
|
|
105
|
-
export const TIGER_PRAGMAS =
|
|
107
|
+
export const TIGER_PRAGMAS = `
|
|
106
108
|
PRAGMA auto_vacuum = INCREMENTAL;
|
|
107
109
|
PRAGMA page_size = 4096;
|
|
108
110
|
PRAGMA cache_size = 10000;
|
|
109
111
|
PRAGMA journal_mode = WAL;
|
|
110
112
|
`
|
|
111
113
|
|
|
112
|
-
/**
|
|
113
|
-
* Create the TIGER tables + indexes via the Kysely schema-builder (the house idiom). Idempotent (`IF NOT EXISTS`). Pass
|
|
114
|
-
* a {@link DatabaseClient} (or any `Kysely`) over the TIGER DB; run {@link TIGER_PRAGMAS} first. `us_state`/`tract`
|
|
115
|
-
* aren't in {@link TIGERDatabase} (created here but not queried via Kysely) — `createTable` takes any table name, so
|
|
116
|
-
* that's fine.
|
|
117
|
-
*
|
|
118
|
-
* The `text(N)` length hints in the prior raw DDL were documentary only (SQLite uses TEXT affinity regardless); the
|
|
119
|
-
* lengths live on the {@link TIGERBlockTable} interface instead.
|
|
120
|
-
*/
|
|
121
|
-
/**
|
|
122
|
-
* Refuse a `pl_block` built before the H1 columns existed. `createTable(...).ifNotExists()` leaves an older table as it
|
|
123
|
-
* is, and the next load would fail on the first insert with a message about a column, not about the cause. The table is
|
|
124
|
-
* derived (the redistricting command reloads it state by state), so the remedy is a rebuild: drop it and re-run
|
|
125
|
-
* `mailwoman tiger redistricting` for each state you hold. Databases are never patched in place.
|
|
126
|
-
*/
|
|
127
114
|
async function assertPLBlockShape(db: Kysely<TIGERDatabase>): Promise<void> {
|
|
128
115
|
const columns = await sql<{ name: string }>`select name from pragma_table_info('pl_block')`.execute(db)
|
|
129
116
|
const names = new Set(columns.rows.map((row) => row.name))
|
|
@@ -137,6 +124,12 @@ async function assertPLBlockShape(db: Kysely<TIGERDatabase>): Promise<void> {
|
|
|
137
124
|
}
|
|
138
125
|
}
|
|
139
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Creates the TIGER tables and indexes if they do not exist.
|
|
129
|
+
*
|
|
130
|
+
* It throws when an existing `pl_block` lacks the H1 housing columns,
|
|
131
|
+
* because that derived table must be dropped and reloaded.
|
|
132
|
+
*/
|
|
140
133
|
export async function initializeTIGERSchema(db: Kysely<TIGERDatabase>): Promise<void> {
|
|
141
134
|
await db.schema
|
|
142
135
|
.createTable("us_state")
|
|
@@ -175,8 +168,6 @@ export async function initializeTIGERSchema(db: Kysely<TIGERDatabase>): Promise<
|
|
|
175
168
|
.addColumn("geometry", "text", (c) => c.notNull())
|
|
176
169
|
.execute()
|
|
177
170
|
|
|
178
|
-
// No index on GEOID alone — it's the PRIMARY KEY, which already carries a unique index. The prior
|
|
179
|
-
// schema's idx_tabblock20_geoid duplicated that for nothing (double insert cost, double footprint).
|
|
180
171
|
await db.schema.createIndex("idx_tabblock20_state_code").ifNotExists().on("tabblock20").column("state_code").execute()
|
|
181
172
|
|
|
182
173
|
await db.schema
|
|
@@ -211,8 +202,7 @@ export async function initializeTIGERSchema(db: Kysely<TIGERDatabase>): Promise<
|
|
|
211
202
|
.addColumn("housing_units", "integer", (c) => c.notNull())
|
|
212
203
|
.addColumn("occupied", "integer", (c) => c.notNull())
|
|
213
204
|
.addColumn("vacant", "integer", (c) => c.notNull())
|
|
214
|
-
|
|
215
|
-
// cluster it WITHOUT ROWID — one B-tree probe per join, no separate rowid + PK-index pair.
|
|
205
|
+
|
|
216
206
|
.modifyEnd(sql`without rowid`)
|
|
217
207
|
.execute()
|
|
218
208
|
|
package/lib/state.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { GeoFeature, MultiPolygonLiteral } from "@mailwoman/spatial"
|
|
|
9
9
|
import type { GeoIDPart } from "#geoid"
|
|
10
10
|
import type { TIGERTabulatedBlockProperties } from "#tabulation-block"
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// #region FIPS Codes
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* FIPS codes for US States.
|
|
@@ -365,7 +365,7 @@ export const AdminLevel1CodeToAbbreviation = {
|
|
|
365
365
|
/**
|
|
366
366
|
* Type-predicate to determine if a given string is a valid state FIPS code.
|
|
367
367
|
*/
|
|
368
|
-
export function isStateFIPSCode(code: string | null
|
|
368
|
+
export function isStateFIPSCode(code: string | null): code is FIPSStateCode {
|
|
369
369
|
if (!code || typeof code !== "string") return false
|
|
370
370
|
|
|
371
371
|
return Object.hasOwn(FIPSStateCodeToAbbreviation, code)
|
|
@@ -374,7 +374,7 @@ export function isStateFIPSCode(code: string | null | undefined): code is FIPSSt
|
|
|
374
374
|
/**
|
|
375
375
|
* Type-predicate to determine if a given string is a valid territory FIPS code.
|
|
376
376
|
*/
|
|
377
|
-
export function isTerritoryFIPSCode(code: string | null
|
|
377
|
+
export function isTerritoryFIPSCode(code: string | null): code is FIPSTerritoryCode {
|
|
378
378
|
if (!code || typeof code !== "string") return false
|
|
379
379
|
|
|
380
380
|
return Object.hasOwn(FIPSTerritoryCodeToAbbreviation, code)
|
|
@@ -385,13 +385,13 @@ export function isTerritoryFIPSCode(code: string | null | undefined): code is FI
|
|
|
385
385
|
*
|
|
386
386
|
* This includes both states and territories.
|
|
387
387
|
*/
|
|
388
|
-
export function isAdminLevel1FIPSCode(code: string | null
|
|
388
|
+
export function isAdminLevel1FIPSCode(code: string | null): code is AdminLevel1Code {
|
|
389
389
|
return isStateFIPSCode(code) || isTerritoryFIPSCode(code)
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
// #endregion
|
|
393
393
|
|
|
394
|
-
|
|
394
|
+
// #region State Abbreviation
|
|
395
395
|
|
|
396
396
|
/**
|
|
397
397
|
* Two-letter abbreviations of a US states.
|
|
@@ -457,7 +457,8 @@ export const StateAbbreviation = {
|
|
|
457
457
|
export type StateAbbreviation = (typeof StateAbbreviation)[keyof typeof StateAbbreviation]
|
|
458
458
|
|
|
459
459
|
/**
|
|
460
|
-
* Postal abbreviations for US territories, kept apart from the states
|
|
460
|
+
* Postal abbreviations for US territories, kept apart from the states
|
|
461
|
+
* so callers can include or exclude them.
|
|
461
462
|
*/
|
|
462
463
|
export const TerritoryAbbreviation = {
|
|
463
464
|
"American Samoa": "AS",
|
|
@@ -480,16 +481,16 @@ export type TerritoryAbbreviation = (typeof TerritoryAbbreviation)[keyof typeof
|
|
|
480
481
|
export type AdminLevel1Abbreviation = StateAbbreviation | TerritoryAbbreviation
|
|
481
482
|
|
|
482
483
|
/**
|
|
483
|
-
* Every admin-level-1 postal abbreviation — the fifty states, DC
|
|
484
|
+
* Every admin-level-1 postal abbreviation — the fifty states, DC and the territories together.
|
|
484
485
|
*/
|
|
485
486
|
export const AdminLevel1Abbreviation = {
|
|
486
487
|
...StateAbbreviation,
|
|
487
488
|
...TerritoryAbbreviation,
|
|
488
489
|
} as const
|
|
489
490
|
|
|
490
|
-
|
|
491
|
+
// #endregion
|
|
491
492
|
|
|
492
|
-
|
|
493
|
+
// #region State Name
|
|
493
494
|
|
|
494
495
|
/**
|
|
495
496
|
* US State abbreviations to their full names.
|
|
@@ -558,13 +559,13 @@ export const StateName = {
|
|
|
558
559
|
|
|
559
560
|
export type StateName = (typeof StateName)[keyof typeof StateName]
|
|
560
561
|
|
|
561
|
-
|
|
562
|
+
// #endregion
|
|
562
563
|
|
|
563
|
-
|
|
564
|
+
// #region State Utilities
|
|
564
565
|
|
|
565
566
|
/**
|
|
566
|
-
* Predicate for checking if a string is a proper abbreviation for a US State
|
|
567
|
-
* 2-letter string.
|
|
567
|
+
* Predicate for checking if a string is a proper abbreviation for a US State
|
|
568
|
+
* or territory, rather than a random 2-letter string.
|
|
568
569
|
*
|
|
569
570
|
* @see {@link isStateAbbreviation} for a specific check for US States.
|
|
570
571
|
* @see {@link isStateTerritoryAbbreviation} for a specific check for US Territories.
|
|
@@ -576,7 +577,8 @@ export function isStateLevelAbbreviation(input: unknown): input is AdminLevel1Ab
|
|
|
576
577
|
}
|
|
577
578
|
|
|
578
579
|
/**
|
|
579
|
-
* Predicate for checking if a string is a proper abbreviation for a US State,
|
|
580
|
+
* Predicate for checking if a string is a proper abbreviation for a US State,
|
|
581
|
+
* rather than a random 2-letter string.
|
|
580
582
|
*
|
|
581
583
|
* @see {@link isStateLevelAbbreviation} for a general check for US States and Territories.
|
|
582
584
|
* @see {@link isStateTerritoryAbbreviation} for a specific check for US Territories.
|
|
@@ -588,7 +590,8 @@ export function isStateAbbreviation(input: unknown): input is StateAbbreviation
|
|
|
588
590
|
}
|
|
589
591
|
|
|
590
592
|
/**
|
|
591
|
-
* Predicate for checking if a string is a proper abbreviation for a US Territory,
|
|
593
|
+
* Predicate for checking if a string is a proper abbreviation for a US Territory,
|
|
594
|
+
* rather than a random 2-letter string.
|
|
592
595
|
*
|
|
593
596
|
* @see {@link isStateLevelAbbreviation} for a general check for US States and Territories.
|
|
594
597
|
* @see {@link isStateAbbreviation} for a specific check for US States.
|
|
@@ -631,17 +634,17 @@ export interface StateDetails {
|
|
|
631
634
|
*/
|
|
632
635
|
FIPSCode: string
|
|
633
636
|
/**
|
|
634
|
-
* The
|
|
637
|
+
* The ansi code for the state or territory.
|
|
635
638
|
*
|
|
636
|
-
* @title
|
|
639
|
+
* @title ansi Code
|
|
637
640
|
*/
|
|
638
641
|
ANSICode: string
|
|
639
642
|
}
|
|
640
643
|
|
|
641
644
|
/**
|
|
642
|
-
* A US state as defined by the Census Bureau's
|
|
645
|
+
* A US state as defined by the Census Bureau's tiger system.
|
|
643
646
|
*
|
|
644
|
-
* @title Census
|
|
647
|
+
* @title Census tiger State
|
|
645
648
|
* @public
|
|
646
649
|
*/
|
|
647
650
|
export interface TIGERState {
|
|
@@ -667,8 +670,8 @@ export interface TIGERState {
|
|
|
667
670
|
[GeoIDPart.State]: AdminLevel1Code
|
|
668
671
|
|
|
669
672
|
/**
|
|
670
|
-
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
671
|
-
* islands.
|
|
673
|
+
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
674
|
+
* multi-polygon for blocks with holes, or islands.
|
|
672
675
|
*
|
|
673
676
|
* @title Geometry
|
|
674
677
|
*/
|
|
@@ -677,4 +680,4 @@ export interface TIGERState {
|
|
|
677
680
|
|
|
678
681
|
export type TIGERStateFeature = GeoFeature<MultiPolygonLiteral, TIGERTabulatedBlockProperties>
|
|
679
682
|
|
|
680
|
-
|
|
683
|
+
// #endregion
|
package/lib/tabulation-block.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { TIGERProperty, TIGERPropertyRecord } from "#constants"
|
|
|
10
10
|
import type { GeoIDPart, FIPSBlockGeoID, ParsedGeoIDBlockLevel } from "#geoid"
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* The properties of a tabulated block from the
|
|
13
|
+
* The properties of a tabulated block from the tiger/Line dataset.
|
|
14
14
|
*/
|
|
15
15
|
export type TIGERTabulatedBlockProperties = Pick<
|
|
16
16
|
TIGERPropertyRecord<FIPSBlockGeoID>,
|
|
@@ -47,7 +47,7 @@ export interface TIGERBlockFeatureCollection {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* A tabulated block from the
|
|
50
|
+
* A tabulated block from the tiger/Line dataset.
|
|
51
51
|
*
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
@@ -60,8 +60,8 @@ export interface TIGERTabulatedBlock extends ParsedGeoIDBlockLevel, TIGERTabulat
|
|
|
60
60
|
GEOID: FIPSBlockGeoID
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
64
|
-
* islands.
|
|
63
|
+
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
64
|
+
* multi-polygon for blocks with holes, or islands.
|
|
65
65
|
*
|
|
66
66
|
* @title Geometry
|
|
67
67
|
*/
|
package/lib/tract.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { TIGERProperty, TIGERPropertyRecord } from "#constants"
|
|
|
10
10
|
import type { FIPSTractGeoID, GeoIDPart, ParsedGeoIDTractLevel } from "#geoid"
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @title
|
|
13
|
+
* @title tiger Tract
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
16
|
export interface TIGERTract extends ParsedGeoIDTractLevel {
|
|
@@ -22,8 +22,8 @@ export interface TIGERTract extends ParsedGeoIDTractLevel {
|
|
|
22
22
|
GEOID: FIPSTractGeoID
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
26
|
-
* islands.
|
|
25
|
+
* The geometry of the tabulated block, typically a polygon, but may be a
|
|
26
|
+
* multi-polygon for blocks with holes, or islands.
|
|
27
27
|
*
|
|
28
28
|
* @title Geometry
|
|
29
29
|
*/
|
package/out/block-group.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { TIGERFunctionalStatus } from "#functional-status";
|
|
|
8
8
|
import type { LegalStatisticalAreaDescription } from "#legal-statistical-area";
|
|
9
9
|
import type { AdminLevel1Code } from "#state";
|
|
10
10
|
/**
|
|
11
|
-
* @title
|
|
11
|
+
* @title tiger Block Group
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
export interface TIGERBlockGroup {
|
|
@@ -32,16 +32,16 @@ export interface TIGERBlockGroup {
|
|
|
32
32
|
*/
|
|
33
33
|
COUSUBFP: string;
|
|
34
34
|
/**
|
|
35
|
-
* @title County Subdivision
|
|
35
|
+
* @title County Subdivision gnis Code
|
|
36
36
|
*
|
|
37
37
|
* @minLength 8
|
|
38
38
|
* @maxLength 8
|
|
39
39
|
* @pattern ^\d{8}$
|
|
40
|
-
* @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names |
|
|
40
|
+
* @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | usgs: Domestic Names}
|
|
41
41
|
*/
|
|
42
42
|
COUSUBNS: string;
|
|
43
43
|
/**
|
|
44
|
-
* @title Block Group
|
|
44
|
+
* @title Block Group geoid
|
|
45
45
|
*
|
|
46
46
|
* @minLength 10
|
|
47
47
|
* @maxLength 10
|
|
@@ -49,7 +49,7 @@ export interface TIGERBlockGroup {
|
|
|
49
49
|
*/
|
|
50
50
|
GEOID: string;
|
|
51
51
|
/**
|
|
52
|
-
* Fully Qualified
|
|
52
|
+
* Fully Qualified geoid as used in cedsci and other systems.
|
|
53
53
|
*
|
|
54
54
|
* @title Fully Qualified Geographic Identifier
|
|
55
55
|
* @minLength 19
|
|
@@ -78,9 +78,9 @@ export interface TIGERBlockGroup {
|
|
|
78
78
|
*/
|
|
79
79
|
CLASSFP: TIGERClassCode;
|
|
80
80
|
/**
|
|
81
|
-
* MAF/
|
|
81
|
+
* MAF/tiger Feature Class Code.
|
|
82
82
|
*
|
|
83
|
-
* @title MAF/
|
|
83
|
+
* @title MAF/tiger Feature Class Code
|
|
84
84
|
*
|
|
85
85
|
* @minLength 5
|
|
86
86
|
* @maxLength 5
|