mapshaper 0.6.121 → 0.7.1

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.
Files changed (86) hide show
  1. package/README.md +5 -3
  2. package/mapshaper.js +1342 -275
  3. package/package.json +5 -2
  4. package/www/assets/jetbrains-mono-regular.woff2 +0 -0
  5. package/www/assets/static-page.css +179 -0
  6. package/www/docs/_assets/cmd-search.js +213 -0
  7. package/www/docs/_assets/docs.css +712 -0
  8. package/www/docs/_assets/docs.js +75 -0
  9. package/www/docs/_assets/highlight.css +10 -0
  10. package/www/docs/essentials/command-line.html +127 -0
  11. package/www/docs/essentials/command-line.html.md +112 -0
  12. package/www/docs/essentials/web-app.html +138 -0
  13. package/www/docs/essentials/web-app.html.md +106 -0
  14. package/www/docs/examples/basics.html +276 -0
  15. package/www/docs/examples/basics.html.md +371 -0
  16. package/www/docs/examples/data/Makefile +31 -0
  17. package/www/docs/examples/data/globe.msx +0 -0
  18. package/www/docs/examples/data/globe.svg +616 -0
  19. package/www/docs/examples/data/globe.txt +21 -0
  20. package/www/docs/examples/data/globe.zip +0 -0
  21. package/www/docs/examples/data/ne_50m_admin_0_countries.geojson +1 -0
  22. package/www/docs/examples/data/ne_50m_admin_1_states_provinces_lakes.geojson +1 -0
  23. package/www/docs/examples/data/us-states.msx +0 -0
  24. package/www/docs/examples/data/us-states.svg +56 -0
  25. package/www/docs/examples/data/us-states.txt +6 -0
  26. package/www/docs/examples/data/us-states.zip +0 -0
  27. package/www/docs/examples/globe.html +108 -0
  28. package/www/docs/examples/globe.html.md +64 -0
  29. package/www/docs/examples/us-states.html +88 -0
  30. package/www/docs/examples/us-states.html.md +44 -0
  31. package/www/docs/formats/csv.html +127 -0
  32. package/www/docs/formats/csv.html.md +97 -0
  33. package/www/docs/formats/dbf.html +87 -0
  34. package/www/docs/formats/dbf.html.md +39 -0
  35. package/www/docs/formats/flatgeobuf.html +86 -0
  36. package/www/docs/formats/flatgeobuf.html.md +42 -0
  37. package/www/docs/formats/geojson.html +107 -0
  38. package/www/docs/formats/geojson.html.md +65 -0
  39. package/www/docs/formats/geopackage.html +87 -0
  40. package/www/docs/formats/geopackage.html.md +42 -0
  41. package/www/docs/formats/json.html +83 -0
  42. package/www/docs/formats/json.html.md +35 -0
  43. package/www/docs/formats/kml.html +82 -0
  44. package/www/docs/formats/kml.html.md +39 -0
  45. package/www/docs/formats/overview.html +192 -0
  46. package/www/docs/formats/overview.html.md +35 -0
  47. package/www/docs/formats/shapefile.html +123 -0
  48. package/www/docs/formats/shapefile.html.md +84 -0
  49. package/www/docs/formats/snapshot.html +87 -0
  50. package/www/docs/formats/snapshot.html.md +39 -0
  51. package/www/docs/formats/svg.html +99 -0
  52. package/www/docs/formats/svg.html.md +51 -0
  53. package/www/docs/formats/topojson.html +102 -0
  54. package/www/docs/formats/topojson.html.md +54 -0
  55. package/www/docs/gallery/index.html +80 -0
  56. package/www/docs/gallery/index.html.md +29 -0
  57. package/www/docs/guides/combining-layers.html +105 -0
  58. package/www/docs/guides/combining-layers.html.md +81 -0
  59. package/www/docs/guides/expressions.html +600 -0
  60. package/www/docs/guides/expressions.html.md +376 -0
  61. package/www/docs/guides/programmatic.html +117 -0
  62. package/www/docs/guides/programmatic.html.md +91 -0
  63. package/www/docs/guides/projections.html +158 -0
  64. package/www/docs/guides/projections.html.md +118 -0
  65. package/www/docs/guides/simplification.html +110 -0
  66. package/www/docs/guides/simplification.html.md +94 -0
  67. package/www/docs/guides/topology.html +90 -0
  68. package/www/docs/guides/topology.html.md +63 -0
  69. package/www/docs/images/simplification-detail.png +0 -0
  70. package/www/docs/images/simplification-dp.png +0 -0
  71. package/www/docs/images/simplification-mod2.png +0 -0
  72. package/www/docs/index.html +101 -0
  73. package/www/docs/index.html.md +59 -0
  74. package/www/docs/reference.html +1302 -0
  75. package/www/docs/reference.html.md +1817 -0
  76. package/www/docs/whats-new.html +76 -0
  77. package/www/docs/whats-new.html.md +53 -0
  78. package/www/index.html +30 -3
  79. package/www/llms-full.txt +4040 -0
  80. package/www/llms.txt +55 -0
  81. package/www/mapshaper-gui.js +7 -1
  82. package/www/mapshaper.js +1342 -275
  83. package/www/page.css +1 -1
  84. package/www/privacy.html +1 -112
  85. package/www/sponsor.html +4 -164
  86. package/www/terms.html +1 -112
@@ -0,0 +1,76 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>What&#39;s new &middot; mapshaper docs</title>
7
+ <meta name="description" content="A curated log of recently added user-visible features in Mapshaper, with links into the rest of the docs.">
8
+ <link rel="icon" type="image/png" href="/images/icon.png">
9
+ <link rel="stylesheet" href="/docs/_assets/highlight.css">
10
+ <link rel="stylesheet" href="/docs/_assets/docs.css">
11
+ </head>
12
+ <body class="">
13
+
14
+ <header class="page-header">
15
+ <a href="/" class="mapshaper-logo">map<span class="logo-highlight">shaper</span></a>
16
+ <span class="header-section-label">Docs</span>
17
+ <nav class="header-nav">
18
+ <a href="/">Web app</a>
19
+ <a href="https://github.com/mbloch/mapshaper">GitHub</a>
20
+ <a href="/sponsor.html" class="sponsor-link"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg> Become a sponsor</a>
21
+ </nav>
22
+ </header>
23
+
24
+ <div class="docs-layout">
25
+
26
+ <aside class="docs-sidebar">
27
+ <div class="sidebar-inner">
28
+ <nav class="docs-nav"><ul class="top-links"><li><a href="/docs/">Home</a></li><li><a href="/docs/whats-new.html" class="is-active">What&#39;s new</a></li><li><a href="/docs/reference.html">Command reference</a></li><li><a href="/docs/gallery/">Gallery</a></li></ul><h2>Getting started</h2><ul><li><a href="/docs/essentials/command-line.html">The command-line tool</a></li><li><a href="/docs/essentials/web-app.html">The web app</a></li></ul><h2>Guides</h2><ul><li><a href="/docs/guides/simplification.html">Simplification</a></li><li><a href="/docs/guides/expressions.html">JavaScript expressions</a></li><li><a href="/docs/guides/projections.html">Projections</a></li><li><a href="/docs/guides/topology.html">Topology and cleaning</a></li><li><a href="/docs/guides/combining-layers.html">Combining two layers</a></li><li><a href="/docs/guides/programmatic.html">Using Mapshaper from Node.js</a></li></ul><h2>Formats</h2><ul><li><a href="/docs/formats/overview.html">Overview</a></li><li><a href="/docs/formats/shapefile.html">Shapefile</a></li><li><a href="/docs/formats/geojson.html">GeoJSON</a></li><li><a href="/docs/formats/topojson.html">TopoJSON</a></li><li><a href="/docs/formats/geopackage.html">GeoPackage</a></li><li><a href="/docs/formats/flatgeobuf.html">FlatGeobuf</a></li><li><a href="/docs/formats/kml.html">KML / KMZ</a></li><li><a href="/docs/formats/csv.html">CSV / TSV</a></li><li><a href="/docs/formats/dbf.html">DBF</a></li><li><a href="/docs/formats/json.html">JSON records</a></li><li><a href="/docs/formats/svg.html">SVG</a></li><li><a href="/docs/formats/snapshot.html">Mapshaper snapshot</a></li></ul><h2>Examples</h2><ul><li><a href="/docs/examples/basics.html">Basics</a></li><li><a href="/docs/examples/globe.html">Globe</a></li><li><a href="/docs/examples/us-states.html">U.S. state map</a></li></ul></nav>
29
+ </div>
30
+ </aside>
31
+
32
+ <main class="docs-main">
33
+ <article class="docs-article">
34
+
35
+ <h1 id="whats-new">What&#39;s new</h1>
36
+ <p>This is a curated list of recently added features. For the full list of changes, including bug fixes and internal work, see the <a href="https://github.com/mbloch/mapshaper/blob/master/CHANGELOG.md">changelog</a> on GitHub.</p>
37
+ <h2 id="april-2026">April 2026</h2>
38
+ <div class="whats-new-entry"><p><strong>Command files.</strong> A sequence of Mapshaper commands can be written to a <code>.txt</code> file with <code>#</code> comments and no shell quoting, and run with <code>-run &lt;file&gt;</code> (or just <code>mapshaper commands.txt</code>). Command files can also be written in a shell-compatible way, if you want to be able to paste the commands into the terminal or add them to a shell script. In a future release, these files will also be runnable in the browser.</p>
39
+ <pre><code class="hljs language-bash">mapshaper build.txt
40
+ </code></pre>
41
+ <p>→ See <a href="/docs/reference.html#command-files">Command files</a> in the reference.</p>
42
+ </div><div class="whats-new-entry"><p><strong>Variable interpolation in commands.</strong> Command files and command lines support <code>{{VAR}}</code> placeholders, resolved at run time against environment variables (<code>{{env.HOME}}</code>), values set with the new <code>-vars</code> and <code>-defaults</code> commands, and variables defined dynamically by <code>-calc</code>, <code>-define</code> and <code>-each</code> expressions.</p>
43
+ <pre><code class="hljs language-bash">mapshaper -vars YEAR=2030 PCT=5 -run build.txt
44
+ </code></pre>
45
+ <p>→ See <a href="/docs/reference.html#variable-interpolation">Variable interpolation</a>, <a href="/docs/reference.html#-vars"><code>-vars</code></a> and <a href="/docs/reference.html#-defaults"><code>-defaults</code></a>.</p>
46
+ </div><div class="whats-new-entry"><p><strong>Farewell to dissolve2.</strong> The <code>-dissolve</code> command now uses Mapshaper&#39;s most robust dissolve function, which can handle overlaps, gaps and other topology errors. The legacy faster algorithm is still available as <code>-dissolve no-repair</code>. (The old <code>-dissolve2</code> is just an alias for <code>-dissolve</code>.)</p>
47
+ <p>→ See <a href="/docs/reference.html#-dissolve"><code>-dissolve</code></a>.</p>
48
+ </div><div class="whats-new-entry"><p><strong>FlatGeobuf and GeoPackage support.</strong> Mapshaper reads and writes FlatGeobuf (<code>.fgb</code>) and GeoPackage (<code>.gpkg</code>) files.</p>
49
+ <p>→ See <a href="/docs/formats/flatgeobuf.html">FlatGeobuf</a>, <a href="/docs/formats/geopackage.html">GeoPackage</a> and <a href="/docs/reference.html#-i-input"><code>-i layers=</code></a>.</p>
50
+ </div><div class="whats-new-entry"><p><strong>SVG import.</strong> SVG files exported by Mapshaper can be re-imported &mdash; useful for making stylistic edits.</p>
51
+ <p>→ See <a href="/docs/formats/svg.html">SVG</a>.</p>
52
+ </div>
53
+
54
+ <div class="edit-link">
55
+ <a href="https://github.com/mbloch/mapshaper/edit/master/docs/whats-new.md">Edit this page on GitHub</a>
56
+ </div>
57
+ </article>
58
+ </main>
59
+
60
+ <aside class="docs-toc">
61
+ <div class="docs-toc-title">On this page</div><ul><li class="lvl-2"><a href="#april-2026">April 2026</a></li></ul>
62
+ </aside>
63
+
64
+ </div>
65
+
66
+ <script src="/docs/_assets/docs.js" defer></script>
67
+
68
+ <footer class="docs-footer">
69
+ <div class="docs-footer-inner">
70
+ <span>mapshaper is free software, licensed under <a href="https://www.mozilla.org/MPL/2.0/">MPL 2.0</a>.</span>
71
+ <span><a href="/privacy.html">Privacy</a> &middot; <a href="/terms.html">Terms</a> &middot; <a href="/sponsor.html">Support mapshaper</a></span>
72
+ </div>
73
+ </footer>
74
+
75
+ </body>
76
+ </html>
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: What's new
3
+ description: A curated log of recently added user-visible features in Mapshaper, with links into the rest of the docs.
4
+ ---
5
+
6
+ # What's new
7
+
8
+ This is a curated list of recently added features. For the full list of changes, including bug fixes and internal work, see the [changelog](https://github.com/mbloch/mapshaper/blob/master/CHANGELOG.md) on GitHub.
9
+
10
+ ## April 2026
11
+
12
+ <div class="whats-new-entry">
13
+
14
+ **Command files.** A sequence of Mapshaper commands can be written to a `.txt` file with `#` comments and no shell quoting, and run with `-run <file>` (or just `mapshaper commands.txt`). Command files can also be written in a shell-compatible way, if you want to be able to paste the commands into the terminal or add them to a shell script. In a future release, these files will also be runnable in the browser.
15
+
16
+ ```bash
17
+ mapshaper build.txt
18
+ ```
19
+
20
+ → See [Command files](/docs/reference.html.md#command-files) in the reference.
21
+ </div>
22
+
23
+ <div class="whats-new-entry">
24
+
25
+ **Variable interpolation in commands.** Command files and command lines support `{{VAR}}` placeholders, resolved at run time against environment variables (`{{env.HOME}}`), values set with the new `-vars` and `-defaults` commands, and variables defined dynamically by `-calc`, `-define` and `-each` expressions.
26
+
27
+ ```bash
28
+ mapshaper -vars YEAR=2030 PCT=5 -run build.txt
29
+ ```
30
+
31
+ → See [Variable interpolation](/docs/reference.html.md#variable-interpolation), [`-vars`](/docs/reference.html.md#-vars) and [`-defaults`](/docs/reference.html.md#-defaults).
32
+ </div>
33
+
34
+ <div class="whats-new-entry">
35
+
36
+ **Farewell to dissolve2.** The `-dissolve` command now uses Mapshaper's most robust dissolve function, which can handle overlaps, gaps and other topology errors. The legacy faster algorithm is still available as `-dissolve no-repair`. (The old `-dissolve2` is just an alias for `-dissolve`.)
37
+
38
+ → See [`-dissolve`](/docs/reference.html.md#-dissolve).
39
+ </div>
40
+
41
+ <div class="whats-new-entry">
42
+
43
+ **FlatGeobuf and GeoPackage support.** Mapshaper reads and writes FlatGeobuf (`.fgb`) and GeoPackage (`.gpkg`) files.
44
+
45
+ → See [FlatGeobuf](/docs/formats/flatgeobuf.html.md), [GeoPackage](/docs/formats/geopackage.html.md) and [`-i layers=`](/docs/reference.html.md#-i-input).
46
+ </div>
47
+
48
+ <div class="whats-new-entry">
49
+
50
+ **SVG import.** SVG files exported by Mapshaper can be re-imported &mdash; useful for making stylistic edits.
51
+
52
+ → See [SVG](/docs/formats/svg.html.md).
53
+ </div>
package/www/index.html CHANGED
@@ -63,7 +63,7 @@
63
63
  <span class="console-btn header-btn btn">Console</span><span class="display-btn header-btn btn">Display</span><span class="separator"></span><span class="separator"></span></span><span class="simplify-btn header-btn btn">Simplify</span><span class="separator"></span><span class="export-btn header-btn btn">Export</span>
64
64
  </div>
65
65
  <div id="splash-buttons" class="page-header-buttons">
66
- <a href="https://github.com/mbloch/mapshaper/wiki"><span id="wiki-btn" class="header-btn btn">Wiki</span></a><span class="separator"></span><a href="https://github.com/mbloch/mapshaper"><span id="github-btn" class="header-btn btn">GitHub</span></a><span class="separator"></span><a href="sponsor.html"><span id="sponsor-btn" class="header-btn btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg> Become a sponsor</span></a>
66
+ <a href="/docs/"><span id="wiki-btn" class="header-btn btn">Docs</span></a><span class="separator"></span><a href="https://github.com/mbloch/mapshaper"><span id="github-btn" class="header-btn btn">GitHub</span></a><span class="separator"></span><a id="survey-en-link" href="https://tally.so/r/44Njok" target="_blank" rel="noopener"><span id="survey-en-btn" class="header-btn btn">1-minute survey</span></a><a id="survey-zh-link" href="https://tally.so/r/vGx7KQ" target="_blank" rel="noopener" style="display:none"><span id="survey-zh-btn" class="header-btn btn" lang="zh-CN">意见反馈</span></a><span class="separator"></span><a href="sponsor.html"><span id="sponsor-btn" class="header-btn btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg> Become a sponsor</span></a>
67
67
  </div>
68
68
  </div>
69
69
 
@@ -146,7 +146,7 @@
146
146
  <div style="height:11px"></div>
147
147
 
148
148
  <div class="option-menu"><input type="text" class="text-input advanced-options" placeholder="command line options">
149
- <a href="https://github.com/mbloch/mapshaper/wiki/Command-Reference#-o-output" target="mapshaper_output_docs">
149
+ <a href="/docs/essentials/commands.html#-o-output" target="mapshaper_output_docs">
150
150
  <div class="tip-button">?<div class="tip-anchor">
151
151
  <div class="tip">Enter options from the command line interface for
152
152
  the -o command. Examples: bbox no-quantization
@@ -293,7 +293,7 @@ a smoother appearance.</div></div></div></div>
293
293
  </div>
294
294
  </div>
295
295
  <div style="margin-top: 10px"><input type="text" class="text-input advanced-options" placeholder="import options">
296
- <a href="https://github.com/mbloch/mapshaper/wiki/Command-Reference#-i-input" target="mapshaper_import_docs">
296
+ <a href="/docs/essentials/commands.html#-i-input" target="mapshaper_import_docs">
297
297
  <div class="tip-button">?<div class="tip-anchor">
298
298
  <div class="tip">Enter options from the command line
299
299
  interface. Examples: <span id="import-option-examples">snap no-topology
@@ -331,6 +331,33 @@ encoding=big5</span>. Click to see all options.</div></div></div>
331
331
  <div class="drop-area"></div>
332
332
  </div>
333
333
 
334
+ <script>
335
+ (function() {
336
+ // Show the Chinese-language survey link for users likely located in
337
+ // mainland China, based on browser timezone or preferred language.
338
+ // No geolocation or network lookup is performed.
339
+ var isChina = false;
340
+ try {
341
+ // Allow previewing via ?survey=zh (or &survey=zh) in the URL.
342
+ if (/[?&]survey=zh\b/i.test(location.search)) isChina = true;
343
+ } catch (e) {}
344
+ try {
345
+ var tz = (Intl.DateTimeFormat().resolvedOptions().timeZone || '').toLowerCase();
346
+ var chinaZones = ['asia/shanghai', 'asia/urumqi', 'asia/chongqing', 'asia/harbin', 'asia/kashgar'];
347
+ if (chinaZones.indexOf(tz) !== -1) isChina = true;
348
+ } catch (e) {}
349
+ var langs = navigator.languages || [navigator.language || ''];
350
+ for (var i = 0; i < langs.length && !isChina; i++) {
351
+ if (/^zh(-Hans)?-CN\b/i.test(langs[i])) isChina = true;
352
+ }
353
+ if (isChina) {
354
+ var zh = document.getElementById('survey-zh-link');
355
+ var en = document.getElementById('survey-en-link');
356
+ if (zh) zh.style.display = '';
357
+ if (en) en.style.display = 'none';
358
+ }
359
+ })();
360
+ </script>
334
361
  <script src="basemap.js"></script>
335
362
  <script src="modules.js"></script>
336
363
  <script src="mapshaper.js"></script>