mapshaper 0.7.0 → 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 +363 -62
  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 +363 -62
  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
package/www/llms.txt ADDED
@@ -0,0 +1,55 @@
1
+ # Mapshaper
2
+
3
+ > Mapshaper is a command-line tool and in-browser editor for geographic vector data. It reads and writes Shapefile, GeoJSON, TopoJSON, GeoPackage, FlatGeobuf, KML/KMZ, CSV/TSV, DBF, JSON records and SVG, and can simplify, clip, dissolve, join, project and otherwise transform layers. The CLI and web app share the same command language, so commands written interactively in the browser console run unchanged in scripts.
4
+
5
+ These docs cover the same material in two forms:
6
+
7
+ - **Markdown mirrors** of every page (this file links to them) for use by language models and other tools.
8
+ - **HTML pages** at the same paths without the trailing `.md`, with navigation, search and syntax highlighting, intended for humans.
9
+
10
+ When in doubt about a command's behavior, the [command reference](https://mapshaper.org/docs/reference.html.md) is the source of truth. The Node.js source code lives at <https://github.com/mbloch/mapshaper>.
11
+
12
+ ## Getting started
13
+
14
+ - [The command-line tool](https://mapshaper.org/docs/essentials/command-line.html.md): Install the mapshaper CLI, run your first commands and learn how Mapshaper organizes data into layers.
15
+ - [The web app](https://mapshaper.org/docs/essentials/web-app.html.md): A tour of Mapshaper's web interface, including loading data, the console, the right-click menu, snapshots, browser support and running it locally.
16
+
17
+ ## Guides
18
+
19
+ - [Simplification](https://mapshaper.org/docs/guides/simplification.html.md): How to choose between Visvalingam and Douglas-Peucker, and tips for getting good-looking results from polygon and polyline simplification.
20
+ - [JavaScript expressions](https://mapshaper.org/docs/guides/expressions.html.md): Reference for the JS expressions used in -each, -filter, -calc, -where, -sort, -if, -run and other Mapshaper commands.
21
+ - [Projections](https://mapshaper.org/docs/guides/projections.html.md): How to reproject geographic data with Mapshaper, including CRS notation, built-in aliases, and the albersusa composite projection.
22
+ - [Topology and cleaning](https://mapshaper.org/docs/guides/topology.html.md): How Mapshaper detects shared boundaries between features, and how to fix the common topology errors that creep into Shapefile and GeoJSON datasets.
23
+ - [Combining two layers](https://mapshaper.org/docs/guides/combining-layers.html.md): A step-by-step walkthrough of combining and pruning two boundary layers to produce a custom GeoJSON basemap.
24
+ - [Using Mapshaper from Node.js](https://mapshaper.org/docs/guides/programmatic.html.md): Integrating Mapshaper into JavaScript builds and applications via its Node.js API.
25
+
26
+ ## Formats
27
+
28
+ - [Shapefile](https://mapshaper.org/docs/formats/shapefile.html.md): How Mapshaper reads and writes ESRI Shapefiles, including encoding and field-name notes.
29
+ - [GeoJSON](https://mapshaper.org/docs/formats/geojson.html.md): How Mapshaper reads and writes GeoJSON, including precision, ndjson and RFC 7946 options.
30
+ - [TopoJSON](https://mapshaper.org/docs/formats/topojson.html.md): How Mapshaper reads and writes TopoJSON, including quantization and multi-layer output.
31
+ - [GeoPackage](https://mapshaper.org/docs/formats/geopackage.html.md): How Mapshaper reads and writes GeoPackage (.gpkg), the OGC's SQLite-based GIS container.
32
+ - [FlatGeobuf](https://mapshaper.org/docs/formats/flatgeobuf.html.md): How Mapshaper reads and writes FlatGeobuf (.fgb), a streamable binary vector format.
33
+ - [KML / KMZ](https://mapshaper.org/docs/formats/kml.html.md): How Mapshaper reads and writes KML and KMZ files for use with Google Earth and similar tools.
34
+ - [CSV / TSV](https://mapshaper.org/docs/formats/csv.html.md): How Mapshaper reads and writes CSV/TSV, including encoding, type hints and large-file handling.
35
+ - [DBF](https://mapshaper.org/docs/formats/dbf.html.md): How Mapshaper reads and writes standalone DBF files, the tabular component of Shapefile.
36
+ - [JSON records](https://mapshaper.org/docs/formats/json.html.md): How Mapshaper reads and writes plain JSON arrays of objects (no geometry), useful for tabular data exchange.
37
+ - [SVG](https://mapshaper.org/docs/formats/svg.html.md): How Mapshaper exports vector data as SVG, including width, scale, bounding-box and per-feature data attributes.
38
+ - [Mapshaper snapshot](https://mapshaper.org/docs/formats/snapshot.html.md): A single-file binary snapshot of a Mapshaper session, used to save work in progress and share reproducible projects.
39
+
40
+ ## Examples
41
+
42
+ - [Basics](https://mapshaper.org/docs/examples/basics.html.md): A scannable collection of short Mapshaper recipes for common GIS tasks — format conversion, joins, simplification, dissolves, projection, classification, web export and more.
43
+ - [Globe](https://mapshaper.org/docs/examples/globe.html.md): A simple locator map in the shape of a globe.
44
+ - [U.S. state map](https://mapshaper.org/docs/examples/us-states.html.md): Simple U.S. state map with random, non-adjacent colors
45
+
46
+ ## Command reference
47
+
48
+ - [Command reference](https://mapshaper.org/docs/reference.html.md): Exhaustive reference for every mapshaper command and its options, with short examples.
49
+
50
+ ## Optional
51
+
52
+ - [Home](https://mapshaper.org/docs/index.html.md): Documentation for mapshaper, the command-line tool and web app for editing Shapefile, GeoJSON, TopoJSON, GeoPackage, FlatGeobuf, KML and CSV data.
53
+ - [What's new](https://mapshaper.org/docs/whats-new.html.md): A curated log of recently added user-visible features in Mapshaper, with links into the rest of the docs.
54
+ - [Gallery](https://mapshaper.org/docs/gallery/index.html.md): Example maps made with Mapshaper, with full source data and reproduction steps for each.
55
+ - [Formats overview](https://mapshaper.org/docs/formats/overview.html.md): A quick comparison of every file format Mapshaper can read and write, with links to per-format details.
@@ -4000,7 +4000,8 @@
4000
4000
  var historyId = 0;
4001
4001
  var _isOpen = false;
4002
4002
  var btn = gui.container.findChild('.console-btn').on('click', toggle);
4003
- var globals = {}; // share user-defined globals between runs
4003
+ var globals = {}; // share user-defined globals (job.defs) between runs
4004
+ var sharedVars = {}; // share -vars / -defaults templating scope between runs
4004
4005
 
4005
4006
  // expose this function, so other components can run commands (e.g. box tool)
4006
4007
  this.runMapshaperCommands = runMapshaperCommands;
@@ -4404,6 +4405,7 @@
4404
4405
  job = new internal.Job(model);
4405
4406
 
4406
4407
  job.defs = globals; // share globals between runs
4408
+ job.vars = sharedVars; // share templating scope between runs
4407
4409
  internal.runParsedCommands(commands, job, function(err) {
4408
4410
  var flags = getCommandFlags(commands),
4409
4411
  active2 = model.getActiveLayer(),
@@ -6609,6 +6611,10 @@
6609
6611
  LOGGING = true;
6610
6612
  }
6611
6613
 
6614
+ function disableLogging() {
6615
+ LOGGING = false;
6616
+ }
6617
+
6612
6618
  function loggingEnabled() {
6613
6619
  return !!LOGGING;
6614
6620
  }