mapshaper 0.6.16 → 0.6.18

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/package.json CHANGED
@@ -1,89 +1,97 @@
1
1
  {
2
- "name": "mapshaper",
3
- "version": "0.6.16",
4
- "description": "A tool for editing vector datasets for mapping and GIS.",
5
- "keywords": [
6
- "shapefile",
7
- "topojson",
8
- "geojson",
9
- "cartography",
10
- "simplification",
11
- "topology",
12
- "csv",
13
- "gis"
14
- ],
15
- "author": "Matthew Bloch <masiyou@gmail.com>",
16
- "contributors": [],
17
- "license": "MPL-2.0",
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/mbloch/mapshaper"
21
- },
22
- "engines": {
23
- "node": ">=12.0.0"
24
- },
25
- "scripts": {
26
- "test": "mocha test",
27
- "build": "rollup --config",
28
- "lint": "eslint --ext mjs src/",
29
- "prepublishOnly": "npm lint; npm test; ./pre-publish",
30
- "postpublish": "./release_web_ui; ./release_github_version",
31
- "browserify": "browserify -r sync-request -r mproj -r buffer -r iconv-lite -r fs -r flatbush -r rw -r path -r kdbush -r @tmcw/togeojson -r @placemarkio/tokml -r bson -o www/modules.js",
32
- "dev": "rollup --config --watch"
33
- },
34
- "main": "./mapshaper.js",
35
- "files": [
36
- "/bin/**",
37
- "/www/**",
38
- "!/www/nacis/**",
39
- "/mapshaper.js",
40
- "!.DS_Store"
41
- ],
42
- "dependencies": {
43
- "@placemarkio/tokml": "^0.3.3",
44
- "@tmcw/togeojson": "^5.5.0",
45
- "@xmldom/xmldom": "^0.8.6",
46
- "adm-zip": "^0.5.9",
47
- "bson": "^4.7.0",
48
- "commander": "7.0.0",
49
- "cookies": "^0.8.0",
50
- "d3-color": "3.1.0",
51
- "d3-interpolate": "^3.0.1",
52
- "d3-scale-chromatic": "3.0.0",
53
- "delaunator": "^5.0.0",
54
- "fflate": "^0.7.4",
55
- "flatbush": "^3.2.1",
56
- "geokdbush": "^1.1.0",
57
- "iconv-lite": "^0.6.3",
58
- "kdbush": "^3.0.0",
59
- "mproj": "0.0.35",
60
- "opn": "^5.3.0",
61
- "rw": "~1.3.3",
62
- "sync-request": "5.0.0",
63
- "tinyqueue": "^2.0.3"
64
- },
65
- "devDependencies": {
66
- "@rollup/plugin-node-resolve": "^13.3.0",
67
- "browserify": "^17.0.0",
68
- "csv-spectrum": "^1.0.0",
69
- "eslint": "^8.16.0",
70
- "mocha": "^10.0.0",
71
- "rollup": "^2.73.0",
72
- "shell-quote": "^1.7.4",
73
- "underscore": "^1.13.1"
74
- },
75
- "mocha": {
76
- "reporter": "dot",
77
- "node-option": [
78
- "experimental-specifier-resolution=node"
79
- ],
80
- "check-leaks": true,
81
- "parallel": true,
82
- "jobs": 4
83
- },
84
- "bin": {
85
- "mapshaper": "./bin/mapshaper",
86
- "mapshaper-gui": "./bin/mapshaper-gui",
87
- "mapshaper-xl": "./bin/mapshaper-xl"
88
- }
2
+ "name": "mapshaper",
3
+ "version": "0.6.18",
4
+ "description": "A tool for editing vector datasets for mapping and GIS.",
5
+ "keywords": [
6
+ "shapefile",
7
+ "topojson",
8
+ "geojson",
9
+ "cartography",
10
+ "simplification",
11
+ "topology",
12
+ "csv",
13
+ "gis"
14
+ ],
15
+ "author": "Matthew Bloch <masiyou@gmail.com>",
16
+ "contributors": [],
17
+ "license": "MPL-2.0",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/mbloch/mapshaper.git"
21
+ },
22
+ "engines": {
23
+ "node": ">=12.0.0"
24
+ },
25
+ "scripts": {
26
+ "test": "mocha test",
27
+ "build": "rollup --config",
28
+ "lint": "eslint --ext mjs src/",
29
+ "prepublishOnly": "npm lint; npm test; ./pre-publish",
30
+ "postpublish": "./release_web_ui; ./release_github_version",
31
+ "browserify": "browserify -r sync-request -r mproj -r buffer -r iconv-lite -r fs -r flatbush -r rw -r path -r kdbush -r @tmcw/togeojson -r @placemarkio/tokml -o www/modules.js",
32
+ "dev": "rollup --config --watch"
33
+ },
34
+ "main": "./mapshaper.js",
35
+ "files": [
36
+ "/bin/**",
37
+ "/www/**",
38
+ "!/www/nacis/**",
39
+ "/mapshaper.js",
40
+ "!.DS_Store"
41
+ ],
42
+ "dependencies": {
43
+ "@msgpack/msgpack": "^2.8.0",
44
+ "@placemarkio/tokml": "^0.3.3",
45
+ "@tmcw/togeojson": "^5.6.0",
46
+ "@xmldom/xmldom": "^0.8.6",
47
+ "adm-zip": "^0.5.9",
48
+ "bson": "^4.7.0",
49
+ "commander": "7.0.0",
50
+ "cookies": "^0.8.0",
51
+ "d3-color": "3.1.0",
52
+ "d3-interpolate": "^3.0.1",
53
+ "d3-scale-chromatic": "3.0.0",
54
+ "delaunator": "^5.0.0",
55
+ "fflate": "^0.7.4",
56
+ "flatbush": "^3.2.1",
57
+ "geokdbush": "^1.1.0",
58
+ "iconv-lite": "^0.6.3",
59
+ "kdbush": "^3.0.0",
60
+ "mproj": "0.0.35",
61
+ "opn": "^5.3.0",
62
+ "rw": "~1.3.3",
63
+ "sync-request": "5.0.0",
64
+ "tinyqueue": "^2.0.3"
65
+ },
66
+ "devDependencies": {
67
+ "@rollup/plugin-node-resolve": "^13.3.0",
68
+ "browserify": "^17.0.0",
69
+ "csv-spectrum": "^1.0.0",
70
+ "eslint": "^8.16.0",
71
+ "mocha": "^10.0.0",
72
+ "rollup": "^2.73.0",
73
+ "shell-quote": "^1.7.4",
74
+ "underscore": "^1.13.1"
75
+ },
76
+ "mocha": {
77
+ "reporter": "dot",
78
+ "node-option": [
79
+ "experimental-specifier-resolution=node"
80
+ ],
81
+ "check-leaks": true,
82
+ "parallel": true,
83
+ "jobs": 4
84
+ },
85
+ "bin": {
86
+ "mapshaper": "bin/mapshaper",
87
+ "mapshaper-gui": "bin/mapshaper-gui",
88
+ "mapshaper-xl": "bin/mapshaper-xl"
89
+ },
90
+ "bugs": {
91
+ "url": "https://github.com/mbloch/mapshaper/issues"
92
+ },
93
+ "homepage": "https://github.com/mbloch/mapshaper#readme",
94
+ "directories": {
95
+ "test": "test"
96
+ }
89
97
  }
@@ -1552,7 +1552,9 @@
1552
1552
  }
1553
1553
 
1554
1554
  async function readZipFile(file) {
1555
- var index = internal.unzipSync(file.content);
1555
+ // Async is up to twice as fast unzipping large files
1556
+ // var index = internal.unzipSync(file.content);
1557
+ var index = await runAsync(internal.unzipAsync, file.content);
1556
1558
  return Object.keys(index).reduce(function(memo, filename) {
1557
1559
  if (!/\.txt$/i.test(filename)) {
1558
1560
  memo.push({
@@ -3245,15 +3247,15 @@
3245
3247
  function updateLayerStackOrder(layers) {
3246
3248
  // 1. assign ascending ids to unassigned layers above the range of other layers
3247
3249
  layers.forEach(function(o, i) {
3248
- if (!o.layer.stack_id) o.layer.stack_id = 1e6 + i;
3250
+ if (!o.layer.menu_order) o.layer.menu_order = 1e6 + i;
3249
3251
  });
3250
3252
  // 2. sort in ascending order
3251
3253
  layers.sort(function(a, b) {
3252
- return a.layer.stack_id - b.layer.stack_id;
3254
+ return a.layer.menu_order - b.layer.menu_order;
3253
3255
  });
3254
3256
  // 3. assign consecutve ids
3255
3257
  layers.forEach(function(o, i) {
3256
- o.layer.stack_id = i + 1;
3258
+ o.layer.menu_order = i + 1;
3257
3259
  });
3258
3260
  return layers;
3259
3261
  }
@@ -3533,8 +3535,8 @@
3533
3535
  }
3534
3536
 
3535
3537
  function LayerControl(gui) {
3536
- var map = gui.map;
3537
3538
  var model = gui.model;
3539
+ var map = gui.map;
3538
3540
  var el = gui.container.findChild(".layer-control").on('click', GUI.handleDirectEvent(gui.clearMode));
3539
3541
  var btn = gui.container.findChild('.layer-control-btn');
3540
3542
  var isOpen = false;
@@ -3615,7 +3617,7 @@
3615
3617
  var dropLyr = findLayerById(dropId);
3616
3618
  var slug;
3617
3619
  if (dragId == dropId) return;
3618
- dragLyr.layer.stack_id = dropLyr.layer.stack_id + (above ? 0.5 : -0.5);
3620
+ dragLyr.layer.menu_order = dropLyr.layer.menu_order + (above ? 0.5 : -0.5);
3619
3621
  slug = getLayerOrderSlug();
3620
3622
  if (slug != layerOrderSlug) {
3621
3623
  layerOrderSlug = slug;
@@ -10730,8 +10732,8 @@
10730
10732
 
10731
10733
  function sortMapLayers(layers) {
10732
10734
  layers.sort(function(a, b) {
10733
- // assume that each layer has a stack_id (assigned by updateLayerStackOrder())
10734
- return a.source.layer.stack_id - b.source.layer.stack_id;
10735
+ // assume that each layer has a menu_order (assigned by updateLayerStackOrder())
10736
+ return a.source.layer.menu_order - b.source.layer.menu_order;
10735
10737
  });
10736
10738
  }
10737
10739
 
@@ -10758,7 +10760,7 @@
10758
10760
  _ext.setFrame(isPreviewView() ? getFrameData() : null);
10759
10761
  _ext.setFullBounds(getFullBounds(), getStrictBounds());
10760
10762
  updateLayerStyles(contentLayers);
10761
- updateLayerStackOrder(model.getLayers());// update stack_id property of all layers
10763
+ updateLayerStackOrder(model.getLayers());// update menu_order property of all layers
10762
10764
  }
10763
10765
  sortMapLayers(contentLayers);
10764
10766
  if (_intersectionLyr) {