mapshaper 0.7.10 → 0.7.11

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/mapshaper.js CHANGED
@@ -17021,7 +17021,8 @@
17021
17021
  var groups = groupPolygonRings(obj.pathData, arcs, opts.invert_y);
17022
17022
  // invert_y is used internally for SVG generation
17023
17023
  // mapshaper's internal winding order is the opposite of RFC 7946
17024
- var reverse = opts.rfc7946 && !opts.invert_y;
17024
+ var rfc7946 = opts.rfc7946 === true;
17025
+ var reverse = rfc7946 !== !!opts.reverse_winding && !opts.invert_y;
17025
17026
  var coords = groups.map(function(paths) {
17026
17027
  return paths.map(function(path) {
17027
17028
  if (reverse) path.points.reverse();
@@ -26408,37 +26409,25 @@ ${svg}
26408
26409
  async function loadZstdLib() {
26409
26410
  var mod;
26410
26411
  if (runningInBrowser()) {
26411
- mod = require$1('zstd-codec');
26412
+ mod = require$1('@bokuweb/zstd-wasm');
26412
26413
  } else {
26413
26414
  if (!zstdPromise) {
26414
- zstdPromise = dynamicImportModule$1('zstd-codec');
26415
+ zstdPromise = dynamicImportModule$1('@bokuweb/zstd-wasm');
26415
26416
  }
26416
26417
  mod = await zstdPromise;
26417
26418
  }
26418
- if (mod && mod.default && !mod.ZstdCodec) {
26419
+ if (mod && mod.default && !mod.compress) {
26419
26420
  mod = mod.default;
26420
26421
  }
26421
- if (!mod || !mod.ZstdCodec || typeof mod.ZstdCodec.run != 'function') {
26422
+ if (!mod || typeof mod.init != 'function' || typeof mod.compress != 'function') {
26422
26423
  stop$1('GeoParquet ZSTD compressor is not loaded');
26423
26424
  }
26424
- return initZstdCodec(mod.ZstdCodec);
26425
+ await mod.init();
26426
+ return initZstdCodec(mod);
26425
26427
  }
26426
26428
 
26427
26429
  function initZstdCodec(codec) {
26428
- return new Promise(function(resolve, reject) {
26429
- try {
26430
- codec.run(function(zstd) {
26431
- var simple = new zstd.Simple();
26432
- resolve({
26433
- compress: function(bytes, level) {
26434
- return simple.compress(bytes, level);
26435
- }
26436
- });
26437
- });
26438
- } catch (e) {
26439
- reject(e);
26440
- }
26441
- });
26430
+ return codec;
26442
26431
  }
26443
26432
 
26444
26433
  function getOutputFormat(dataset, opts) {
@@ -29145,6 +29134,10 @@ ${svg}
29145
29134
  describe: '[GeoJSON] use original GeoJSON spec (not RFC 7946)',
29146
29135
  type: 'flag'
29147
29136
  })
29137
+ .option('reverse-winding', {
29138
+ describe: '[GeoJSON] reverse polygon winding order',
29139
+ type: 'flag'
29140
+ })
29148
29141
  .option('rfc7946', {
29149
29142
  // dummy option so old commands do not break
29150
29143
  type: 'flag'
@@ -34623,8 +34616,8 @@ ${svg}
34623
34616
  var candidates = getGeoParquetCrsStrings(crs);
34624
34617
  for (var i = 0; i < candidates.length; i++) {
34625
34618
  try {
34626
- parseCrsString$1(candidates[i]);
34627
34619
  await initProjLibrary({crs: candidates[i]});
34620
+ parseCrsString$1(candidates[i]);
34628
34621
  return candidates[i];
34629
34622
  } catch (e) {
34630
34623
  // Keep trying candidates; if none initialize, caller will warn.
@@ -55438,7 +55431,7 @@ ${svg}
55438
55431
  });
55439
55432
  }
55440
55433
 
55441
- var version = "0.7.10";
55434
+ var version = "0.7.11";
55442
55435
 
55443
55436
  // Parse command line args into commands and run them
55444
55437
  // Function takes an optional Node-style callback. A Promise is returned if no callback is given.
@@ -55496,8 +55489,10 @@ ${svg}
55496
55489
  var child = require$1('child_process').exec(command, {}, function(err, stdout, stderr) {
55497
55490
  opts.callback(err);
55498
55491
  });
55499
- child.stdout.pipe(process.stdout);
55500
- child.stderr.pipe(process.stderr);
55492
+ if (loggingEnabled()) {
55493
+ child.stdout.pipe(process.stdout);
55494
+ child.stderr.pipe(process.stderr);
55495
+ }
55501
55496
  if (opts.promise) return opts.promise;
55502
55497
  }
55503
55498
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
@@ -23,7 +23,7 @@
23
23
  "node": ">=20.11.0"
24
24
  },
25
25
  "scripts": {
26
- "test": "mocha test",
26
+ "test": "mocha --require test/mocha-hooks.mjs test",
27
27
  "build": "rollup --config",
28
28
  "docs": "node build-docs.mjs",
29
29
  "roadmap": "node build-roadmap.mjs",
@@ -45,6 +45,7 @@
45
45
  "!/www/ai-config.js"
46
46
  ],
47
47
  "dependencies": {
48
+ "@bokuweb/zstd-wasm": "^0.0.27",
48
49
  "@ngageoint/geopackage": "^4.2.6",
49
50
  "@placemarkio/tokml": "^0.3.3",
50
51
  "@tmcw/togeojson": "^5.6.0",
@@ -72,8 +73,7 @@
72
73
  "msgpackr": "^1.10.1",
73
74
  "open": "^11.0.0",
74
75
  "rw": "~1.3.3",
75
- "tinyqueue": "^2.0.3",
76
- "zstd-codec": "^0.1.5"
76
+ "tinyqueue": "^2.0.3"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@playwright/test": "^1.59.1",