mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Swap out w8r/martinez clipper for mfogel/polygon-clipping
This is a drop in replacement that performs better and yields more correct results see also https://github.com/ideditor/location-conflation/pull/20
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import turf_bboxClip from '@turf/bbox-clip';
|
||||
import stringify from 'fast-json-stable-stringify';
|
||||
import * as martinez from 'martinez-polygon-clipping';
|
||||
import polygonClipping from 'polygon-clipping';
|
||||
|
||||
import Protobuf from 'pbf';
|
||||
import vt from '@mapbox/vector-tile';
|
||||
@@ -66,13 +66,13 @@ function vtToGeoJSON(data, tile, mergeCache) {
|
||||
var merged = mergeCache[propertyhash];
|
||||
if (merged && merged.length) {
|
||||
var other = merged[0];
|
||||
var coords = martinez.union(
|
||||
var coords = polygonClipping.union(
|
||||
feature.geometry.coordinates,
|
||||
other.geometry.coordinates
|
||||
);
|
||||
|
||||
if (!coords || !coords.length) {
|
||||
continue; // something failed in martinez union
|
||||
continue; // something failed in polygon union
|
||||
}
|
||||
|
||||
merged.push(feature);
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
"fast-json-stable-stringify": "2.1.0",
|
||||
"lodash-es": "~4.17.15",
|
||||
"marked": "~1.2.3",
|
||||
"martinez-polygon-clipping": "0.7.0",
|
||||
"node-diff3": "2.1.0",
|
||||
"osm-auth": "1.1.0",
|
||||
"pannellum": "2.5.6",
|
||||
"polygon-clipping": "~0.15.1",
|
||||
"rbush": "3.0.1",
|
||||
"whatwg-fetch": "^3.4.1",
|
||||
"which-polygon": "2.2.0"
|
||||
|
||||
Reference in New Issue
Block a user