Skip to content

Commit 72c6ae8

Browse files
committed
Update website
1 parent 8ead1ee commit 72c6ae8

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

mapshaper.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17219,6 +17219,29 @@
1721917219
profileStart('snapAndCut');
1722017220
var arcs = dataset.arcs;
1722117221
var cutOpts = snapDist > 0 ? {tolerance: snapDist} : {tolerance: 0};
17222+
17223+
// Probe for intersections before any modification. If the input has none,
17224+
// every pass of the loop below is provably a no-op: snap() can only
17225+
// consolidate FP noise around intersection points, cutPathsAtIntersections
17226+
// inserts cut points only where segments cross, and buildTopology is gated
17227+
// on coordsHaveChanged. So we can return early and skip a ~O(V log V) snap
17228+
// that would snap zero points, which is the dominant cost of robust
17229+
// dissolve on already-clean polygon input.
17230+
//
17231+
// limit=1 makes the probe cheap on dirty input too — it stops the stripe
17232+
// scan after the first hit, so the probe's full cost is only paid on
17233+
// truly clean input (where it replaces the equivalent scan that
17234+
// cutPathsAtIntersections would otherwise do on pass 1).
17235+
var probeOpts = {tolerance: cutOpts.tolerance, limit: 1};
17236+
profileStart('probeIntersections');
17237+
var probe = findSegmentIntersections(arcs, probeOpts);
17238+
profileEnd('probeIntersections');
17239+
if (probe.length === 0) {
17240+
debug('[snapAndCut] skipped (no intersections)');
17241+
profileEnd('snapAndCut');
17242+
return false;
17243+
}
17244+
1722217245
var coordsHaveChanged = false;
1722317246
var snapCount = 0, dupeCount, cutCount;
1722417247
var maxLoops = 4, loopCount = 0;

sponsor.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@
186186

187187
<h1>Support mapshaper</h1>
188188

189-
<p class="tagline">Mapshaper is free, open-source software for editing geographic data &mdash; used worldwide for everything from classroom exercises to professional map work.</p>
189+
<p class="tagline">Mapshaper is free, open-source software for editing geographic data &mdash; used worldwide for everything from student projects to professional map work.</p>
190190

191191
<div class="sponsor-buttons">
192-
<a href="https://ko-fi.com/mapshaper" class="btn">Support via Ko-fi</a>
193192
<a href="https://github.com/sponsors/mbloch" class="btn btn-secondary">Sponsor on GitHub</a>
193+
<a href="https://ko-fi.com/mapshaper" class="btn">Tip the developer</a>
194194
</div>
195195

196-
<p class="sponsor-note">Ko-fi accepts one-time or recurring contributions &mdash; no account required. GitHub Sponsors offers recurring sponsorship.</p>
196+
<!-- <p class="sponsor-note">Ko-fi accepts one-time or recurring contributions &mdash; no account required. GitHub Sponsors offers recurring sponsorship.</p> -->
197197

198198
<h2>What your contribution supports</h2>
199199
<ul class="support-list">

0 commit comments

Comments
 (0)