diff --git a/packages/turf-hex-grid/index.js b/packages/turf-hex-grid/index.js index 8d1abfaf4b..c754fb61ad 100644 --- a/packages/turf-hex-grid/index.js +++ b/packages/turf-hex-grid/index.js @@ -115,7 +115,7 @@ function hexagon(center, rx, ry) { vertices.push([x, y]); } //first and last vertex must be the same - vertices.push(vertices[0]); + vertices.push(vertices[0].slice()); return polygon([vertices]); } diff --git a/packages/turf-transform-scale/index.js b/packages/turf-transform-scale/index.js index 72ffc2d174..4e4c552e20 100644 --- a/packages/turf-transform-scale/index.js +++ b/packages/turf-transform-scale/index.js @@ -1,4 +1,5 @@ var meta = require('@turf/meta'); +var clone = require('@turf/clone'); var center = require('@turf/center'); var helpers = require('@turf/helpers'); var centroid = require('@turf/centroid'); @@ -12,6 +13,7 @@ var coordEach = meta.coordEach; var featureEach = meta.featureEach; var getCoord = invariant.getCoord; var getCoords = invariant.getCoords; +var getGeomType = invariant.getGeomType; /** @@ -39,7 +41,7 @@ module.exports = function (geojson, factor, origin, mutate) { var originIsPoint = Array.isArray(origin) || typeof origin === 'object'; // Clone geojson to avoid side effects - if (mutate !== true) geojson = JSON.parse(JSON.stringify(geojson)); + if (mutate !== true) geojson = clone(geojson); // Scale each Feature separately if (geojson.type === 'FeatureCollection' && !originIsPoint) { @@ -56,21 +58,21 @@ module.exports = function (geojson, factor, origin, mutate) { * Scale Feature/Geometry * * @private - * @param {Feature|Geometry} geojson GeoJSON Feature/Geometry + * @param {Feature|Geometry} feature GeoJSON Feature/Geometry * @param {number} factor of scaling, positive or negative values greater than 0 * @param {string|Geometry|Feature|Array} [origin="centroid"] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid) * @returns {Feature|Geometry} scaled GeoJSON Feature/Geometry */ -function scale(geojson, factor, origin) { +function scale(feature, factor, origin) { // Default params - var isPoint = (geojson.type === 'Point' || geojson.geometry && geojson.geometry.type === 'Point'); - origin = defineOrigin(geojson, origin); + var isPoint = getGeomType(feature) === 'Point'; + origin = defineOrigin(feature, origin); // Shortcut no-scaling - if (factor === 1 || isPoint) return geojson; + if (factor === 1 || isPoint) return feature; // Scale each coordinate - coordEach(geojson, function (coord) { + coordEach(feature, function (coord) { var originalDistance = rhumbDistance(origin, coord); var bearing = rhumbBearing(origin, coord); var newDistance = originalDistance * factor; @@ -80,7 +82,7 @@ function scale(geojson, factor, origin) { if (coord.length === 3) coord[2] *= factor; }); - return geojson; + return feature; } /** diff --git a/packages/turf-transform-scale/package.json b/packages/turf-transform-scale/package.json index c769674f7d..937ddef7db 100644 --- a/packages/turf-transform-scale/package.json +++ b/packages/turf-transform-scale/package.json @@ -37,6 +37,7 @@ }, "homepage": "https://github.com/Turfjs/turf", "devDependencies": { + "@turf/hex-grid": "^4.6.1", "@turf/truncate": "^4.6.0", "benchmark": "^2.1.4", "load-json-file": "^2.0.0", @@ -47,6 +48,7 @@ "@turf/bbox": "^4.6.0", "@turf/center": "^4.6.1", "@turf/centroid": "^4.6.1", + "@turf/clone": "^4.6.1", "@turf/helpers": "^4.6.0", "@turf/invariant": "^4.6.0", "@turf/meta": "^4.6.0", diff --git a/packages/turf-transform-scale/test.js b/packages/turf-transform-scale/test.js index 3c710eea25..5df73a66fa 100644 --- a/packages/turf-transform-scale/test.js +++ b/packages/turf-transform-scale/test.js @@ -4,6 +4,7 @@ const path = require('path'); const load = require('load-json-file'); const write = require('write-json-file'); const center = require('@turf/center'); +const hexGrid = require('@turf/hex-grid'); const truncate = require('@turf/truncate'); const turfBBox = require('@turf/bbox'); const centroid = require('@turf/centroid'); @@ -95,6 +96,34 @@ test('scale -- mutated input', t => { t.end(); }); +test('scale -- mutated FeatureCollection', t => { + const line = featureCollection([ + lineString([[10, 10], [12, 15]]), + lineString([[15, 15], [22, 35]]), + lineString([[30, 30], [42, 45]]) + ]); + const lineBefore = JSON.parse(JSON.stringify(line)); + scale(line, 1.5); + t.deepEqual(line, lineBefore, 'mutate = undefined - input should NOT be mutated'); + scale(line, 1.5, 'centroid', false); + t.deepEqual(line, lineBefore, 'mutate = false - input should NOT be mutated'); + scale(line, 1.5, 'centroid', 'nonBoolean'); + t.deepEqual(line, lineBefore, 'non-boolean mutate - input should NOT be mutated'); + t.end(); +}); + +test('scale -- Issue #895', t => { + const grid = hexGrid([-122.930, 45.385, -122.294, 45.772], 5, 'miles'); + featureEach(grid, (feature, index) => { + const factor = (index % 2 === 0) ? 0.4 : 0.6; + scale(feature, factor, 'centroid', true); + }); + const output = directories.out + 'issue-#895.geojson'; + if (process.env.REGEN) write.sync(output, grid); + t.deepEqual(grid, load.sync(output)); + t.end(); +}); + test('scale -- geometry support', t => { const pt = point([10, 10]); const line = lineString([[10, 10], [12, 15]]); diff --git a/packages/turf-transform-scale/test/out/issue-#895.geojson b/packages/turf-transform-scale/test/out/issue-#895.geojson new file mode 100644 index 0000000000..75e04f7ca6 --- /dev/null +++ b/packages/turf-transform-scale/test/out/issue-#895.geojson @@ -0,0 +1,2462 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.9014017454366, + 45.40620972018069 + ], + [ + -122.91173924238899, + 45.418739922349374 + ], + [ + -122.93240735497511, + 45.418739922349374 + ], + [ + -122.94274485192756, + 45.40620972018069 + ], + [ + -122.932410793943, + 45.393679518012014 + ], + [ + -122.91173580342115, + 45.393679518012014 + ], + [ + -122.9014017454366, + 45.40620972018069 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.89106596881385, + 45.46886073102407 + ], + [ + -122.90657135803406, + 45.48765603427709 + ], + [ + -122.9375752393301, + 45.48765603427709 + ], + [ + -122.95308062855025, + 45.46886073102407 + ], + [ + -122.93757868582816, + 45.45006542777106 + ], + [ + -122.90656791153594, + 45.45006542777106 + ], + [ + -122.89106596881385, + 45.46886073102407 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.9014017454366, + 45.531511741867455 + ], + [ + -122.91173924993092, + 45.54404194403613 + ], + [ + -122.93240734743324, + 45.54404194403613 + ], + [ + -122.94274485192756, + 45.531511741867455 + ], + [ + -122.93241080147766, + 45.51898153969878 + ], + [ + -122.91173579588644, + 45.51898153969878 + ], + [ + -122.9014017454366, + 45.531511741867455 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.89106596881385, + 45.594162752710844 + ], + [ + -122.90657136559389, + 45.61295805596385 + ], + [ + -122.93757523177021, + 45.61295805596385 + ], + [ + -122.95308062855025, + 45.594162752710844 + ], + [ + -122.9375786933785, + 45.57536744945783 + ], + [ + -122.90656790398566, + 45.57536744945783 + ], + [ + -122.89106596881385, + 45.594162752710844 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.9014017454366, + 45.656813763554226 + ], + [ + -122.91173925750655, + 45.66934396572291 + ], + [ + -122.9324073398576, + 45.66934396572291 + ], + [ + -122.94274485192756, + 45.656813763554226 + ], + [ + -122.93241080904596, + 45.64428356138555 + ], + [ + -122.9117357883182, + 45.64428356138555 + ], + [ + -122.9014017454366, + 45.656813763554226 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.89106596881385, + 45.719464774397615 + ], + [ + -122.9065713731876, + 45.73826007765063 + ], + [ + -122.93757522417656, + 45.73826007765063 + ], + [ + -122.95308062855025, + 45.719464774397615 + ], + [ + -122.9375787009626, + 45.70066947114461 + ], + [ + -122.90656789640155, + 45.70066947114461 + ], + [ + -122.89106596881385, + 45.719464774397615 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.9014017454366, + 45.782115785241 + ], + [ + -122.91173926511613, + 45.79464598740967 + ], + [ + -122.93240733224798, + 45.79464598740967 + ], + [ + -122.94274485192756, + 45.782115785241 + ], + [ + -122.93241081664814, + 45.76958558307232 + ], + [ + -122.91173578071596, + 45.76958558307232 + ], + [ + -122.9014017454366, + 45.782115785241 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.81354764414334, + 45.37488421475899 + ], + [ + -122.82905302771564, + 45.39367951801201 + ], + [ + -122.86005692030744, + 45.39367951801201 + ], + [ + -122.87556230387975, + 45.37488421475899 + ], + [ + -122.86006035551691, + 45.356088911505985 + ], + [ + -122.82904959250618, + 45.356088911505985 + ], + [ + -122.81354764414334, + 45.37488421475899 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.82388342076604, + 45.43753522560238 + ], + [ + -122.8342209196008, + 45.45006542777106 + ], + [ + -122.85488902842229, + 45.45006542777106 + ], + [ + -122.86522652725705, + 45.43753522560238 + ], + [ + -122.85489247115305, + 45.425005023433705 + ], + [ + -122.8342174768701, + 45.425005023433705 + ], + [ + -122.82388342076604, + 45.43753522560238 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.81354764414334, + 45.500186236445764 + ], + [ + -122.8290530352503, + 45.51898153969878 + ], + [ + -122.86005691277279, + 45.51898153969878 + ], + [ + -122.87556230387975, + 45.500186236445764 + ], + [ + -122.86006036304207, + 45.48139093319275 + ], + [ + -122.82904958498102, + 45.48139093319275 + ], + [ + -122.81354764414334, + 45.500186236445764 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.82388342076604, + 45.56283724728916 + ], + [ + -122.83422092715114, + 45.575367449457836 + ], + [ + -122.85488902087195, + 45.575367449457836 + ], + [ + -122.86522652725705, + 45.56283724728916 + ], + [ + -122.85489247869606, + 45.55030704512048 + ], + [ + -122.83421746932703, + 45.55030704512048 + ], + [ + -122.82388342076604, + 45.56283724728916 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.81354764414334, + 45.62548825813253 + ], + [ + -122.8290530428186, + 45.64428356138555 + ], + [ + -122.86005690520449, + 45.64428356138555 + ], + [ + -122.87556230387975, + 45.62548825813253 + ], + [ + -122.86006037060082, + 45.60669295487952 + ], + [ + -122.82904957742227, + 45.60669295487952 + ], + [ + -122.81354764414334, + 45.62548825813253 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.82388342076604, + 45.68813926897593 + ], + [ + -122.83422093473519, + 45.70066947114461 + ], + [ + -122.8548890132879, + 45.70066947114461 + ], + [ + -122.86522652725705, + 45.68813926897593 + ], + [ + -122.85489248627277, + 45.67560906680725 + ], + [ + -122.83421746175031, + 45.67560906680725 + ], + [ + -122.82388342076604, + 45.68813926897593 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.81354764414334, + 45.750790279819306 + ], + [ + -122.82905305042084, + 45.76958558307232 + ], + [ + -122.8600568976023, + 45.76958558307232 + ], + [ + -122.87556230387975, + 45.750790279819306 + ], + [ + -122.8600603781934, + 45.7319949765663 + ], + [ + -122.82904956982969, + 45.7319949765663 + ], + [ + -122.81354764414334, + 45.750790279819306 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.74636509609559, + 45.40620972018069 + ], + [ + -122.75670259304798, + 45.418739922349374 + ], + [ + -122.7773707056341, + 45.418739922349374 + ], + [ + -122.78770820258649, + 45.40620972018069 + ], + [ + -122.77737414460199, + 45.393679518012014 + ], + [ + -122.75669915408008, + 45.393679518012014 + ], + [ + -122.74636509609559, + 45.40620972018069 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.73602931947283, + 45.46886073102407 + ], + [ + -122.75153470869299, + 45.48765603427709 + ], + [ + -122.78253858998903, + 45.48765603427709 + ], + [ + -122.79804397920924, + 45.46886073102407 + ], + [ + -122.78254203648714, + 45.45006542777106 + ], + [ + -122.75153126219493, + 45.45006542777106 + ], + [ + -122.73602931947283, + 45.46886073102407 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.74636509609559, + 45.531511741867455 + ], + [ + -122.7567026005899, + 45.54404194403613 + ], + [ + -122.77737069809223, + 45.54404194403613 + ], + [ + -122.78770820258649, + 45.531511741867455 + ], + [ + -122.77737415213664, + 45.51898153969878 + ], + [ + -122.75669914654543, + 45.51898153969878 + ], + [ + -122.74636509609559, + 45.531511741867455 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.73602931947283, + 45.594162752710844 + ], + [ + -122.75153471625288, + 45.61295805596385 + ], + [ + -122.7825385824292, + 45.61295805596385 + ], + [ + -122.79804397920924, + 45.594162752710844 + ], + [ + -122.78254204403743, + 45.57536744945783 + ], + [ + -122.75153125464465, + 45.57536744945783 + ], + [ + -122.73602931947283, + 45.594162752710844 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.74636509609559, + 45.656813763554226 + ], + [ + -122.75670260816554, + 45.66934396572291 + ], + [ + -122.77737069051653, + 45.66934396572291 + ], + [ + -122.78770820258649, + 45.656813763554226 + ], + [ + -122.77737415970495, + 45.64428356138555 + ], + [ + -122.75669913897713, + 45.64428356138555 + ], + [ + -122.74636509609559, + 45.656813763554226 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.73602931947283, + 45.719464774397615 + ], + [ + -122.75153472384659, + 45.73826007765063 + ], + [ + -122.78253857483548, + 45.73826007765063 + ], + [ + -122.79804397920924, + 45.719464774397615 + ], + [ + -122.78254205162153, + 45.70066947114461 + ], + [ + -122.75153124706054, + 45.70066947114461 + ], + [ + -122.73602931947283, + 45.719464774397615 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.74636509609559, + 45.782115785241 + ], + [ + -122.75670261577511, + 45.79464598740967 + ], + [ + -122.77737068290696, + 45.79464598740967 + ], + [ + -122.78770820258649, + 45.782115785241 + ], + [ + -122.77737416730713, + 45.76958558307232 + ], + [ + -122.75669913137494, + 45.76958558307232 + ], + [ + -122.74636509609559, + 45.782115785241 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.65851099480233, + 45.37488421475899 + ], + [ + -122.67401637837463, + 45.39367951801201 + ], + [ + -122.70502027096637, + 45.39367951801201 + ], + [ + -122.72052565453873, + 45.37488421475899 + ], + [ + -122.7050237061759, + 45.356088911505985 + ], + [ + -122.67401294316517, + 45.356088911505985 + ], + [ + -122.65851099480233, + 45.37488421475899 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.66884677142502, + 45.43753522560238 + ], + [ + -122.67918427025978, + 45.45006542777106 + ], + [ + -122.69985237908122, + 45.45006542777106 + ], + [ + -122.71018987791604, + 45.43753522560238 + ], + [ + -122.69985582181198, + 45.425005023433705 + ], + [ + -122.67918082752902, + 45.425005023433705 + ], + [ + -122.66884677142502, + 45.43753522560238 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.65851099480233, + 45.500186236445764 + ], + [ + -122.67401638590928, + 45.51898153969878 + ], + [ + -122.70502026343178, + 45.51898153969878 + ], + [ + -122.72052565453873, + 45.500186236445764 + ], + [ + -122.70502371370105, + 45.48139093319275 + ], + [ + -122.67401293563995, + 45.48139093319275 + ], + [ + -122.65851099480233, + 45.500186236445764 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.66884677142502, + 45.56283724728916 + ], + [ + -122.67918427781012, + 45.575367449457836 + ], + [ + -122.69985237153094, + 45.575367449457836 + ], + [ + -122.71018987791604, + 45.56283724728916 + ], + [ + -122.69985582935504, + 45.55030704512048 + ], + [ + -122.67918081998602, + 45.55030704512048 + ], + [ + -122.66884677142502, + 45.56283724728916 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.65851099480233, + 45.62548825813253 + ], + [ + -122.67401639347759, + 45.64428356138555 + ], + [ + -122.70502025586347, + 45.64428356138555 + ], + [ + -122.72052565453873, + 45.62548825813253 + ], + [ + -122.7050237212598, + 45.60669295487952 + ], + [ + -122.67401292808125, + 45.60669295487952 + ], + [ + -122.65851099480233, + 45.62548825813253 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.66884677142502, + 45.68813926897593 + ], + [ + -122.67918428539417, + 45.70066947114461 + ], + [ + -122.69985236394689, + 45.70066947114461 + ], + [ + -122.71018987791604, + 45.68813926897593 + ], + [ + -122.69985583693176, + 45.67560906680725 + ], + [ + -122.67918081240924, + 45.67560906680725 + ], + [ + -122.66884677142502, + 45.68813926897593 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.65851099480233, + 45.750790279819306 + ], + [ + -122.67401640107977, + 45.76958558307232 + ], + [ + -122.70502024826123, + 45.76958558307232 + ], + [ + -122.72052565453873, + 45.750790279819306 + ], + [ + -122.70502372885232, + 45.7319949765663 + ], + [ + -122.67401292048868, + 45.7319949765663 + ], + [ + -122.65851099480233, + 45.750790279819306 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.59132844675452, + 45.40620972018069 + ], + [ + -122.60166594370696, + 45.418739922349374 + ], + [ + -122.62233405629303, + 45.418739922349374 + ], + [ + -122.63267155324547, + 45.40620972018069 + ], + [ + -122.62233749526092, + 45.393679518012014 + ], + [ + -122.60166250473901, + 45.393679518012014 + ], + [ + -122.59132844675452, + 45.40620972018069 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.58099267013176, + 45.46886073102407 + ], + [ + -122.59649805935192, + 45.48765603427709 + ], + [ + -122.62750194064802, + 45.48765603427709 + ], + [ + -122.64300732986817, + 45.46886073102407 + ], + [ + -122.62750538714613, + 45.45006542777106 + ], + [ + -122.59649461285386, + 45.45006542777106 + ], + [ + -122.58099267013176, + 45.46886073102407 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.59132844675452, + 45.531511741867455 + ], + [ + -122.60166595124883, + 45.54404194403613 + ], + [ + -122.62233404875116, + 45.54404194403613 + ], + [ + -122.63267155324547, + 45.531511741867455 + ], + [ + -122.62233750279557, + 45.51898153969878 + ], + [ + -122.60166249720436, + 45.51898153969878 + ], + [ + -122.59132844675452, + 45.531511741867455 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.58099267013176, + 45.594162752710844 + ], + [ + -122.5964980669118, + 45.61295805596385 + ], + [ + -122.62750193308818, + 45.61295805596385 + ], + [ + -122.64300732986817, + 45.594162752710844 + ], + [ + -122.62750539469641, + 45.57536744945783 + ], + [ + -122.59649460530358, + 45.57536744945783 + ], + [ + -122.58099267013176, + 45.594162752710844 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.59132844675452, + 45.656813763554226 + ], + [ + -122.60166595882447, + 45.66934396572291 + ], + [ + -122.62233404117552, + 45.66934396572291 + ], + [ + -122.63267155324547, + 45.656813763554226 + ], + [ + -122.62233751036388, + 45.64428356138555 + ], + [ + -122.60166248963606, + 45.64428356138555 + ], + [ + -122.59132844675452, + 45.656813763554226 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.58099267013176, + 45.719464774397615 + ], + [ + -122.59649807450552, + 45.73826007765063 + ], + [ + -122.62750192549447, + 45.73826007765063 + ], + [ + -122.64300732986817, + 45.719464774397615 + ], + [ + -122.62750540228046, + 45.70066947114461 + ], + [ + -122.59649459771947, + 45.70066947114461 + ], + [ + -122.58099267013176, + 45.719464774397615 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.59132844675452, + 45.782115785241 + ], + [ + -122.60166596643404, + 45.79464598740967 + ], + [ + -122.62233403356595, + 45.79464598740967 + ], + [ + -122.63267155324547, + 45.782115785241 + ], + [ + -122.62233751796612, + 45.76958558307232 + ], + [ + -122.60166248203387, + 45.76958558307232 + ], + [ + -122.59132844675452, + 45.782115785241 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.50347434546131, + 45.37488421475899 + ], + [ + -122.51897972903356, + 45.39367951801201 + ], + [ + -122.54998362162536, + 45.39367951801201 + ], + [ + -122.56548900519772, + 45.37488421475899 + ], + [ + -122.54998705683482, + 45.356088911505985 + ], + [ + -122.5189762938241, + 45.356088911505985 + ], + [ + -122.50347434546131, + 45.37488421475899 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.51381012208401, + 45.43753522560238 + ], + [ + -122.52414762091877, + 45.45006542777106 + ], + [ + -122.54481572974021, + 45.45006542777106 + ], + [ + -122.55515322857491, + 45.43753522560238 + ], + [ + -122.54481917247097, + 45.425005023433705 + ], + [ + -122.52414417818801, + 45.425005023433705 + ], + [ + -122.51381012208401, + 45.43753522560238 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.50347434546131, + 45.500186236445764 + ], + [ + -122.51897973656821, + 45.51898153969878 + ], + [ + -122.5499836140907, + 45.51898153969878 + ], + [ + -122.56548900519772, + 45.500186236445764 + ], + [ + -122.54998706436004, + 45.48139093319275 + ], + [ + -122.51897628629894, + 45.48139093319275 + ], + [ + -122.50347434546131, + 45.500186236445764 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.51381012208401, + 45.56283724728916 + ], + [ + -122.52414762846905, + 45.575367449457836 + ], + [ + -122.54481572218992, + 45.575367449457836 + ], + [ + -122.55515322857491, + 45.56283724728916 + ], + [ + -122.54481918001397, + 45.55030704512048 + ], + [ + -122.52414417064495, + 45.55030704512048 + ], + [ + -122.51381012208401, + 45.56283724728916 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.50347434546131, + 45.62548825813253 + ], + [ + -122.51897974413657, + 45.64428356138555 + ], + [ + -122.5499836065224, + 45.64428356138555 + ], + [ + -122.56548900519772, + 45.62548825813253 + ], + [ + -122.54998707191874, + 45.60669295487952 + ], + [ + -122.51897627874018, + 45.60669295487952 + ], + [ + -122.50347434546131, + 45.62548825813253 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.51381012208401, + 45.68813926897593 + ], + [ + -122.52414763605316, + 45.70066947114461 + ], + [ + -122.54481571460582, + 45.70066947114461 + ], + [ + -122.55515322857491, + 45.68813926897593 + ], + [ + -122.54481918759075, + 45.67560906680725 + ], + [ + -122.52414416306823, + 45.67560906680725 + ], + [ + -122.51381012208401, + 45.68813926897593 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.50347434546131, + 45.750790279819306 + ], + [ + -122.5189797517387, + 45.76958558307232 + ], + [ + -122.54998359892022, + 45.76958558307232 + ], + [ + -122.56548900519772, + 45.750790279819306 + ], + [ + -122.54998707951131, + 45.7319949765663 + ], + [ + -122.51897627114766, + 45.7319949765663 + ], + [ + -122.50347434546131, + 45.750790279819306 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.4362917974135, + 45.40620972018069 + ], + [ + -122.44662929436589, + 45.418739922349374 + ], + [ + -122.46729740695201, + 45.418739922349374 + ], + [ + -122.47763490390446, + 45.40620972018069 + ], + [ + -122.46730084591991, + 45.393679518012014 + ], + [ + -122.446625855398, + 45.393679518012014 + ], + [ + -122.4362917974135, + 45.40620972018069 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.42595602079075, + 45.46886073102407 + ], + [ + -122.4414614100109, + 45.48765603427709 + ], + [ + -122.472465291307, + 45.48765603427709 + ], + [ + -122.48797068052716, + 45.46886073102407 + ], + [ + -122.47246873780512, + 45.45006542777106 + ], + [ + -122.44145796351285, + 45.45006542777106 + ], + [ + -122.42595602079075, + 45.46886073102407 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.4362917974135, + 45.531511741867455 + ], + [ + -122.44662930190782, + 45.54404194403613 + ], + [ + -122.46729739941009, + 45.54404194403613 + ], + [ + -122.47763490390446, + 45.531511741867455 + ], + [ + -122.46730085345456, + 45.51898153969878 + ], + [ + -122.44662584786334, + 45.51898153969878 + ], + [ + -122.4362917974135, + 45.531511741867455 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.42595602079075, + 45.594162752710844 + ], + [ + -122.44146141757074, + 45.61295805596385 + ], + [ + -122.47246528374717, + 45.61295805596385 + ], + [ + -122.48797068052716, + 45.594162752710844 + ], + [ + -122.4724687453554, + 45.57536744945783 + ], + [ + -122.4414579559625, + 45.57536744945783 + ], + [ + -122.42595602079075, + 45.594162752710844 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.4362917974135, + 45.656813763554226 + ], + [ + -122.44662930948346, + 45.66934396572291 + ], + [ + -122.46729739183445, + 45.66934396572291 + ], + [ + -122.47763490390446, + 45.656813763554226 + ], + [ + -122.46730086102286, + 45.64428356138555 + ], + [ + -122.44662584029504, + 45.64428356138555 + ], + [ + -122.4362917974135, + 45.656813763554226 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.42595602079075, + 45.719464774397615 + ], + [ + -122.4414614251645, + 45.73826007765063 + ], + [ + -122.47246527615346, + 45.73826007765063 + ], + [ + -122.48797068052716, + 45.719464774397615 + ], + [ + -122.47246875293945, + 45.70066947114461 + ], + [ + -122.44145794837846, + 45.70066947114461 + ], + [ + -122.42595602079075, + 45.719464774397615 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.4362917974135, + 45.782115785241 + ], + [ + -122.44662931709297, + 45.79464598740967 + ], + [ + -122.46729738422488, + 45.79464598740967 + ], + [ + -122.47763490390446, + 45.782115785241 + ], + [ + -122.46730086862505, + 45.76958558307232 + ], + [ + -122.44662583269286, + 45.76958558307232 + ], + [ + -122.4362917974135, + 45.782115785241 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.34843769612024, + 45.37488421475899 + ], + [ + -122.3639430796926, + 45.39367951801201 + ], + [ + -122.39494697228434, + 45.39367951801201 + ], + [ + -122.41045235585665, + 45.37488421475899 + ], + [ + -122.39495040749381, + 45.356088911505985 + ], + [ + -122.36393964448308, + 45.356088911505985 + ], + [ + -122.34843769612024, + 45.37488421475899 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.358773472743, + 45.43753522560238 + ], + [ + -122.3691109715777, + 45.45006542777106 + ], + [ + -122.3897790803992, + 45.45006542777106 + ], + [ + -122.40011657923395, + 45.43753522560238 + ], + [ + -122.38978252312995, + 45.425005023433705 + ], + [ + -122.36910752884694, + 45.425005023433705 + ], + [ + -122.358773472743, + 45.43753522560238 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.34843769612024, + 45.500186236445764 + ], + [ + -122.3639430872272, + 45.51898153969878 + ], + [ + -122.39494696474969, + 45.51898153969878 + ], + [ + -122.41045235585665, + 45.500186236445764 + ], + [ + -122.39495041501903, + 45.48139093319275 + ], + [ + -122.36393963695792, + 45.48139093319275 + ], + [ + -122.34843769612024, + 45.500186236445764 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.358773472743, + 45.56283724728916 + ], + [ + -122.36911097912804, + 45.575367449457836 + ], + [ + -122.38977907284885, + 45.575367449457836 + ], + [ + -122.40011657923395, + 45.56283724728916 + ], + [ + -122.38978253067296, + 45.55030704512048 + ], + [ + -122.36910752130393, + 45.55030704512048 + ], + [ + -122.358773472743, + 45.56283724728916 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.34843769612024, + 45.62548825813253 + ], + [ + -122.36394309479556, + 45.64428356138555 + ], + [ + -122.39494695718139, + 45.64428356138555 + ], + [ + -122.41045235585665, + 45.62548825813253 + ], + [ + -122.39495042257772, + 45.60669295487952 + ], + [ + -122.36393962939917, + 45.60669295487952 + ], + [ + -122.34843769612024, + 45.62548825813253 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.358773472743, + 45.68813926897593 + ], + [ + -122.36911098671214, + 45.70066947114461 + ], + [ + -122.38977906526475, + 45.70066947114461 + ], + [ + -122.40011657923395, + 45.68813926897593 + ], + [ + -122.38978253824973, + 45.67560906680725 + ], + [ + -122.36910751372722, + 45.67560906680725 + ], + [ + -122.358773472743, + 45.68813926897593 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.34843769612024, + 45.750790279819306 + ], + [ + -122.36394310239774, + 45.76958558307232 + ], + [ + -122.39494694957921, + 45.76958558307232 + ], + [ + -122.41045235585665, + 45.750790279819306 + ], + [ + -122.3949504301703, + 45.7319949765663 + ], + [ + -122.3639396218066, + 45.7319949765663 + ], + [ + -122.34843769612024, + 45.750790279819306 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.28125514807243, + 45.40620972018069 + ], + [ + -122.29159264502488, + 45.418739922349374 + ], + [ + -122.312260757611, + 45.418739922349374 + ], + [ + -122.32259825456345, + 45.40620972018069 + ], + [ + -122.3122641965789, + 45.393679518012014 + ], + [ + -122.29158920605698, + 45.393679518012014 + ], + [ + -122.28125514807243, + 45.40620972018069 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.27091937144974, + 45.46886073102407 + ], + [ + -122.28642476066989, + 45.48765603427709 + ], + [ + -122.31742864196599, + 45.48765603427709 + ], + [ + -122.33293403118614, + 45.46886073102407 + ], + [ + -122.31743208846405, + 45.45006542777106 + ], + [ + -122.28642131417183, + 45.45006542777106 + ], + [ + -122.27091937144974, + 45.46886073102407 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.28125514807243, + 45.531511741867455 + ], + [ + -122.2915926525668, + 45.54404194403613 + ], + [ + -122.31226075006907, + 45.54404194403613 + ], + [ + -122.32259825456345, + 45.531511741867455 + ], + [ + -122.31226420411355, + 45.51898153969878 + ], + [ + -122.29158919852233, + 45.51898153969878 + ], + [ + -122.28125514807243, + 45.531511741867455 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.27091937144974, + 45.594162752710844 + ], + [ + -122.28642476822978, + 45.61295805596385 + ], + [ + -122.3174286344061, + 45.61295805596385 + ], + [ + -122.33293403118614, + 45.594162752710844 + ], + [ + -122.31743209601439, + 45.57536744945783 + ], + [ + -122.28642130662149, + 45.57536744945783 + ], + [ + -122.27091937144974, + 45.594162752710844 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.28125514807243, + 45.656813763554226 + ], + [ + -122.29159266014244, + 45.66934396572291 + ], + [ + -122.31226074249344, + 45.66934396572291 + ], + [ + -122.32259825456345, + 45.656813763554226 + ], + [ + -122.31226421168185, + 45.64428356138555 + ], + [ + -122.29158919095403, + 45.64428356138555 + ], + [ + -122.28125514807243, + 45.656813763554226 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.27091937144974, + 45.719464774397615 + ], + [ + -122.28642477582343, + 45.73826007765063 + ], + [ + -122.31742862681244, + 45.73826007765063 + ], + [ + -122.33293403118614, + 45.719464774397615 + ], + [ + -122.31743210359843, + 45.70066947114461 + ], + [ + -122.28642129903744, + 45.70066947114461 + ], + [ + -122.27091937144974, + 45.719464774397615 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -122.28125514807243, + 45.782115785241 + ], + [ + -122.29159266775201, + 45.79464598740967 + ], + [ + -122.31226073488386, + 45.79464598740967 + ], + [ + -122.32259825456345, + 45.782115785241 + ], + [ + -122.31226421928403, + 45.76958558307232 + ], + [ + -122.29158918335185, + 45.76958558307232 + ], + [ + -122.28125514807243, + 45.782115785241 + ] + ] + ] + } + } + ] +} diff --git a/packages/turf-transform-scale/yarn.lock b/packages/turf-transform-scale/yarn.lock index f4f129e438..e3ac19e177 100644 --- a/packages/turf-transform-scale/yarn.lock +++ b/packages/turf-transform-scale/yarn.lock @@ -2,6 +2,85 @@ # yarn lockfile v1 +"@turf/bbox@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/bbox/-/bbox-4.6.0.tgz#8c7f68cdd2bee9178de4d9f9bfbcee4235db5fc3" + dependencies: + "@turf/meta" "^4.6.0" + +"@turf/center@^4.6.1": + version "4.6.1" + resolved "https://registry.yarnpkg.com/@turf/center/-/center-4.6.1.tgz#d9ed7a7e098f6ac1ff5189a05ee752b60d7ac681" + dependencies: + "@turf/bbox" "^4.6.0" + "@turf/helpers" "^4.6.0" + +"@turf/centroid@^4.6.1": + version "4.6.1" + resolved "https://registry.yarnpkg.com/@turf/centroid/-/centroid-4.6.1.tgz#6ffe203746aa33dec17d41c22aa5691342e46496" + dependencies: + "@turf/helpers" "^4.6.0" + "@turf/meta" "^4.6.0" + +"@turf/clone@^4.6.1": + version "4.6.1" + resolved "https://registry.yarnpkg.com/@turf/clone/-/clone-4.6.1.tgz#e4136d9dca48a7065a61454009275c63a9f68121" + +"@turf/distance@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/distance/-/distance-4.6.0.tgz#6410b9b4ea7e44e4a99be33018d9daab031946e0" + dependencies: + "@turf/helpers" "^4.6.0" + "@turf/invariant" "^4.6.0" + +"@turf/helpers@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-4.6.0.tgz#12398733b8ae28420df6166fa44c7ee8ffd6414c" + +"@turf/hex-grid@^4.6.1": + version "4.6.1" + resolved "https://registry.yarnpkg.com/@turf/hex-grid/-/hex-grid-4.6.1.tgz#211ee084cad9c5ba60ceb36a2994e4bf6962f746" + dependencies: + "@turf/distance" "^4.6.0" + "@turf/helpers" "^4.6.0" + +"@turf/invariant@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-4.6.0.tgz#ba61401d537543f81ccfc588e12bb0d8e653dd80" + +"@turf/meta@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-4.6.0.tgz#0d3f9a218e58d1c5e5deedf467c3321dd61203f3" + +"@turf/rhumb-bearing@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/rhumb-bearing/-/rhumb-bearing-4.6.0.tgz#550821a34317f274e4eb90363ec32ce2ea94c2a9" + dependencies: + "@turf/invariant" "^4.6.0" + geodesy "1.1.1" + +"@turf/rhumb-destination@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/rhumb-destination/-/rhumb-destination-4.6.0.tgz#d21d3c76fa7b7312e5b1f3b40083aefb99879a86" + dependencies: + "@turf/helpers" "^4.6.0" + "@turf/invariant" "^4.6.0" + geodesy "1.1.1" + +"@turf/rhumb-distance@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/rhumb-distance/-/rhumb-distance-4.6.0.tgz#2a4fbb510f0be2a2cc8f50e9f3e59fac2ec590fb" + dependencies: + "@turf/helpers" "^4.6.0" + "@turf/invariant" "^4.6.0" + geodesy "1.1.1" + +"@turf/truncate@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@turf/truncate/-/truncate-4.6.0.tgz#903ad5ed34c0b851b93529975eb8e2eb769a561f" + dependencies: + "@turf/meta" "^4.6.0" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -84,6 +163,10 @@ function-bind@^1.0.2, function-bind@^1.1.0, function-bind@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +geodesy@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/geodesy/-/geodesy-1.1.1.tgz#918c414a5cc247c8128332b7624050c467e98a5d" + glob@~7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"