@rembish/iso-topojson 1.2.0 → 1.3.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 +35 -10
- 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
|
|
@@ -23,6 +24,15 @@ https://unpkg.com/@rembish/iso-topojson/iso-a2-markers.json
|
|
|
23
24
|
|------|------|-------------|
|
|
24
25
|
| `iso-a2.json` | 204 KB | Full-detail TopoJSON, 250 polygon features |
|
|
25
26
|
| `iso-a2-markers.json` | 246 KB | Compact variant: tiny territories (< 500 km²) replaced with Point markers |
|
|
27
|
+
| `iso-a2-markers-biomes.json` | 317 KB | Biomes variant: 25 large countries subdivided into 83 climate/travel zones |
|
|
28
|
+
|
|
29
|
+
### Biomes variant
|
|
30
|
+
|
|
31
|
+
`iso-a2-markers-biomes.json` replaces 25 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) and Russia into 4 (West, North, Siberia, Far East).
|
|
32
|
+
|
|
33
|
+
Countries with biome subdivisions: AR, AU, BR, CA, CL, CN, CO, ES, FI, GR, ID, IN, IT, JP, MX, NO, NZ, PE, RU, SE, TH, TR, US, VN, ZA.
|
|
34
|
+
|
|
35
|
+
The remaining 225 countries appear as single polygons, same as in `iso-a2-markers.json`. Tiny territories are Point markers. Total: 308 features (258 polygons + 50 point markers).
|
|
26
36
|
|
|
27
37
|
In `iso-a2-markers.json` the ~50 smallest territories (Maldives, Malta, Liechtenstein, most Caribbean islands, etc.) appear as `Point` geometries with `"marker": true` in their properties. All features share the same properties schema.
|
|
28
38
|
|
|
@@ -98,8 +108,15 @@ 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
|
+
| `aurora_zone` | `boolean` | Whether the biome is in the aurora viewing zone |
|
|
103
120
|
|
|
104
121
|
## Coverage
|
|
105
122
|
|
|
@@ -114,7 +131,7 @@ All 250 entries (249 ISO 3166-1 alpha-2 + Kosovo `XK` quasi-ISO) are included as
|
|
|
114
131
|
- Norwegian territories (SJ)
|
|
115
132
|
- Chinese SARs (HK, MO)
|
|
116
133
|
- Disputed / quasi-ISO (EH, PS, TW, XK)
|
|
117
|
-
- And many more
|
|
134
|
+
- And many more...
|
|
118
135
|
|
|
119
136
|
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 ~50 smallest territories are replaced with centroid point markers.
|
|
120
137
|
|
|
@@ -129,13 +146,21 @@ make all
|
|
|
129
146
|
Full pipeline:
|
|
130
147
|
|
|
131
148
|
1. **venv** — creates `.venv` and installs Python dependencies
|
|
132
|
-
2. **check** — lint (`ruff`, `black`), type-check (`mypy`), tests (`pytest`,
|
|
149
|
+
2. **check** — lint (`ruff`, `black`), type-check (`mypy`), tests (`pytest`, >= 80% coverage)
|
|
133
150
|
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 < 500 km² with centroid point markers
|
|
151
|
+
4. **build** — assembles 250 GeoJSON features via direct matches, subunit extractions, admin-1 merges, island bbox extractions, and disputed-area overlays -> `output/merged.geojson`
|
|
152
|
+
5. **simplify** — runs `mapshaper` at **3% vertex retention** -> `output/iso-a2.json` (204 KB)
|
|
153
|
+
6. **markers** — replaces polygons < 500 km² with centroid point markers -> `output/iso-a2-markers.json` (246 KB)
|
|
137
154
|
7. **validate** — checks all expected codes are present and valid
|
|
138
|
-
8. **dist** — copies
|
|
155
|
+
8. **dist** — copies output files to the repo root
|
|
156
|
+
|
|
157
|
+
### Biomes build
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
make build-biomes dist-biomes
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Subdivides 25 large countries into climate/travel zones using admin-1 province boundaries and produces `iso-a2-markers-biomes.json` (317 KB, 308 features).
|
|
139
164
|
|
|
140
165
|
### Tuning simplification
|
|
141
166
|
|
|
@@ -148,10 +173,10 @@ make simplify SIMPLIFY=1% # more compression (smaller file)
|
|
|
148
173
|
|
|
149
174
|
```bash
|
|
150
175
|
make serve
|
|
151
|
-
#
|
|
176
|
+
# -> http://localhost:8000/viewer.html
|
|
152
177
|
```
|
|
153
178
|
|
|
154
|
-
Renders all features coloured by type (country / territory / disputed / dependency). Toggle between Full and
|
|
179
|
+
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
180
|
|
|
156
181
|
## Data Sources
|
|
157
182
|
|