@rembish/iso-topojson 1.2.0 → 1.4.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/README.md +39 -13
- package/iso-a2-markers-biomes.json +1 -0
- package/iso-a2-markers.json +1 -1
- package/iso-a2.json +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ npm install @rembish/iso-topojson
|
|
|
15
15
|
```
|
|
16
16
|
https://unpkg.com/@rembish/iso-topojson/iso-a2.json
|
|
17
17
|
https://unpkg.com/@rembish/iso-topojson/iso-a2-markers.json
|
|
18
|
+
https://unpkg.com/@rembish/iso-topojson/iso-a2-markers-biomes.json
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
## Files
|
|
@@ -22,9 +23,18 @@ https://unpkg.com/@rembish/iso-topojson/iso-a2-markers.json
|
|
|
22
23
|
| File | Size | Description |
|
|
23
24
|
|------|------|-------------|
|
|
24
25
|
| `iso-a2.json` | 204 KB | Full-detail TopoJSON, 250 polygon features |
|
|
25
|
-
| `iso-a2-markers.json` |
|
|
26
|
+
| `iso-a2-markers.json` | 245 KB | Compact variant: tiny territories (< 1000 km²) replaced with Point markers |
|
|
27
|
+
| `iso-a2-markers-biomes.json` | 322 KB | Biomes variant: 30 large countries subdivided into 95 climate/travel zones |
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
### Biomes variant
|
|
30
|
+
|
|
31
|
+
`iso-a2-markers-biomes.json` replaces 30 large countries with multiple **biome polygons** — climate and travel zones derived from admin-1 province boundaries. For example, the United States is split into 7 zones (Northeast, Southeast, Midwest, West Coast, Southwest, Hawaii, Alaska), Russia into 5 (West, North, Siberia, Far East, Kaliningrad), and India into 5 (North, South, Himalaya, East, Andaman & Nicobar).
|
|
32
|
+
|
|
33
|
+
Countries with biome subdivisions: AR, AU, BR, CA, CL, CN, CO, EC, ES, FI, GR, ID, IN, IT, JP, MX, MY, NO, NZ, PE, PT, RU, SE, TH, TR, TZ, US, VN, YE, ZA.
|
|
34
|
+
|
|
35
|
+
The remaining 220 countries appear as single polygons, same as in `iso-a2-markers.json`. Tiny territories are Point markers. Total: 315 features (252 polygons + 63 point markers).
|
|
36
|
+
|
|
37
|
+
In `iso-a2-markers.json` the ~61 smallest territories (< 1000 km²) appear as `Point` geometries with `"marker": true` in their properties. All features share the same properties schema.
|
|
28
38
|
|
|
29
39
|
## Usage
|
|
30
40
|
|
|
@@ -98,8 +108,16 @@ svg.selectAll("circle")
|
|
|
98
108
|
| `name` | `string` | Common English name |
|
|
99
109
|
| `sovereign` | `string` | Sovereign state name (same as `name` for independent countries) |
|
|
100
110
|
| `type` | `string` | `"country"`, `"territory"`, `"disputed"`, or `"dependency"` |
|
|
101
|
-
| `marker` | `boolean` | `true` if this feature is a Point marker (markers
|
|
102
|
-
| `area_km2` | `number` | Area in km² (markers
|
|
111
|
+
| `marker` | `boolean` | `true` if this feature is a Point marker (markers files only) |
|
|
112
|
+
| `area_km2` | `number` | Area in km² (markers files only, for classified features) |
|
|
113
|
+
|
|
114
|
+
### Biome-specific properties (biomes variant only)
|
|
115
|
+
|
|
116
|
+
| Property | Type | Description |
|
|
117
|
+
|----------|------|-------------|
|
|
118
|
+
| `biome_id` | `string` | Biome identifier, e.g. `"US-ALASKA"`, `"RU-SIBERIA"` |
|
|
119
|
+
| `short` | `string` | Short display name, e.g. `"Alaska"`, `"Siberia"` |
|
|
120
|
+
| `aurora_zone` | `boolean` | Whether the biome is in the aurora viewing zone |
|
|
103
121
|
|
|
104
122
|
## Coverage
|
|
105
123
|
|
|
@@ -114,9 +132,9 @@ All 250 entries (249 ISO 3166-1 alpha-2 + Kosovo `XK` quasi-ISO) are included as
|
|
|
114
132
|
- Norwegian territories (SJ)
|
|
115
133
|
- Chinese SARs (HK, MO)
|
|
116
134
|
- Disputed / quasi-ISO (EH, PS, TW, XK)
|
|
117
|
-
- And many more
|
|
135
|
+
- And many more...
|
|
118
136
|
|
|
119
|
-
All 250 entries appear as polygons in `iso-a2.json`. Bouvet Island (BV, ~55 km²) is extracted from the NE physical land layer since it is absent from the admin layers. In `iso-a2-markers.json`, the ~
|
|
137
|
+
All 250 entries appear as polygons in `iso-a2.json`. Bouvet Island (BV, ~55 km²) is extracted from the NE physical land layer since it is absent from the admin layers. In `iso-a2-markers.json`, the ~61 smallest territories are replaced with centroid point markers.
|
|
120
138
|
|
|
121
139
|
## Build
|
|
122
140
|
|
|
@@ -129,13 +147,21 @@ make all
|
|
|
129
147
|
Full pipeline:
|
|
130
148
|
|
|
131
149
|
1. **venv** — creates `.venv` and installs Python dependencies
|
|
132
|
-
2. **check** — lint (`ruff`, `black`), type-check (`mypy`), tests (`pytest`,
|
|
150
|
+
2. **check** — lint (`ruff`, `black`), type-check (`mypy`), tests (`pytest`, >= 80% coverage)
|
|
133
151
|
3. **download** — fetches Natural Earth 10m shapefiles
|
|
134
|
-
4. **build** — assembles 250 GeoJSON features via direct matches, subunit extractions, admin-1 merges, island bbox extractions, and disputed-area overlays
|
|
135
|
-
5. **simplify** — runs `mapshaper` at **3% vertex retention**
|
|
136
|
-
6. **markers** — replaces polygons <
|
|
152
|
+
4. **build** — assembles 250 GeoJSON features via direct matches, subunit extractions, admin-1 merges, island bbox extractions, and disputed-area overlays -> `output/merged.geojson`
|
|
153
|
+
5. **simplify** — runs `mapshaper` at **3% vertex retention** -> `output/iso-a2.json` (204 KB)
|
|
154
|
+
6. **markers** — replaces polygons < 1000 km² with centroid point markers -> `output/iso-a2-markers.json` (245 KB)
|
|
137
155
|
7. **validate** — checks all expected codes are present and valid
|
|
138
|
-
8. **dist** — copies
|
|
156
|
+
8. **dist** — copies output files to the repo root
|
|
157
|
+
|
|
158
|
+
### Biomes build
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
make build-biomes dist-biomes
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Subdivides 30 large countries into climate/travel zones using admin-1 province boundaries and produces `iso-a2-markers-biomes.json` (322 KB, 315 features).
|
|
139
165
|
|
|
140
166
|
### Tuning simplification
|
|
141
167
|
|
|
@@ -148,10 +174,10 @@ make simplify SIMPLIFY=1% # more compression (smaller file)
|
|
|
148
174
|
|
|
149
175
|
```bash
|
|
150
176
|
make serve
|
|
151
|
-
#
|
|
177
|
+
# -> http://localhost:8000/viewer.html
|
|
152
178
|
```
|
|
153
179
|
|
|
154
|
-
Renders all features coloured by type (country / territory / disputed / dependency). Toggle between Full and
|
|
180
|
+
Renders all features coloured by type (country / territory / disputed / dependency). Toggle between Full, Markers, and Biomes variants. Hover for iso_a2, name, sovereign, type, and area.
|
|
155
181
|
|
|
156
182
|
## Data Sources
|
|
157
183
|
|