@india-boundary-corrector/data 0.0.4 → 0.1.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 CHANGED
@@ -8,19 +8,29 @@ PMTiles data package for India boundary corrections.
8
8
 
9
9
  ## Layers
10
10
 
11
- The PMTiles file contains 4 layers:
11
+ The PMTiles file contains 10 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
+
26
+ 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.
27
+
28
+ The `-internal` layers handle internal state boundaries within India's claimed territory. `to-del-osm-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.
19
29
 
20
30
  ## Usage
21
31
 
22
32
  ```javascript
23
- import { layers, getPmtilesUrl, setPmtilesUrl, getDataVersion } from '@india-boundary-corrector/data';
33
+ import { getPmtilesUrl, setPmtilesUrl, getDataVersion } from '@india-boundary-corrector/data';
24
34
 
25
35
  // Get URL to PMTiles file (auto-detected from environment)
26
36
  const url = getPmtilesUrl();
package/data_version.js CHANGED
@@ -1 +1 @@
1
- export const dataVersion = 'osm_20251210_231743_ne_5.1.1';
1
+ export const dataVersion = 'osm_20260109_024608_ne_5.1.1';
package/index.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- /**
2
- * Layer names in the PMTiles file
3
- */
4
- export const layers: {
5
- toAddOsm: string;
6
- toDelOsm: string;
7
- toAddNe: string;
8
- toDelNe: string;
9
- };
10
-
11
1
  /**
12
2
  * Default CDN URL for the PMTiles file (jsDelivr with pinned version)
13
3
  */
package/index.js CHANGED
@@ -3,14 +3,18 @@ import { packageVersion } from './version.js';
3
3
 
4
4
  // Package info for CDN URL construction
5
5
  const PACKAGE_NAME = '@india-boundary-corrector/data';
6
- const PMTILES_FILENAME = 'india_boundary_corrections.pmtiles';
6
+
7
+ // Use .gz suffix for CDN to work around transparent compression issues
8
+ // See pmtiles-filename-note.md for details
9
+ const PMTILES_FILENAME = 'india_boundary_corrections.pmtiles.gz';
10
+ // Original filename (for local use where CDN issues don't apply):
11
+ // const PMTILES_FILENAME = 'india_boundary_corrections.pmtiles';
7
12
 
8
13
  /**
9
14
  * CDNs that need fallback to jsDelivr:
10
15
  * - esm.sh, skypack: JS module transformers only, don't serve static files
11
- * - unpkg.com: Has issues serving PMTiles files (incorrect content-type, range request problems)
12
16
  */
13
- const FALLBACK_CDNS = new Set(['esm.sh', 'skypack.dev', 'cdn.skypack.dev', 'unpkg.com']);
17
+ const FALLBACK_CDNS = new Set(['esm.sh', 'skypack.dev', 'cdn.skypack.dev']);
14
18
 
15
19
  // Default fallback CDN (jsDelivr has multi-CDN architecture, more reliable)
16
20
  export const DEFAULT_CDN_URL = `https://cdn.jsdelivr.net/npm/${PACKAGE_NAME}@${packageVersion}/${PMTILES_FILENAME}`;
@@ -18,16 +22,6 @@ export const DEFAULT_CDN_URL = `https://cdn.jsdelivr.net/npm/${PACKAGE_NAME}@${p
18
22
  // Capture document.currentScript.src at module load time (becomes null after script executes)
19
23
  const CURRENT_SCRIPT_URL = (typeof document !== 'undefined' && document.currentScript && document.currentScript.src) || null;
20
24
 
21
- /**
22
- * Layer names in the PMTiles file
23
- */
24
- export const layers = {
25
- toAddOsm: 'to-add-osm',
26
- toDelOsm: 'to-del-osm',
27
- toAddNe: 'to-add-ne',
28
- toDelNe: 'to-del-ne',
29
- };
30
-
31
25
  /**
32
26
  * Detect the PMTiles URL from various sources:
33
27
  * 1. import.meta.url (for ESM bundlers - most reliable)
@@ -56,12 +50,7 @@ function detectPmtilesUrl() {
56
50
  }
57
51
 
58
52
  if (scriptUrl) {
59
- const moduleUrl = new URL('.', scriptUrl);
60
- // JS-only CDNs don't serve static files, fall back to default
61
- if (FALLBACK_CDNS.has(moduleUrl.hostname)) {
62
- return DEFAULT_CDN_URL;
63
- }
64
- return new URL(PMTILES_FILENAME, moduleUrl).href;
53
+ return resolvePmtilesUrl(scriptUrl);
65
54
  }
66
55
 
67
56
  // Fallback to CDN with pinned version
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@india-boundary-corrector/data",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "PMTiles data for India boundary corrections (NE and OSM layers)",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -10,14 +10,16 @@
10
10
  "import": "./index.js",
11
11
  "types": "./index.d.ts"
12
12
  },
13
- "./pmtiles": "./india_boundary_corrections.pmtiles"
13
+ "./pmtiles": "./india_boundary_corrections.pmtiles",
14
+ "./pmtiles-gz": "./india_boundary_corrections.pmtiles.gz"
14
15
  },
15
16
  "files": [
16
17
  "index.js",
17
18
  "index.d.ts",
18
19
  "version.js",
19
20
  "data_version.js",
20
- "india_boundary_corrections.pmtiles"
21
+ "india_boundary_corrections.pmtiles",
22
+ "india_boundary_corrections.pmtiles.gz"
21
23
  ],
22
24
  "scripts": {
23
25
  "build": "node scripts/generate-version.js",
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.4';
2
+ export const packageVersion = '0.1.0';