mapshaper 0.7.2 → 0.7.4

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/LICENSE +1 -1
  2. package/bin/mapshaper-gui +31 -7
  3. package/mapshaper.js +45 -42
  4. package/package.json +8 -7
  5. package/www/geopackage.js +10 -10
  6. package/www/index.html +32 -4
  7. package/www/mapshaper-gui.js +529 -83
  8. package/www/mapshaper.js +45 -42
  9. package/www/modules.js +5 -5
  10. package/www/page.css +157 -0
  11. package/www/docs/_assets/cmd-search.js +0 -213
  12. package/www/docs/_assets/docs.css +0 -722
  13. package/www/docs/_assets/docs.js +0 -75
  14. package/www/docs/_assets/highlight.css +0 -10
  15. package/www/docs/essentials/command-line.html +0 -127
  16. package/www/docs/essentials/command-line.html.md +0 -112
  17. package/www/docs/essentials/web-app.html +0 -138
  18. package/www/docs/essentials/web-app.html.md +0 -106
  19. package/www/docs/examples/basics.html +0 -275
  20. package/www/docs/examples/basics.html.md +0 -370
  21. package/www/docs/examples/data/Makefile +0 -31
  22. package/www/docs/examples/data/globe.msx +0 -0
  23. package/www/docs/examples/data/globe.svg +0 -616
  24. package/www/docs/examples/data/globe.txt +0 -21
  25. package/www/docs/examples/data/globe.zip +0 -0
  26. package/www/docs/examples/data/ne_50m_admin_0_countries.geojson +0 -1
  27. package/www/docs/examples/data/ne_50m_admin_1_states_provinces_lakes.geojson +0 -1
  28. package/www/docs/examples/data/us-states.msx +0 -0
  29. package/www/docs/examples/data/us-states.svg +0 -56
  30. package/www/docs/examples/data/us-states.txt +0 -6
  31. package/www/docs/examples/data/us-states.zip +0 -0
  32. package/www/docs/examples/globe.html +0 -108
  33. package/www/docs/examples/globe.html.md +0 -64
  34. package/www/docs/examples/us-states.html +0 -88
  35. package/www/docs/examples/us-states.html.md +0 -44
  36. package/www/docs/formats/csv.html +0 -127
  37. package/www/docs/formats/csv.html.md +0 -97
  38. package/www/docs/formats/dbf.html +0 -87
  39. package/www/docs/formats/dbf.html.md +0 -39
  40. package/www/docs/formats/flatgeobuf.html +0 -85
  41. package/www/docs/formats/flatgeobuf.html.md +0 -41
  42. package/www/docs/formats/geojson.html +0 -107
  43. package/www/docs/formats/geojson.html.md +0 -65
  44. package/www/docs/formats/geopackage.html +0 -87
  45. package/www/docs/formats/geopackage.html.md +0 -42
  46. package/www/docs/formats/json.html +0 -83
  47. package/www/docs/formats/json.html.md +0 -35
  48. package/www/docs/formats/kml.html +0 -82
  49. package/www/docs/formats/kml.html.md +0 -39
  50. package/www/docs/formats/overview.html +0 -191
  51. package/www/docs/formats/overview.html.md +0 -34
  52. package/www/docs/formats/shapefile.html +0 -123
  53. package/www/docs/formats/shapefile.html.md +0 -84
  54. package/www/docs/formats/snapshot.html +0 -87
  55. package/www/docs/formats/snapshot.html.md +0 -39
  56. package/www/docs/formats/svg.html +0 -99
  57. package/www/docs/formats/svg.html.md +0 -51
  58. package/www/docs/formats/topojson.html +0 -102
  59. package/www/docs/formats/topojson.html.md +0 -54
  60. package/www/docs/gallery/index.html +0 -80
  61. package/www/docs/gallery/index.html.md +0 -29
  62. package/www/docs/guides/combining-layers.html +0 -109
  63. package/www/docs/guides/combining-layers.html.md +0 -89
  64. package/www/docs/guides/expressions.html +0 -600
  65. package/www/docs/guides/expressions.html.md +0 -376
  66. package/www/docs/guides/programmatic.html +0 -117
  67. package/www/docs/guides/programmatic.html.md +0 -91
  68. package/www/docs/guides/projections.html +0 -158
  69. package/www/docs/guides/projections.html.md +0 -118
  70. package/www/docs/guides/simplification.html +0 -110
  71. package/www/docs/guides/simplification.html.md +0 -96
  72. package/www/docs/guides/topology.html +0 -90
  73. package/www/docs/guides/topology.html.md +0 -63
  74. package/www/docs/images/cal-counties.png +0 -0
  75. package/www/docs/images/simplification-detail.png +0 -0
  76. package/www/docs/images/simplification-dp.png +0 -0
  77. package/www/docs/images/simplification-mod2.png +0 -0
  78. package/www/docs/images/tiger-counties.png +0 -0
  79. package/www/docs/index.html +0 -101
  80. package/www/docs/index.html.md +0 -59
  81. package/www/docs/reference.html +0 -1302
  82. package/www/docs/reference.html.md +0 -1817
  83. package/www/docs/whats-new.html +0 -77
  84. package/www/docs/whats-new.html.md +0 -59
  85. package/www/llms-full.txt +0 -4053
  86. package/www/llms.txt +0 -55
@@ -1,89 +0,0 @@
1
- ---
2
- title: "Tutorial: combining two layers"
3
- description: A step-by-step walkthrough of combining and pruning two boundary layers to produce a custom GeoJSON basemap.
4
- ---
5
-
6
- # Tutorial: combining two layers in the web UI
7
-
8
- > Originally contributed by Amanda Hickman to the project wiki.
9
-
10
- This walkthrough shows how to combine and prune two boundary layers to produce a single GeoJSON file you can use as a custom basemap (for example, in [Datawrapper](https://www.datawrapper.de/)).
11
-
12
- The example builds a basemap of the San Francisco Bay Area, with both county boundaries and the cities ("places") inside them.
13
-
14
- The walkthrough uses the web app at [mapshaper.org](/), driving the workflow from the **Console**. The same commands work on the CLI — chain them together with leading `-` prefixes (so `clip bayarea_county` becomes `-clip bayarea_county`) and connect them with backslash line continuations.
15
-
16
- ## The starting data
17
-
18
- We'll use two source files:
19
-
20
- - A county boundary file from the California Open Data Portal — or, in this case, a [version clipped to the shoreline](https://geodata.lib.berkeley.edu/catalog/ark28722-s7hs4j) from UC Berkeley's Geo Data Commons. The shoreline-clipped version reads more naturally on a map than the legal-boundary version, which extends into the bay.
21
- - A statewide [places boundary file](https://geodata.lib.berkeley.edu/catalog/ark28722-s7bp4z) for city boundaries.
22
-
23
- The legal county boundaries from the Census TIGER files extend straight across the water — San Francisco even reaches out to include the Farallon Islands:
24
-
25
- ![Bay Area counties from the Census TIGER file, with boundaries cutting across the bay and extending offshore](/docs/images/tiger-counties.png)
26
-
27
- The Berkeley library's version is clipped to the shoreline, so the bay shows as empty space between the counties:
28
-
29
- ![The same Bay Area counties, with each polygon clipped to the coastline so the bay is visible between them](/docs/images/cal-counties.png)
30
-
31
- Download both as `.zip` files.
32
-
33
- ## Open them in Mapshaper
34
-
35
- Drag the two `.zip` files onto [mapshaper.org](/), or run the web app locally with `mapshaper-gui`. You'll end up with two layers loaded into the session.
36
-
37
- ## Set the projection
38
-
39
- Datawrapper expects WGS84 coordinates. Open the **Console** (top-right of the header) and run, with each layer selected:
40
-
41
- ```
42
- proj wgs84
43
- ```
44
-
45
- You'll need to run this once per layer — switch which layer is selected in the layer panel between runs.
46
-
47
- → See the [`-proj` reference](/docs/reference.html.md#-proj).
48
-
49
- ## Clip the places layer to the Bay Area
50
-
51
- The places layer covers the whole state. We only want places inside the Bay Area counties. With the places layer selected:
52
-
53
- ```
54
- clip bayarea_county
55
- ```
56
-
57
- → See the [`-clip` reference](/docs/reference.html.md#-clip).
58
-
59
- Alternatively, if the places layer has a `COUNTY` attribute, a filter expression works too:
60
-
61
- ```
62
- filter '["Marin", "Contra Costa", "Alameda",
63
- "San Francisco", "Santa Clara", "San Mateo"].includes(COUNTY)'
64
- ```
65
-
66
- → See the [`-filter` reference](/docs/reference.html.md#-filter).
67
-
68
- ## Merge the layers
69
-
70
- The two layers can now be combined into a single layer with [`-merge-layers`](/docs/reference.html.md#-merge-layers):
71
-
72
- ```
73
- merge-layers target=bayarea_county,california_place_clipped force
74
- ```
75
-
76
- The `force` flag is needed because the two layers have different attribute schemas; without it, Mapshaper refuses to merge layers whose fields don't match.
77
-
78
- ## Export
79
-
80
- Open the **Export** panel (top-right of the header), pick **GeoJSON** as the format, and save the merged layer. You can now upload that file to Datawrapper (or any other tool that accepts GeoJSON) as a custom basemap.
81
-
82
- ## What you've learned
83
-
84
- - How to load multiple data files into one Mapshaper session.
85
- - How to apply a projection inside the web UI's console.
86
- - How to clip one layer by another.
87
- - How to merge two layers into a single layer for export.
88
-
89
- For more on layers and how Mapshaper organizes multi-layer datasets, see [The command-line tool](/docs/essentials/command-line.html.md#working-with-layers).