Skip to content

Commit 716bc75

Browse files
committed
Update website
1 parent aa87c5e commit 716bc75

9 files changed

Lines changed: 138 additions & 20 deletions

File tree

docs/examples/data/globe.msx

0 Bytes
Binary file not shown.

docs/examples/data/us-states.msx

624 Bytes
Binary file not shown.

docs/examples/data/us-states.svg

Lines changed: 108 additions & 0 deletions
Loading

docs/examples/data/us-states.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ mapshaper \
33
-filter 'admin == "United States of America"' \
44
-proj albersusa \
55
-classify non-adjacent colors=Tableau10 \
6+
-innerlines + name=innerlines \
7+
-style stroke=white stroke-width=0.5 \
8+
-target states,innerlines \
69
-o us-states.svg height=400 width=600

docs/examples/us-states.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ <h3 id="code">Code</h3>
5656
-filter <span class="hljs-string">&#x27;admin == &quot;United States of America&quot;&#x27;</span> \
5757
-proj albersusa \
5858
-classify non-adjacent colors=Tableau10 \
59+
-innerlines + name=innerlines \
60+
-style stroke=white stroke-width=0.5 \
61+
-target states,innerlines \
5962
-o us-states.svg height=400 width=600
6063
</code></pre>
6164
<h3 id="notes">Notes</h3>
6265
<ul>
6366
<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>
6467
<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>
6569
</ul>
6670
<h3 id="assets">Assets</h3>
6771
<ul>

docs/examples/us-states.html.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ mapshaper \
2929
-filter 'admin == "United States of America"' \
3030
-proj albersusa \
3131
-classify non-adjacent colors=Tableau10 \
32+
-innerlines + name=innerlines \
33+
-style stroke=white stroke-width=0.5 \
34+
-target states,innerlines \
3235
-o us-states.svg height=400 width=600
3336
```
3437

3538
### Notes
3639

3740
* To see the list of built-in color schemes to use with `-classify`, run `mapshaper -colors`. You can also use `colors=random`.
3841
* The Albers USA projection (`-proj albersusa`) is a custom projection used by The New York Times for U.S. maps.
42+
* Applying a stroke to interior lines using `-innerlines` (and not to exterior lines) creates a more accurate and crisper-looking coastline.
3943

4044
### Assets
4145

docs/guides/simplification.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ <h1 id="simplification">Simplification</h1>
4444
<h2 id="choosing-a-method">Choosing a method</h2>
4545
<p>Mapshaper offers three simplification methods, selectable as flags to <code>-simplify</code>:</p>
4646
<ul>
47-
<li><strong><code>dp</code></strong> &mdash; 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> &mdash; 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&#39;s default) &mdash; Visvalingam&#39;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> &mdash; 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> &mdash; 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&#39;s default) &mdash; Visvalingam&#39;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>
5050
</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&#39;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>
5353
<p><strong>Figures</strong></p>
5454
<p>Natural Earth 10m coastlines, simplified with modified Visvalingam at 5% point retention.
5555
<img src="/docs/images/simplification-mod2.png" alt="image"></p>
@@ -84,7 +84,7 @@ <h2 id="avoiding-self-intersections">Avoiding self-intersections</h2>
8484
<pre><code class="hljs language-bash">mapshaper provinces.shp -simplify 5% -clean -o provinces.geojson
8585
</code></pre>
8686
<h2 id="simplifying-multiple-layers-consistently">Simplifying multiple layers consistently</h2>
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 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.
8888
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.</p>
8989
<pre><code class="hljs language-bash">mapshaper -i states.shp counties.shp combine-files \
9090
-simplify 10% \

docs/guides/simplification.html.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ Simplification reduces the number of vertices in polylines and polygon boundarie
1111

1212
Mapshaper offers three simplification methods, selectable as flags to `-simplify`:
1313

14-
- **`dp`** &mdash; 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`** &mdash; The Visvalingam algorithm. Iteratively removes the point that forms the smallest triangle with its two neighbors.
16-
- **`weighted_visvalingam`** (Mapshaper's default) &mdash; 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`** &mdash; 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`** &mdash; The Visvalingam algorithm. Iteratively removes the point that forms the triangle of smallest area with its two neighbors.
16+
- **`weighted_visvalingam`** (Mapshaper's default) &mdash; 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.
1717

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.
2119

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.
2221

2322

2423
**Figures**
@@ -84,7 +83,7 @@ mapshaper provinces.shp -simplify 5% -clean -o provinces.geojson
8483

8584
## Simplifying multiple layers consistently
8685

87-
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.
8887
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.
8988

9089
```bash

llms-full.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,14 +2172,13 @@ Simplification reduces the number of vertices in polylines and polygon boundarie
21722172

21732173
Mapshaper offers three simplification methods, selectable as flags to `-simplify`:
21742174

2175-
- **`dp`** &mdash; 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`** &mdash; The Visvalingam algorithm. Iteratively removes the point that forms the smallest triangle with its two neighbors.
2177-
- **`weighted_visvalingam`** (Mapshaper's default) &mdash; 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`** &mdash; 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`** &mdash; The Visvalingam algorithm. Iteratively removes the point that forms the triangle of smallest area with its two neighbors.
2177+
- **`weighted_visvalingam`** (Mapshaper's default) &mdash; 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.
21782178

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.
21822180

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.
21832182

21842183

21852184
**Figures**
@@ -2245,7 +2244,7 @@ mapshaper provinces.shp -simplify 5% -clean -o provinces.geojson
22452244

22462245
## Simplifying multiple layers consistently
22472246

2248-
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.
22492248
Without this, the layers would diverge during simplification, creating visible gaps and overlaps where they should align.
22502249

22512250
```bash
@@ -4045,6 +4044,7 @@ Difficulty: easy
40454044

40464045
* To see the list of built-in color schemes to use with `-classify`, run `mapshaper -colors`. You can also use `colors=random`.
40474046
* 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.
40484048

40494049
### Assets
40504050

0 commit comments

Comments
 (0)