You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/examples/us-states.html
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,12 +56,16 @@ <h3 id="code">Code</h3>
56
56
-filter <spanclass="hljs-string">'admin == "United States of America"'</span> \
57
57
-proj albersusa \
58
58
-classify non-adjacent colors=Tableau10 \
59
+
-innerlines + name=innerlines \
60
+
-style stroke=white stroke-width=0.5 \
61
+
-target states,innerlines \
59
62
-o us-states.svg height=400 width=600
60
63
</code></pre>
61
64
<h3id="notes">Notes</h3>
62
65
<ul>
63
66
<li>To see the list of built-in color schemes to use with <code>-classify</code>, run <code>mapshaper -colors</code>. You can also use <code>colors=random</code>.</li>
64
67
<li>The Albers USA projection (<code>-proj albersusa</code>) is a custom projection used by The New York Times for U.S. maps.</li>
68
+
<li>Applying a stroke to interior lines using <code>-innerlines</code> (and not to exterior lines) creates a more accurate and crisper-looking coastline.</li>
<p>Mapshaper offers three simplification methods, selectable as flags to <code>-simplify</code>:</p>
46
46
<ul>
47
-
<li><strong><code>dp</code></strong> — Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to grow visible spikes at high simplification.</li>
48
-
<li><strong><code>visvalingam</code></strong> — The Visvalingam algorithm. Iteratively removes the point that forms the smallest triangle with its two neighbors.</li>
49
-
<li><strong><code>weighted_visvalingam</code></strong> (Mapshaper's default) — Visvalingam's effective-area algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification.</li>
47
+
<li><strong><code>dp</code></strong> — Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to introduce visible spikes at high simplification.</li>
48
+
<li><strong><code>visvalingam</code></strong> — The Visvalingam algorithm. Iteratively removes the point that forms the triangle of smallest area with its two neighbors.</li>
49
+
<li><strong><code>weighted_visvalingam</code></strong> (Mapshaper's default) — Visvalingam's algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification. You can fine tune this effect by setting the <code>weighting=</code> option (default is 0.7). The smaller the parameter, the greater the tendency to smooth away long, thin geographic features.</li>
50
50
</ul>
51
-
<p>Weighted Visvalingam is the default because it has proven to be versatile and effective at reducing detail in highly detailed source data. This method can be effective at generalizing very detailed source files, but be careful that it doesn't remove long, thin geographic features that you want to keep.You can control the amount of weighting used by Weighted Visvalingam with the <code>weighting=</code> option (default is 0.7).</p>
52
-
<p>If you are only interested in minimizing file size, Douglas-Peucker is generally the better choice.</p>
51
+
<p>Weighted Visvalingam is the default because it produces good-looking generalizations of highly detailed source layers. But none of these methods can approach the quality that a cartographer achieves when generalizing linework by hand.</p>
52
+
<p>If you are primarily interested in removing as many vertices as possible without visible changes to the shape of the lines, you may find that Douglas-Peucker combined with an appropriate <code>interval=</code> or <code>resolution=</code> parameter gives the best results.</p>
53
53
<p><strong>Figures</strong></p>
54
54
<p>Natural Earth 10m coastlines, simplified with modified Visvalingam at 5% point retention.
<p>When you import multiple layers using <code>-i combine-files</code>, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across both.
87
+
<p>When you import multiple layers using <code>-i combine-files</code>, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across all layers.
88
88
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.</p>
Copy file name to clipboardExpand all lines: docs/guides/simplification.html.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,13 @@ Simplification reduces the number of vertices in polylines and polygon boundarie
11
11
12
12
Mapshaper offers three simplification methods, selectable as flags to `-simplify`:
13
13
14
-
-**`dp`**— Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to grow visible spikes at high simplification.
15
-
-**`visvalingam`**— The Visvalingam algorithm. Iteratively removes the point that forms the smallest triangle with its two neighbors.
16
-
-**`weighted_visvalingam`** (Mapshaper's default) — Visvalingam's effective-area algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification.
14
+
-**`dp`**— Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to introduce visible spikes at high simplification.
15
+
-**`visvalingam`**— The Visvalingam algorithm. Iteratively removes the point that forms the triangle of smallest area with its two neighbors.
16
+
-**`weighted_visvalingam`** (Mapshaper's default) — Visvalingam's algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification. You can fine tune this effect by setting the `weighting=` option (default is 0.7). The smaller the parameter, the greater the tendency to smooth away long, thin geographic features.
17
17
18
-
Weighted Visvalingam is the default because it has proven to be versatile and effective at reducing detail in highly detailed source data. This method can be effective at generalizing very detailed source files, but be careful that it doesn't remove long, thin geographic features that you want to keep.You can control the amount of weighting used by Weighted Visvalingam with the `weighting=` option (default is 0.7).
19
-
20
-
If you are only interested in minimizing file size, Douglas-Peucker is generally the better choice.
18
+
Weighted Visvalingam is the default because it produces good-looking generalizations of highly detailed source layers. But none of these methods can approach the quality that a cartographer achieves when generalizing linework by hand.
21
19
20
+
If you are primarily interested in removing as many vertices as possible without visible changes to the shape of the lines, you may find that Douglas-Peucker combined with an appropriate `interval=` or `resolution=` parameter gives the best results.
When you import multiple layers using `-i combine-files`, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across both.
86
+
When you import multiple layers using `-i combine-files`, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across all layers.
88
87
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.
Copy file name to clipboardExpand all lines: llms-full.txt
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2172,14 +2172,13 @@ Simplification reduces the number of vertices in polylines and polygon boundarie
2172
2172
2173
2173
Mapshaper offers three simplification methods, selectable as flags to `-simplify`:
2174
2174
2175
-
- **`dp`** — Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to grow visible spikes at high simplification.
2176
-
- **`visvalingam`** — The Visvalingam algorithm. Iteratively removes the point that forms the smallest triangle with its two neighbors.
2177
-
- **`weighted_visvalingam`** (Mapshaper's default) — Visvalingam's effective-area algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification.
2175
+
- **`dp`** — Douglas-Peucker (also known as Ramer–Douglas–Peucker). Guarantees that simplified lines stay within a fixed distance of the original. Good for stripping excess vertices to reduce file size, but tends to introduce visible spikes at high simplification.
2176
+
- **`visvalingam`** — The Visvalingam algorithm. Iteratively removes the point that forms the triangle of smallest area with its two neighbors.
2177
+
- **`weighted_visvalingam`** (Mapshaper's default) — Visvalingam's algorithm with a custom weighting that underweights points at sharp angles, so they are removed earlier than in standard Visvalingam. The result is visibly smoother lines and fewer jagged spikes at high simplification. You can fine tune this effect by setting the `weighting=` option (default is 0.7). The smaller the parameter, the greater the tendency to smooth away long, thin geographic features.
2178
2178
2179
-
Weighted Visvalingam is the default because it has proven to be versatile and effective at reducing detail in highly detailed source data. This method can be effective at generalizing very detailed source files, but be careful that it doesn't remove long, thin geographic features that you want to keep.You can control the amount of weighting used by Weighted Visvalingam with the `weighting=` option (default is 0.7).
2180
-
2181
-
If you are only interested in minimizing file size, Douglas-Peucker is generally the better choice.
2179
+
Weighted Visvalingam is the default because it produces good-looking generalizations of highly detailed source layers. But none of these methods can approach the quality that a cartographer achieves when generalizing linework by hand.
2182
2180
2181
+
If you are primarily interested in removing as many vertices as possible without visible changes to the shape of the lines, you may find that Douglas-Peucker combined with an appropriate `interval=` or `resolution=` parameter gives the best results.
When you import multiple layers using `-i combine-files`, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across both.
2247
+
When you import multiple layers using `-i combine-files`, Mapshaper builds a shared topology. This means that boundaries shared between layers — for example, aligned state and county polygon borders — are simplified identically across all layers.
2249
2248
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.
2250
2249
2251
2250
```bash
@@ -4045,6 +4044,7 @@ Difficulty: easy
4045
4044
4046
4045
* To see the list of built-in color schemes to use with `-classify`, run `mapshaper -colors`. You can also use `colors=random`.
4047
4046
* The Albers USA projection (`-proj albersusa`) is a custom projection used by The New York Times for U.S. maps.
4047
+
* Applying a stroke to interior lines using `-innerlines` (and not to exterior lines) creates a more accurate and crisper-looking coastline.
0 commit comments