From 827c0004521d819399b908e30be9e114ea4705d4 Mon Sep 17 00:00:00 2001 From: Matthew Bloch Date: Sat, 9 Mar 2024 15:34:33 -0500 Subject: [PATCH] Fix for bug affecting -polygons and -mosaic --- src/commands/mapshaper-mosaic.mjs | 3 + src/commands/mapshaper-polygons.mjs | 3 + src/topology/mapshaper-nodes.mjs | 21 +- .../features/polygons/ia_county_lines.json | 261 ++++++++++++++++++ test/mosaic-test.mjs | 8 + test/polygons-test.mjs | 9 + 6 files changed, 298 insertions(+), 7 deletions(-) create mode 100644 test/data/features/polygons/ia_county_lines.json diff --git a/src/commands/mapshaper-mosaic.mjs b/src/commands/mapshaper-mosaic.mjs index 7e5a3bd67..ce28c6a70 100644 --- a/src/commands/mapshaper-mosaic.mjs +++ b/src/commands/mapshaper-mosaic.mjs @@ -5,6 +5,7 @@ import cmd from '../mapshaper-cmd'; import { stop } from '../utils/mapshaper-logging'; import { DataTable } from '../datatable/mapshaper-data-table'; import { MosaicIndex } from '../polygons/mapshaper-mosaic-index'; +import { getArcPresenceTest } from '../paths/mapshaper-path-utils'; cmd.mosaic = function(layers, dataset, opts) { var lyr = layers[0]; @@ -13,6 +14,8 @@ cmd.mosaic = function(layers, dataset, opts) { } requirePolygonLayer(lyr); var nodes = addIntersectionCuts(dataset, opts); + // ignore arcs that don't belong to this layer + nodes.setArcFilter(getArcPresenceTest(lyr.shapes, nodes.arcs)); var mosaicIndex = new MosaicIndex(lyr, nodes, {flat: false}); var mosaicShapes = mosaicIndex.mosaic; var records2; diff --git a/src/commands/mapshaper-polygons.mjs b/src/commands/mapshaper-polygons.mjs index 298f3ea10..b46c5cfbb 100644 --- a/src/commands/mapshaper-polygons.mjs +++ b/src/commands/mapshaper-polygons.mjs @@ -7,6 +7,7 @@ import { requirePolylineLayer } from '../dataset/mapshaper-layer-utils'; import cmd from '../mapshaper-cmd'; import { message, stop } from '../utils/mapshaper-logging'; import geom from '../geom/mapshaper-geom'; +import { getArcPresenceTest } from '../paths/mapshaper-path-utils'; cmd.polygons = function(layers, dataset, opts) { layers.forEach(requirePolylineLayer); @@ -46,6 +47,8 @@ function createPolygonLayerFromRings(lyr, dataset) { function createPolygonLayer(lyr, dataset, opts) { var nodes = closeUndershoots(lyr, dataset, opts); + // ignore arcs that don't belong to this layer + nodes.setArcFilter(getArcPresenceTest(lyr.shapes, nodes.arcs)); var data = buildPolygonMosaic(nodes); return { geometry_type: 'polygon', diff --git a/src/topology/mapshaper-nodes.mjs b/src/topology/mapshaper-nodes.mjs index ac1b2ad3c..4bf5ab400 100644 --- a/src/topology/mapshaper-nodes.mjs +++ b/src/topology/mapshaper-nodes.mjs @@ -16,11 +16,16 @@ export function NodeCollection(arcs, filter) { nn = arcData.nn, xx = arcData.xx, yy = arcData.yy, - nodeData; + nodeData, + globalFilter; // Accessor function for arcs Object.defineProperty(this, 'arcs', {value: arcs}); + this.setArcFilter = function(f) { + globalFilter = f; + }; + this.toArray = function() { var chains = getNodeChains(), flags = new Uint8Array(chains.length), @@ -99,17 +104,19 @@ export function NodeCollection(arcs, filter) { // Returned ids lead into the node (as opposed to outwards from it) // An optional filter function receives the directed id (positive or negative) // of each connected arc and excludes arcs for which the filter returns false. - // The filter is also applied to the initial arc; if false, no arcs are returned. + // // removed: The filter is also applied to the initial arc; if false, no arcs are returned. // - this.getConnectedArcs = function(arcId, filter) { + this.getConnectedArcs = function(arcId, localFilter) { var ids = []; - var filtered = !!filter; var nextId = nextConnectedArc(arcId); - if (filtered && !filter(arcId)) { - // return ids; + // kludge: return empty result if arc fails global test + // ... applying the local filter causes tests to fail + if (globalFilter && !globalFilter(arcId)) { + return []; } while (nextId != arcId) { - if (!filtered || filter(nextId)) { + // if (!filtered || filter && filter(nextId) ) { + if ((!localFilter || localFilter(nextId)) && (!globalFilter || globalFilter(nextId))) { ids.push(nextId); } nextId = nextConnectedArc(nextId); diff --git a/test/data/features/polygons/ia_county_lines.json b/test/data/features/polygons/ia_county_lines.json new file mode 100644 index 000000000..ff01874eb --- /dev/null +++ b/test/data/features/polygons/ia_county_lines.json @@ -0,0 +1,261 @@ +{"type":"FeatureCollection", "features": [ +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8609,43.5],[-95.8619,43.2576]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8619,43.2576],[-96.5551,43.2599]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3878,43.5002],[-95.3879,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3879,43.2553],[-95.8619,43.2576]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9148,43.5009],[-94.9139,43.255]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9139,43.255],[-95.3879,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4426,43.5004],[-94.4431,43.2552]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4431,43.2552],[-94.9139,43.255]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1768,43.0803],[-91.6056,43.0816]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.6056,43.0816],[-91.6108,43.5006]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9709,43.4998],[-93.9704,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9704,43.2553],[-93.9714,42.9076]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9714,42.9076],[-94.4432,42.9082]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4432,42.9082],[-94.4431,43.2552]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.6056,43.0816],[-92.0811,43.0828]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0811,43.0828],[-92.081,43.2129]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.081,43.2129],[-92.0799,43.5008]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.081,43.2129],[-92.5544,43.2128]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5544,43.2128],[-92.5531,43.5004]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4973,43.4996],[-93.4975,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4975,43.2553],[-93.9704,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5544,43.2128],[-93.0243,43.2128]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0243,43.2128],[-93.0241,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0241,43.2553],[-93.0242,43.4998]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0241,43.2553],[-93.4975,43.2553]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8619,43.2576],[-95.8595,42.9092]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8595,42.9092],[-96.5385,42.909]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3879,43.2553],[-95.3882,42.9099]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3882,42.9099],[-95.8595,42.9092]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9139,43.255],[-94.9139,42.9098]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9139,42.9098],[-95.3882,42.9099]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4432,42.9082],[-94.9139,42.9098]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4975,43.2553],[-93.4988,42.9084]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4988,42.9084],[-93.9714,42.9076]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0243,43.2128],[-93.0253,42.9076]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0253,42.9076],[-93.4988,42.9084]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0811,43.0828],[-92.0816,42.9068]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0816,42.9068],[-92.5543,42.9071]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5543,42.9071],[-92.5544,43.2128]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5543,42.9071],[-93.0253,42.9076]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.897,42.6751],[-90.8971,42.6456],[-91.133,42.6459]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.133,42.6459],[-91.6071,42.6439]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.6071,42.6439],[-91.6056,43.0816]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.6071,42.6439],[-92.0816,42.642]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0816,42.642],[-92.0816,42.9068]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8595,42.9092],[-95.8601,42.5606]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8601,42.5606],[-96.4991,42.561]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3882,42.9099],[-95.388,42.5617]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.388,42.5617],[-95.7416,42.5611]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.7416,42.5611],[-95.8601,42.5606]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9139,42.9098],[-94.9146,42.5603]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9146,42.5603],[-95.388,42.5617]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4432,42.9082],[-94.4431,42.6452]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4431,42.6452],[-94.443,42.5589]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.443,42.5589],[-94.9146,42.5603]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9714,42.9076],[-93.9713,42.6447]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9713,42.6447],[-94.4431,42.6452]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4988,42.9084],[-93.4996,42.5577]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4996,42.5577],[-93.9714,42.558]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9714,42.558],[-93.9713,42.6447]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0816,42.642],[-92.5544,42.6424]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5544,42.6424],[-92.5543,42.9071]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0253,42.9076],[-93.027,42.5568]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.027,42.5568],[-93.4996,42.5577]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5544,42.6424],[-92.5544,42.5557]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5544,42.5557],[-93.027,42.5568]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.4741,42.3819],[-90.6651,42.3823],[-90.6654,42.2947],[-90.8981,42.2948]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8981,42.2948],[-91.1303,42.2956]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1303,42.2956],[-91.133,42.6459]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1303,42.2956],[-91.3633,42.2963]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3633,42.2963],[-91.597,42.2964]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.597,42.2964],[-91.6071,42.6439]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9714,42.558],[-93.9317,42.4721],[-93.9315,42.21]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9315,42.21],[-94.1645,42.2099]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.1645,42.2099],[-94.3974,42.2092]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.3974,42.2092],[-94.3976,42.4734],[-94.443,42.5589]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.597,42.2964],[-91.8311,42.299]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.8311,42.299],[-92.0648,42.2973]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0648,42.2973],[-92.0816,42.642]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0648,42.2973],[-92.2986,42.2975]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.2986,42.2975],[-92.5336,42.297]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5336,42.297],[-92.5342,42.4696],[-92.5544,42.5557]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.7416,42.5611],[-95.7417,42.4748],[-95.6693,42.4748],[-95.6708,42.2115]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.6708,42.2115],[-96.357,42.2149]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.388,42.5617],[-95.3875,42.4748],[-95.3222,42.4746],[-95.3233,42.211]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3233,42.211],[-95.6708,42.2115]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9146,42.5603],[-94.9147,42.4743],[-94.8566,42.474],[-94.8586,42.2097]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.8586,42.2097],[-95.0908,42.2103]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.0908,42.2103],[-95.3233,42.211]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.3974,42.2092],[-94.6287,42.2095]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.6287,42.2095],[-94.8586,42.2097]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4996,42.5577],[-93.4626,42.4708],[-93.463,42.2093]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.463,42.2093],[-93.6984,42.2093]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.6984,42.2093],[-93.9315,42.21]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.027,42.5568],[-93.003,42.4707],[-93.0017,42.2092]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0017,42.2092],[-93.2318,42.2089]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.2318,42.2089],[-93.463,42.2093]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5336,42.297],[-92.7682,42.2966],[-92.7676,42.2103]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.7676,42.2103],[-93.0017,42.2092]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.1544,42.0332],[-90.8984,42.0336]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8984,42.0336],[-90.8981,42.2948]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8984,42.0336],[-90.8986,41.9463]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8986,41.9463],[-91.3659,41.9474]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3659,41.9474],[-91.3633,42.2963]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3659,41.9474],[-91.3662,41.86]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3662,41.86],[-91.8315,41.8618]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.8315,41.8618],[-91.8311,42.299]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.8315,41.8618],[-92.298,41.8629]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.298,41.8629],[-92.2986,42.2975]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.298,41.8629],[-92.7664,41.8624]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.7664,41.8624],[-92.7676,42.2103]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.6708,42.2115],[-95.6728,41.8631]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.6728,41.8631],[-96.1395,41.8663]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.0908,42.2103],[-95.0928,41.8634]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.0928,41.8634],[-95.5572,41.8634]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.5572,41.8634],[-95.6728,41.8631]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.6287,42.2095],[-94.6287,41.863]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.6287,41.863],[-94.7448,41.8623]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.7448,41.8623],[-95.0928,41.8634]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.1645,42.2099],[-94.1643,41.8634]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.1643,41.8634],[-94.2805,41.863]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.2805,41.863],[-94.6287,41.863]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.6984,42.2093],[-93.6981,41.8633]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.6981,41.8633],[-93.8159,41.8635]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.8159,41.8635],[-94.1643,41.8634]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.2318,42.2089],[-93.2318,41.8627]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.2318,41.8627],[-93.3479,41.8631]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.3479,41.8631],[-93.6981,41.8633]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.7664,41.8624],[-93.2318,41.8627]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.3168,41.7289],[-90.4359,41.7597],[-90.6578,41.7647],[-90.7329,41.7375],[-90.7863,41.7714],[-90.8988,41.7715]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8988,41.7715],[-90.8986,41.9463]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8988,41.7715],[-90.8999,41.597]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.8999,41.597],[-91.3665,41.5984]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3665,41.5984],[-91.3662,41.86]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.5572,41.8634],[-95.5582,41.6024],[-95.4979,41.6023],[-95.4981,41.506]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.4981,41.506],[-95.9964,41.5069]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.0928,41.8634],[-95.0926,41.6022],[-95.0408,41.6023],[-95.0408,41.5051]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.0408,41.5051],[-95.1547,41.5053]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.1547,41.5053],[-95.4981,41.506]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.7448,41.8623],[-94.7441,41.6022],[-94.7005,41.5043]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.7005,41.5043],[-95.0408,41.5051]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.2805,41.863],[-94.2801,41.6015],[-94.2415,41.5036]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.2415,41.5036],[-94.7005,41.5043]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3665,41.5984],[-91.3685,41.4232]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3685,41.4232],[-91.4841,41.424]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.4841,41.424],[-91.5265,41.5098],[-91.8294,41.5117]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.8294,41.5117],[-91.8315,41.8618]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.8159,41.8635],[-93.8142,41.6005],[-93.7905,41.5119]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":null,"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.7905,41.5119],[-93.8969,41.503],[-94.2415,41.5036]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.8294,41.5117],[-91.9458,41.5111]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.9458,41.5111],[-92.2973,41.5098]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.2973,41.5098],[-92.298,41.8629]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.3479,41.8631],[-93.3488,41.6008],[-93.3286,41.5079]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.3286,41.5079],[-93.3285,41.492]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.3285,41.492],[-93.4136,41.5072],[-93.7905,41.5119]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.2973,41.5098],[-92.4119,41.5096]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.4119,41.5096],[-92.7566,41.5088]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.7566,41.5088],[-92.7664,41.8624]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.7566,41.5088],[-92.8718,41.5085]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.8718,41.5085],[-93.3286,41.5079]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.7863,41.4529],[-90.7838,41.5965],[-90.8999,41.597]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.0722,41.3337],[-91.3694,41.3359],[-91.3685,41.4232]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.1547,41.5053],[-95.1558,41.1593]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.1558,41.1593],[-95.3843,41.16]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3843,41.16],[-95.8814,41.1603]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.7005,41.5043],[-94.7005,41.158]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.7005,41.158],[-94.9275,41.1587]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9275,41.1587],[-95.1558,41.1593]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.4841,41.424],[-91.4859,41.1624]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.4859,41.1624],[-91.7161,41.163]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7161,41.163],[-91.9459,41.1637]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.9459,41.1637],[-91.9458,41.5111]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.2415,41.5036],[-94.2416,41.1571]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.2416,41.1571],[-94.4707,41.1575]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4707,41.1575],[-94.7005,41.158]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.9459,41.1637],[-92.1802,41.1626]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.1802,41.1626],[-92.4104,41.1619]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.4104,41.1619],[-92.4119,41.5096]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.3285,41.492],[-93.328,41.1607]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.328,41.1607],[-93.5575,41.1614]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.5575,41.1614],[-93.7892,41.1621]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.7892,41.1621],[-93.7905,41.5119]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.7892,41.1621],[-94.0144,41.1567]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.0144,41.1567],[-94.2416,41.1571]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.4104,41.1619],[-92.6401,41.1613]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.6401,41.1613],[-92.87,41.1609]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.87,41.1609],[-92.8718,41.5085]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.87,41.1609],[-93.0993,41.1607]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0993,41.1607],[-93.328,41.1607]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.9492,41.0728],[-91.3708,41.0742]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3708,41.0742],[-91.3704,41.1612],[-91.4859,41.1624]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3843,41.16],[-95.3847,40.9016]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3847,40.9016],[-95.8129,40.9016]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9275,41.1587],[-94.9286,40.9007]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9286,40.9007],[-95.3847,40.9016]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4707,41.1575],[-94.471,40.8993]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.471,40.8993],[-94.9286,40.9007]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.3708,41.0742],[-91.372,40.8126],[-91.4092,40.813]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.4092,40.813],[-91.7188,40.8136]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7188,40.8136],[-91.7182,40.9011]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7182,40.9011],[-91.7161,41.163]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7182,40.9011],[-92.179,40.8999]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.179,40.8999],[-92.1802,41.1626]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.0144,41.1567],[-94.0148,40.897]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.0148,40.897],[-94.471,40.8993]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.179,40.8999],[-92.6393,40.899]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.6393,40.899],[-92.6401,41.1613]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.5575,41.1614],[-93.5565,40.8984]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.5565,40.8984],[-94.0148,40.897]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0993,41.1607],[-93.0976,40.8982]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0976,40.8982],[-93.5565,40.8984]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.6393,40.899],[-93.0976,40.8982]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1129,40.6965],[-91.4092,40.813]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3847,40.9016],[-95.374,40.5804]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9286,40.9007],[-94.9154,40.5752]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.471,40.8993],[-94.4713,40.5709]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.0148,40.897],[-94.0157,40.5742]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7188,40.8136],[-91.7168,40.5981]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.1797,40.6004],[-92.179,40.8999]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.6379,40.591],[-92.6393,40.899]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.5565,40.8984],[-93.557,40.5803]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0976,40.8982],[-93.0972,40.5839]]},"properties":{"RANK":1,"TYPE":"inner"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-96.5551,43.2599],[-96.5212,43.3759],[-96.5926,43.4329],[-96.5992,43.5003],[-95.8609,43.5]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8609,43.5],[-95.3878,43.5002]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.3878,43.5002],[-94.9148,43.5009]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9148,43.5009],[-94.4426,43.5004]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.6108,43.5006],[-91.2176,43.5008],[-91.2059,43.3517],[-91.1065,43.3137],[-91.0596,43.2589],[-91.1785,43.1273],[-91.1768,43.0803]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4426,43.5004],[-93.9709,43.4998]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.0799,43.5008],[-91.6108,43.5006]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.5531,43.5004],[-92.0799,43.5008]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.9709,43.4998],[-93.4973,43.4996]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0242,43.4998],[-92.5531,43.5004]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.4973,43.4996],[-93.0242,43.4998]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-96.5385,42.909],[-96.4364,43.1202],[-96.4755,43.2205],[-96.5551,43.2599]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1768,43.0803],[-91.1443,42.9051],[-91.0791,42.867],[-91.0531,42.738],[-90.897,42.6751]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-96.4991,42.561],[-96.5161,42.6303],[-96.6394,42.7363],[-96.5471,42.8578],[-96.5385,42.909]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.897,42.6751],[-90.7187,42.6403],[-90.6476,42.5459],[-90.6532,42.4771],[-90.4741,42.3819]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-96.357,42.2149],[-96.3233,42.2339],[-96.418,42.3548],[-96.3803,42.4472],[-96.4745,42.492],[-96.4991,42.561]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.4741,42.3819],[-90.4179,42.327],[-90.3927,42.2265],[-90.2089,42.1522],[-90.1628,42.1171],[-90.1544,42.0332]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-96.1395,41.8663],[-96.1307,41.9735],[-96.1922,41.9853],[-96.2794,42.0673],[-96.2662,42.1051],[-96.3499,42.1715],[-96.357,42.2149]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.1544,42.0332],[-90.1529,41.9114],[-90.1807,41.8107],[-90.3168,41.7289]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.9964,41.5069],[-96.0723,41.521],[-96.1186,41.6743],[-96.0646,41.7935],[-96.1395,41.8663]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.3168,41.7289],[-90.3433,41.5879],[-90.4594,41.5243],[-90.5569,41.5241],[-90.6531,41.4636],[-90.7863,41.4529]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.7863,41.4529],[-90.934,41.4216],[-91.0405,41.4187],[-91.0722,41.3337]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8814,41.1603],[-95.9261,41.21],[-95.8871,41.3188],[-95.9558,41.3431],[-95.926,41.4602],[-95.9964,41.5069]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.0722,41.3337],[-91.1142,41.25],[-91.0428,41.1672],[-90.9948,41.1607],[-90.9492,41.0728]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.8129,40.9016],[-95.8697,41.0075],[-95.8814,41.1603]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-90.9492,41.0728],[-90.963,40.9245],[-91.0899,40.8249],[-91.1129,40.6965]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-95.374,40.5804],[-95.7662,40.5853],[-95.7805,40.652],[-95.889,40.7349],[-95.8343,40.7876],[-95.8129,40.9016]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.9154,40.5752],[-95.374,40.5804]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.4713,40.5709],[-94.9154,40.5752]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-94.0157,40.5742],[-94.4713,40.5709]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.7168,40.5981],[-91.7294,40.6138],[-92.1797,40.6004]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.1797,40.6004],[-92.6379,40.591]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.557,40.5803],[-94.0157,40.5742]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-93.0972,40.5839],[-93.557,40.5803]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-92.6379,40.591],[-93.0972,40.5839]]},"properties":{"RANK":0,"TYPE":"outer"}}, +{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-91.1129,40.6965],[-91.1861,40.6375],[-91.3472,40.6105],[-91.407,40.5505],[-91.3677,40.5098],[-91.3791,40.3893],[-91.5257,40.4118],[-91.7168,40.5981]]},"properties":{"RANK":0,"TYPE":"outer"}} +]} \ No newline at end of file diff --git a/test/mosaic-test.mjs b/test/mosaic-test.mjs index b6d8a8181..fe20ced02 100644 --- a/test/mosaic-test.mjs +++ b/test/mosaic-test.mjs @@ -40,6 +40,14 @@ describe('mapshaper-mosaic.js', function () { }); }); + it ('BUGFIX -mosaic only uses paths from the target layer', async function() { + var cmd = '-i test/data/features/mosaic/two_polygons.json -dissolve2 + name=output -mosaic -o'; + var out = await api.applyCommands(cmd); + var json = JSON.parse(out['output.json']); + // Before the fix, 3 polygons were made + assert.equal(json.geometries.length, 1); + }); + it ('-mosaic name= option works without +', function(done) { var cmd = '-i input.json -mosaic name=cells -o'; api.applyCommands(cmd, {'input.json': figure1}, function(err, out) { diff --git a/test/polygons-test.mjs b/test/polygons-test.mjs index bbf8eac19..222e90295 100644 --- a/test/polygons-test.mjs +++ b/test/polygons-test.mjs @@ -23,6 +23,15 @@ describe('mapshaper-polygons.js', function () { }); }) + it('BUGFIX ignores paths from other layers in the same dataset', async function() { + var file = 'test/data/features/polygons/ia_county_lines.json'; + var cmd = `-i ${file} -filter + 'TYPE == "outer"' name=outline -polygons -o`; + var out = await api.applyCommands(cmd); + var json = JSON.parse(out['outline.json']); + // Before the fix, the command would make polygons from filtered-out paths + assert.equal(json.geometries.length, 1); + }); + it('creates a donut from two CCW lines', function(done) { // two CCW rings var input = {