@india-boundary-corrector/data 0.0.5 → 0.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/README.md +14 -2
- package/data_version.js +1 -1
- package/index.d.ts +0 -10
- package/index.js +3 -17
- package/india_boundary_corrections.pmtiles +0 -0
- package/india_boundary_corrections.pmtiles.gz +0 -0
- package/package.json +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -8,19 +8,31 @@ PMTiles data package for India boundary corrections.
|
|
|
8
8
|
|
|
9
9
|
## Layers
|
|
10
10
|
|
|
11
|
-
The PMTiles file contains
|
|
11
|
+
The PMTiles file contains 12 layers:
|
|
12
12
|
|
|
13
13
|
| Layer | Description |
|
|
14
14
|
|-------|-------------|
|
|
15
15
|
| `to-add-osm` | Boundary lines to add over OSM-based tiles (higher zoom) |
|
|
16
16
|
| `to-del-osm` | Boundary lines to mask/delete from OSM-based tiles |
|
|
17
|
+
| `to-add-osm-disp` | Disputed boundary lines to add over OSM-based tiles |
|
|
18
|
+
| `to-del-osm-disp` | Disputed boundary lines to delete from OSM-based tiles (same as add-disp) |
|
|
19
|
+
| `to-add-osm-internal` | Internal state boundary lines to add (Indian states within claimed territory) |
|
|
20
|
+
| `to-del-osm-internal` | Internal boundary lines to delete (Chinese state boundaries within India's claimed territory) |
|
|
17
21
|
| `to-add-ne` | Boundary lines to add over Natural Earth tiles (lower zoom) |
|
|
18
22
|
| `to-del-ne` | Boundary lines to mask/delete from Natural Earth tiles |
|
|
23
|
+
| `to-add-ne-disp` | Disputed boundary lines to add over Natural Earth tiles |
|
|
24
|
+
| `to-del-ne-disp` | Disputed boundary lines to delete from Natural Earth tiles (same as add-disp) |
|
|
25
|
+
| `to-add-ne-internal` | Internal state boundary lines to add over Natural Earth tiles (J&K + PoK combined) |
|
|
26
|
+
| `to-del-ne-internal` | Internal boundary lines to delete from Natural Earth tiles (Chinese state boundaries within India's claimed territory) |
|
|
27
|
+
|
|
28
|
+
The `-disp` layers contain boundaries of disputed regions that fall on India's official boundary. These are boundaries that India claims but are disputed by China or Pakistan. The `to-del-*-disp` layers are identical to `to-add-*-disp` layers - they delete the original lines at the same location where the corrected disputed lines are drawn.
|
|
29
|
+
|
|
30
|
+
The `-internal` layers handle internal state boundaries within India's claimed territory. `to-del-*-internal` contains Chinese state boundaries (e.g., Tibet) that fall within India's claimed boundary. `to-add-osm-internal` contains Indian state boundaries (e.g., Ladakh, Jammu and Kashmir, Arunachal Pradesh) that overlap with the main deletion areas. `to-add-ne-internal` contains India's official J&K boundary (combining Jammu and Kashmir + PoK).
|
|
19
31
|
|
|
20
32
|
## Usage
|
|
21
33
|
|
|
22
34
|
```javascript
|
|
23
|
-
import {
|
|
35
|
+
import { getPmtilesUrl, setPmtilesUrl, getDataVersion } from '@india-boundary-corrector/data';
|
|
24
36
|
|
|
25
37
|
// Get URL to PMTiles file (auto-detected from environment)
|
|
26
38
|
const url = getPmtilesUrl();
|
package/data_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const dataVersion = '
|
|
1
|
+
export const dataVersion = 'osm_20260109_024608_ne_5.1.1';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -13,8 +13,9 @@ const PMTILES_FILENAME = 'india_boundary_corrections.pmtiles.gz';
|
|
|
13
13
|
/**
|
|
14
14
|
* CDNs that need fallback to jsDelivr:
|
|
15
15
|
* - esm.sh, skypack: JS module transformers only, don't serve static files
|
|
16
|
+
* - unpkg.com: has problems with content-length headers and range requests for .pmtiles files
|
|
16
17
|
*/
|
|
17
|
-
const FALLBACK_CDNS = new Set(['esm.sh', 'skypack.dev', 'cdn.skypack.dev']);
|
|
18
|
+
const FALLBACK_CDNS = new Set(['esm.sh', 'skypack.dev', 'cdn.skypack.dev', 'unpkg.com']);
|
|
18
19
|
|
|
19
20
|
// Default fallback CDN (jsDelivr has multi-CDN architecture, more reliable)
|
|
20
21
|
export const DEFAULT_CDN_URL = `https://cdn.jsdelivr.net/npm/${PACKAGE_NAME}@${packageVersion}/${PMTILES_FILENAME}`;
|
|
@@ -22,16 +23,6 @@ export const DEFAULT_CDN_URL = `https://cdn.jsdelivr.net/npm/${PACKAGE_NAME}@${p
|
|
|
22
23
|
// Capture document.currentScript.src at module load time (becomes null after script executes)
|
|
23
24
|
const CURRENT_SCRIPT_URL = (typeof document !== 'undefined' && document.currentScript && document.currentScript.src) || null;
|
|
24
25
|
|
|
25
|
-
/**
|
|
26
|
-
* Layer names in the PMTiles file
|
|
27
|
-
*/
|
|
28
|
-
export const layers = {
|
|
29
|
-
toAddOsm: 'to-add-osm',
|
|
30
|
-
toDelOsm: 'to-del-osm',
|
|
31
|
-
toAddNe: 'to-add-ne',
|
|
32
|
-
toDelNe: 'to-del-ne',
|
|
33
|
-
};
|
|
34
|
-
|
|
35
26
|
/**
|
|
36
27
|
* Detect the PMTiles URL from various sources:
|
|
37
28
|
* 1. import.meta.url (for ESM bundlers - most reliable)
|
|
@@ -60,12 +51,7 @@ function detectPmtilesUrl() {
|
|
|
60
51
|
}
|
|
61
52
|
|
|
62
53
|
if (scriptUrl) {
|
|
63
|
-
|
|
64
|
-
// JS-only CDNs don't serve static files, fall back to default
|
|
65
|
-
if (FALLBACK_CDNS.has(moduleUrl.hostname)) {
|
|
66
|
-
return DEFAULT_CDN_URL;
|
|
67
|
-
}
|
|
68
|
-
return new URL(PMTILES_FILENAME, moduleUrl).href;
|
|
54
|
+
return resolvePmtilesUrl(scriptUrl);
|
|
69
55
|
}
|
|
70
56
|
|
|
71
57
|
// Fallback to CDN with pinned version
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated by scripts/generate-version.js - DO NOT EDIT
|
|
2
|
-
export const packageVersion = '0.0
|
|
2
|
+
export const packageVersion = '0.2.0';
|