@turf/buffer 7.0.0 → 7.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // index.js
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// index.js
5
2
  var _center = require('@turf/center');
6
3
  var _jsts = require('@turf/jsts'); var _jsts2 = _interopRequireDefault(_jsts);
7
4
  var _meta = require('@turf/meta');
@@ -51,7 +48,6 @@ function buffer(geojson, radius, options) {
51
48
  }
52
49
  return bufferFeature(geojson, radius, units, steps);
53
50
  }
54
- __name(buffer, "buffer");
55
51
  function bufferFeature(geojson, radius, units, steps) {
56
52
  var properties = geojson.properties || {};
57
53
  var geometry = geojson.type === "Feature" ? geojson.geometry : geojson;
@@ -83,13 +79,11 @@ function bufferFeature(geojson, radius, units, steps) {
83
79
  };
84
80
  return _helpers.feature.call(void 0, result, properties);
85
81
  }
86
- __name(bufferFeature, "bufferFeature");
87
82
  function coordsIsNaN(coords) {
88
83
  if (Array.isArray(coords[0]))
89
84
  return coordsIsNaN(coords[0]);
90
85
  return isNaN(coords[0]);
91
86
  }
92
- __name(coordsIsNaN, "coordsIsNaN");
93
87
  function projectCoords(coords, proj) {
94
88
  if (typeof coords[0] !== "object")
95
89
  return proj(coords);
@@ -97,7 +91,6 @@ function projectCoords(coords, proj) {
97
91
  return projectCoords(coord, proj);
98
92
  });
99
93
  }
100
- __name(projectCoords, "projectCoords");
101
94
  function unprojectCoords(coords, proj) {
102
95
  if (typeof coords[0] !== "object")
103
96
  return proj.invert(coords);
@@ -105,13 +98,11 @@ function unprojectCoords(coords, proj) {
105
98
  return unprojectCoords(coord, proj);
106
99
  });
107
100
  }
108
- __name(unprojectCoords, "unprojectCoords");
109
101
  function defineProjection(geojson) {
110
102
  var coords = _center.center.call(void 0, geojson).geometry.coordinates;
111
103
  var rotation = [-coords[0], -coords[1]];
112
104
  return _d3geo.geoAzimuthalEquidistant.call(void 0, ).rotate(rotation).scale(_helpers.earthRadius);
113
105
  }
114
- __name(defineProjection, "defineProjection");
115
106
  var turf_buffer_default = buffer;
116
107
 
117
108
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.js"],"names":["feature","geometry","buffered"],"mappings":";;;;AAAA,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,UAAU,mBAAmB;AACtC,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,EAAE,UAAU,eAAe,cAAc,IAAI;AAyBnD,SAAS,OAAO,SAAS,QAAQ,SAAS;AAExC,YAAU,WAAW,CAAC;AAGtB,MAAI,QAAQ,QAAQ,SAAS;AAC7B,MAAI,QAAQ,QAAQ,SAAS;AAG7B,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,OAAO,YAAY;AAAU,UAAM,IAAI,MAAM,2BAA2B;AAC5E,MAAI,OAAO,UAAU;AAAU,UAAM,IAAI,MAAM,yBAAyB;AAGxE,MAAI,WAAW;AAAW,UAAM,IAAI,MAAM,oBAAoB;AAC9D,MAAI,SAAS;AAAG,UAAM,IAAI,MAAM,8BAA8B;AAE9D,MAAI,UAAU,CAAC;AACf,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,eAAS,SAAS,SAAU,UAAU;AACpC,YAAI,WAAW,cAAc,UAAU,QAAQ,OAAO,KAAK;AAC3D,YAAI;AAAU,kBAAQ,KAAK,QAAQ;AAAA,MACrC,CAAC;AACD,aAAO,kBAAkB,OAAO;AAAA,IAClC,KAAK;AACH,kBAAY,SAAS,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SAAS,YAAY,QAAQ;AAC3B,MAAI,MAAM,QAAQ,OAAO,CAAC,CAAC;AAAG,WAAO,YAAY,OAAO,CAAC,CAAC;AAC1D,SAAO,MAAM,OAAO,CAAC,CAAC;AACxB;AAHS;AAaT,SAAS,cAAc,QAAQ,MAAM;AACnC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,MAAM;AACrD,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,cAAc,OAAO,IAAI;AAAA,EAClC,CAAC;AACH;AALS;AAeT,SAAS,gBAAgB,QAAQ,MAAM;AACrC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,OAAO,MAAM;AAC5D,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,gBAAgB,OAAO,IAAI;AAAA,EACpC,CAAC;AACH;AALS;AAcT,SAAS,iBAAiB,SAAS;AACjC,MAAI,SAAS,OAAO,OAAO,EAAE,SAAS;AACtC,MAAI,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtC,SAAO,wBAAwB,EAAE,OAAO,QAAQ,EAAE,MAAM,WAAW;AACrE;AAJS;AAOT,IAAO,sBAAQ","sourcesContent":["import { center } from \"@turf/center\";\nimport jsts from \"@turf/jsts\";\nimport { geomEach, featureEach } from \"@turf/meta\";\nimport { geoAzimuthalEquidistant } from \"d3-geo\";\nimport {\n feature,\n featureCollection,\n radiansToLength,\n lengthToRadians,\n earthRadius,\n} from \"@turf/helpers\";\n\nconst { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;\n\n/**\n * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.\n *\n * When using a negative radius, the resulting geometry may be invalid if\n * it's too small compared to the radius magnitude. If the input is a\n * FeatureCollection, only valid members will be returned in the output\n * FeatureCollection - i.e., the output collection may have fewer members than\n * the input, or even be empty.\n *\n * @name buffer\n * @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer (negative values are allowed)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] any of the options supported by turf units\n * @param {number} [options.steps=8] number of steps\n * @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features\n * @example\n * var point = turf.point([-90.548630, 14.616599]);\n * var buffered = turf.buffer(point, 500, {units: 'miles'});\n *\n * //addToMap\n * var addToMap = [point, buffered]\n */\nfunction buffer(geojson, radius, options) {\n // Optional params\n options = options || {};\n\n // use user supplied options or default values\n var units = options.units || \"kilometers\";\n var steps = options.steps || 8;\n\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (typeof options !== \"object\") throw new Error(\"options must be an object\");\n if (typeof steps !== \"number\") throw new Error(\"steps must be an number\");\n\n // Allow negative buffers (\"erosion\") or zero-sized buffers (\"repair geometry\")\n if (radius === undefined) throw new Error(\"radius is required\");\n if (steps <= 0) throw new Error(\"steps must be greater than 0\");\n\n var results = [];\n switch (geojson.type) {\n case \"GeometryCollection\":\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n case \"FeatureCollection\":\n featureEach(geojson, function (feature) {\n var multiBuffered = bufferFeature(feature, radius, units, steps);\n if (multiBuffered) {\n featureEach(multiBuffered, function (buffered) {\n if (buffered) results.push(buffered);\n });\n }\n });\n return featureCollection(results);\n }\n return bufferFeature(geojson, radius, units, steps);\n}\n\n/**\n * Buffer single Feature/Geometry\n *\n * @private\n * @param {Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer\n * @param {string} [units='kilometers'] any of the options supported by turf units\n * @param {number} [steps=8] number of steps\n * @returns {Feature<Polygon|MultiPolygon>} buffered feature\n */\nfunction bufferFeature(geojson, radius, units, steps) {\n var properties = geojson.properties || {};\n var geometry = geojson.type === \"Feature\" ? geojson.geometry : geojson;\n\n // Geometry Types faster than jsts\n if (geometry.type === \"GeometryCollection\") {\n var results = [];\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n }\n\n // Project GeoJSON to Azimuthal Equidistant projection (convert to Meters)\n var projection = defineProjection(geometry);\n var projected = {\n type: geometry.type,\n coordinates: projectCoords(geometry.coordinates, projection),\n };\n\n // JSTS buffer operation\n var reader = new GeoJSONReader();\n var geom = reader.read(projected);\n var distance = radiansToLength(lengthToRadians(radius, units), \"meters\");\n var buffered = BufferOp.bufferOp(geom, distance, steps);\n var writer = new GeoJSONWriter();\n buffered = writer.write(buffered);\n\n // Detect if empty geometries\n if (coordsIsNaN(buffered.coordinates)) return undefined;\n\n // Unproject coordinates (convert to Degrees)\n var result = {\n type: buffered.type,\n coordinates: unprojectCoords(buffered.coordinates, projection),\n };\n\n return feature(result, properties);\n}\n\n/**\n * Coordinates isNaN\n *\n * @private\n * @param {Array<any>} coords GeoJSON Coordinates\n * @returns {boolean} if NaN exists\n */\nfunction coordsIsNaN(coords) {\n if (Array.isArray(coords[0])) return coordsIsNaN(coords[0]);\n return isNaN(coords[0]);\n}\n\n/**\n * Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} projected coordinates\n */\nfunction projectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj(coords);\n return coords.map(function (coord) {\n return projectCoords(coord, proj);\n });\n}\n\n/**\n * Un-Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to un-project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} un-projected coordinates\n */\nfunction unprojectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj.invert(coords);\n return coords.map(function (coord) {\n return unprojectCoords(coord, proj);\n });\n}\n\n/**\n * Define Azimuthal Equidistant projection\n *\n * @private\n * @param {Geometry|Feature<any>} geojson Base projection on center of GeoJSON\n * @returns {GeoProjection} D3 Geo Azimuthal Equidistant Projection\n */\nfunction defineProjection(geojson) {\n var coords = center(geojson).geometry.coordinates;\n var rotation = [-coords[0], -coords[1]];\n return geoAzimuthalEquidistant().rotate(rotation).scale(earthRadius);\n}\n\nexport { buffer };\nexport default buffer;\n"]}
1
+ {"version":3,"sources":["../../index.js"],"names":["feature","geometry","buffered"],"mappings":";AAAA,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,UAAU,mBAAmB;AACtC,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,EAAE,UAAU,eAAe,cAAc,IAAI;AAyBnD,SAAS,OAAO,SAAS,QAAQ,SAAS;AAExC,YAAU,WAAW,CAAC;AAGtB,MAAI,QAAQ,QAAQ,SAAS;AAC7B,MAAI,QAAQ,QAAQ,SAAS;AAG7B,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,OAAO,YAAY;AAAU,UAAM,IAAI,MAAM,2BAA2B;AAC5E,MAAI,OAAO,UAAU;AAAU,UAAM,IAAI,MAAM,yBAAyB;AAGxE,MAAI,WAAW;AAAW,UAAM,IAAI,MAAM,oBAAoB;AAC9D,MAAI,SAAS;AAAG,UAAM,IAAI,MAAM,8BAA8B;AAE9D,MAAI,UAAU,CAAC;AACf,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,eAAS,SAAS,SAAU,UAAU;AACpC,YAAI,WAAW,cAAc,UAAU,QAAQ,OAAO,KAAK;AAC3D,YAAI;AAAU,kBAAQ,KAAK,QAAQ;AAAA,MACrC,CAAC;AACD,aAAO,kBAAkB,OAAO;AAAA,IAClC,KAAK;AACH,kBAAY,SAAS,SAAUA,UAAS;AACtC,YAAI,gBAAgB,cAAcA,UAAS,QAAQ,OAAO,KAAK;AAC/D,YAAI,eAAe;AACjB,sBAAY,eAAe,SAAU,UAAU;AAC7C,gBAAI;AAAU,sBAAQ,KAAK,QAAQ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AACnC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,MAAM;AACrD,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,cAAc,OAAO,IAAI;AAAA,EAClC,CAAC;AACH;AAUA,SAAS,gBAAgB,QAAQ,MAAM;AACrC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,OAAO,MAAM;AAC5D,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,gBAAgB,OAAO,IAAI;AAAA,EACpC,CAAC;AACH;AASA,SAAS,iBAAiB,SAAS;AACjC,MAAI,SAAS,OAAO,OAAO,EAAE,SAAS;AACtC,MAAI,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtC,SAAO,wBAAwB,EAAE,OAAO,QAAQ,EAAE,MAAM,WAAW;AACrE;AAGA,IAAO,sBAAQ","sourcesContent":["import { center } from \"@turf/center\";\nimport jsts from \"@turf/jsts\";\nimport { geomEach, featureEach } from \"@turf/meta\";\nimport { geoAzimuthalEquidistant } from \"d3-geo\";\nimport {\n feature,\n featureCollection,\n radiansToLength,\n lengthToRadians,\n earthRadius,\n} from \"@turf/helpers\";\n\nconst { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;\n\n/**\n * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.\n *\n * When using a negative radius, the resulting geometry may be invalid if\n * it's too small compared to the radius magnitude. If the input is a\n * FeatureCollection, only valid members will be returned in the output\n * FeatureCollection - i.e., the output collection may have fewer members than\n * the input, or even be empty.\n *\n * @name buffer\n * @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer (negative values are allowed)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] any of the options supported by turf units\n * @param {number} [options.steps=8] number of steps\n * @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features\n * @example\n * var point = turf.point([-90.548630, 14.616599]);\n * var buffered = turf.buffer(point, 500, {units: 'miles'});\n *\n * //addToMap\n * var addToMap = [point, buffered]\n */\nfunction buffer(geojson, radius, options) {\n // Optional params\n options = options || {};\n\n // use user supplied options or default values\n var units = options.units || \"kilometers\";\n var steps = options.steps || 8;\n\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (typeof options !== \"object\") throw new Error(\"options must be an object\");\n if (typeof steps !== \"number\") throw new Error(\"steps must be an number\");\n\n // Allow negative buffers (\"erosion\") or zero-sized buffers (\"repair geometry\")\n if (radius === undefined) throw new Error(\"radius is required\");\n if (steps <= 0) throw new Error(\"steps must be greater than 0\");\n\n var results = [];\n switch (geojson.type) {\n case \"GeometryCollection\":\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n case \"FeatureCollection\":\n featureEach(geojson, function (feature) {\n var multiBuffered = bufferFeature(feature, radius, units, steps);\n if (multiBuffered) {\n featureEach(multiBuffered, function (buffered) {\n if (buffered) results.push(buffered);\n });\n }\n });\n return featureCollection(results);\n }\n return bufferFeature(geojson, radius, units, steps);\n}\n\n/**\n * Buffer single Feature/Geometry\n *\n * @private\n * @param {Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer\n * @param {string} [units='kilometers'] any of the options supported by turf units\n * @param {number} [steps=8] number of steps\n * @returns {Feature<Polygon|MultiPolygon>} buffered feature\n */\nfunction bufferFeature(geojson, radius, units, steps) {\n var properties = geojson.properties || {};\n var geometry = geojson.type === \"Feature\" ? geojson.geometry : geojson;\n\n // Geometry Types faster than jsts\n if (geometry.type === \"GeometryCollection\") {\n var results = [];\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n }\n\n // Project GeoJSON to Azimuthal Equidistant projection (convert to Meters)\n var projection = defineProjection(geometry);\n var projected = {\n type: geometry.type,\n coordinates: projectCoords(geometry.coordinates, projection),\n };\n\n // JSTS buffer operation\n var reader = new GeoJSONReader();\n var geom = reader.read(projected);\n var distance = radiansToLength(lengthToRadians(radius, units), \"meters\");\n var buffered = BufferOp.bufferOp(geom, distance, steps);\n var writer = new GeoJSONWriter();\n buffered = writer.write(buffered);\n\n // Detect if empty geometries\n if (coordsIsNaN(buffered.coordinates)) return undefined;\n\n // Unproject coordinates (convert to Degrees)\n var result = {\n type: buffered.type,\n coordinates: unprojectCoords(buffered.coordinates, projection),\n };\n\n return feature(result, properties);\n}\n\n/**\n * Coordinates isNaN\n *\n * @private\n * @param {Array<any>} coords GeoJSON Coordinates\n * @returns {boolean} if NaN exists\n */\nfunction coordsIsNaN(coords) {\n if (Array.isArray(coords[0])) return coordsIsNaN(coords[0]);\n return isNaN(coords[0]);\n}\n\n/**\n * Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} projected coordinates\n */\nfunction projectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj(coords);\n return coords.map(function (coord) {\n return projectCoords(coord, proj);\n });\n}\n\n/**\n * Un-Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to un-project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} un-projected coordinates\n */\nfunction unprojectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj.invert(coords);\n return coords.map(function (coord) {\n return unprojectCoords(coord, proj);\n });\n}\n\n/**\n * Define Azimuthal Equidistant projection\n *\n * @private\n * @param {Geometry|Feature<any>} geojson Base projection on center of GeoJSON\n * @returns {GeoProjection} D3 Geo Azimuthal Equidistant Projection\n */\nfunction defineProjection(geojson) {\n var coords = center(geojson).geometry.coordinates;\n var rotation = [-coords[0], -coords[1]];\n return geoAzimuthalEquidistant().rotate(rotation).scale(earthRadius);\n}\n\nexport { buffer };\nexport default buffer;\n"]}
package/dist/esm/index.js CHANGED
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // index.js
5
2
  import { center } from "@turf/center";
6
3
  import jsts from "@turf/jsts";
@@ -51,7 +48,6 @@ function buffer(geojson, radius, options) {
51
48
  }
52
49
  return bufferFeature(geojson, radius, units, steps);
53
50
  }
54
- __name(buffer, "buffer");
55
51
  function bufferFeature(geojson, radius, units, steps) {
56
52
  var properties = geojson.properties || {};
57
53
  var geometry = geojson.type === "Feature" ? geojson.geometry : geojson;
@@ -83,13 +79,11 @@ function bufferFeature(geojson, radius, units, steps) {
83
79
  };
84
80
  return feature(result, properties);
85
81
  }
86
- __name(bufferFeature, "bufferFeature");
87
82
  function coordsIsNaN(coords) {
88
83
  if (Array.isArray(coords[0]))
89
84
  return coordsIsNaN(coords[0]);
90
85
  return isNaN(coords[0]);
91
86
  }
92
- __name(coordsIsNaN, "coordsIsNaN");
93
87
  function projectCoords(coords, proj) {
94
88
  if (typeof coords[0] !== "object")
95
89
  return proj(coords);
@@ -97,7 +91,6 @@ function projectCoords(coords, proj) {
97
91
  return projectCoords(coord, proj);
98
92
  });
99
93
  }
100
- __name(projectCoords, "projectCoords");
101
94
  function unprojectCoords(coords, proj) {
102
95
  if (typeof coords[0] !== "object")
103
96
  return proj.invert(coords);
@@ -105,13 +98,11 @@ function unprojectCoords(coords, proj) {
105
98
  return unprojectCoords(coord, proj);
106
99
  });
107
100
  }
108
- __name(unprojectCoords, "unprojectCoords");
109
101
  function defineProjection(geojson) {
110
102
  var coords = center(geojson).geometry.coordinates;
111
103
  var rotation = [-coords[0], -coords[1]];
112
104
  return geoAzimuthalEquidistant().rotate(rotation).scale(earthRadius);
113
105
  }
114
- __name(defineProjection, "defineProjection");
115
106
  var turf_buffer_default = buffer;
116
107
  export {
117
108
  buffer,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.js"],"sourcesContent":["import { center } from \"@turf/center\";\nimport jsts from \"@turf/jsts\";\nimport { geomEach, featureEach } from \"@turf/meta\";\nimport { geoAzimuthalEquidistant } from \"d3-geo\";\nimport {\n feature,\n featureCollection,\n radiansToLength,\n lengthToRadians,\n earthRadius,\n} from \"@turf/helpers\";\n\nconst { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;\n\n/**\n * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.\n *\n * When using a negative radius, the resulting geometry may be invalid if\n * it's too small compared to the radius magnitude. If the input is a\n * FeatureCollection, only valid members will be returned in the output\n * FeatureCollection - i.e., the output collection may have fewer members than\n * the input, or even be empty.\n *\n * @name buffer\n * @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer (negative values are allowed)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] any of the options supported by turf units\n * @param {number} [options.steps=8] number of steps\n * @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features\n * @example\n * var point = turf.point([-90.548630, 14.616599]);\n * var buffered = turf.buffer(point, 500, {units: 'miles'});\n *\n * //addToMap\n * var addToMap = [point, buffered]\n */\nfunction buffer(geojson, radius, options) {\n // Optional params\n options = options || {};\n\n // use user supplied options or default values\n var units = options.units || \"kilometers\";\n var steps = options.steps || 8;\n\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (typeof options !== \"object\") throw new Error(\"options must be an object\");\n if (typeof steps !== \"number\") throw new Error(\"steps must be an number\");\n\n // Allow negative buffers (\"erosion\") or zero-sized buffers (\"repair geometry\")\n if (radius === undefined) throw new Error(\"radius is required\");\n if (steps <= 0) throw new Error(\"steps must be greater than 0\");\n\n var results = [];\n switch (geojson.type) {\n case \"GeometryCollection\":\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n case \"FeatureCollection\":\n featureEach(geojson, function (feature) {\n var multiBuffered = bufferFeature(feature, radius, units, steps);\n if (multiBuffered) {\n featureEach(multiBuffered, function (buffered) {\n if (buffered) results.push(buffered);\n });\n }\n });\n return featureCollection(results);\n }\n return bufferFeature(geojson, radius, units, steps);\n}\n\n/**\n * Buffer single Feature/Geometry\n *\n * @private\n * @param {Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer\n * @param {string} [units='kilometers'] any of the options supported by turf units\n * @param {number} [steps=8] number of steps\n * @returns {Feature<Polygon|MultiPolygon>} buffered feature\n */\nfunction bufferFeature(geojson, radius, units, steps) {\n var properties = geojson.properties || {};\n var geometry = geojson.type === \"Feature\" ? geojson.geometry : geojson;\n\n // Geometry Types faster than jsts\n if (geometry.type === \"GeometryCollection\") {\n var results = [];\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n }\n\n // Project GeoJSON to Azimuthal Equidistant projection (convert to Meters)\n var projection = defineProjection(geometry);\n var projected = {\n type: geometry.type,\n coordinates: projectCoords(geometry.coordinates, projection),\n };\n\n // JSTS buffer operation\n var reader = new GeoJSONReader();\n var geom = reader.read(projected);\n var distance = radiansToLength(lengthToRadians(radius, units), \"meters\");\n var buffered = BufferOp.bufferOp(geom, distance, steps);\n var writer = new GeoJSONWriter();\n buffered = writer.write(buffered);\n\n // Detect if empty geometries\n if (coordsIsNaN(buffered.coordinates)) return undefined;\n\n // Unproject coordinates (convert to Degrees)\n var result = {\n type: buffered.type,\n coordinates: unprojectCoords(buffered.coordinates, projection),\n };\n\n return feature(result, properties);\n}\n\n/**\n * Coordinates isNaN\n *\n * @private\n * @param {Array<any>} coords GeoJSON Coordinates\n * @returns {boolean} if NaN exists\n */\nfunction coordsIsNaN(coords) {\n if (Array.isArray(coords[0])) return coordsIsNaN(coords[0]);\n return isNaN(coords[0]);\n}\n\n/**\n * Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} projected coordinates\n */\nfunction projectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj(coords);\n return coords.map(function (coord) {\n return projectCoords(coord, proj);\n });\n}\n\n/**\n * Un-Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to un-project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} un-projected coordinates\n */\nfunction unprojectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj.invert(coords);\n return coords.map(function (coord) {\n return unprojectCoords(coord, proj);\n });\n}\n\n/**\n * Define Azimuthal Equidistant projection\n *\n * @private\n * @param {Geometry|Feature<any>} geojson Base projection on center of GeoJSON\n * @returns {GeoProjection} D3 Geo Azimuthal Equidistant Projection\n */\nfunction defineProjection(geojson) {\n var coords = center(geojson).geometry.coordinates;\n var rotation = [-coords[0], -coords[1]];\n return geoAzimuthalEquidistant().rotate(rotation).scale(earthRadius);\n}\n\nexport { buffer };\nexport default buffer;\n"],"mappings":";;;;AAAA,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,UAAU,mBAAmB;AACtC,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,EAAE,UAAU,eAAe,cAAc,IAAI;AAyBnD,SAAS,OAAO,SAAS,QAAQ,SAAS;AAExC,YAAU,WAAW,CAAC;AAGtB,MAAI,QAAQ,QAAQ,SAAS;AAC7B,MAAI,QAAQ,QAAQ,SAAS;AAG7B,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,OAAO,YAAY;AAAU,UAAM,IAAI,MAAM,2BAA2B;AAC5E,MAAI,OAAO,UAAU;AAAU,UAAM,IAAI,MAAM,yBAAyB;AAGxE,MAAI,WAAW;AAAW,UAAM,IAAI,MAAM,oBAAoB;AAC9D,MAAI,SAAS;AAAG,UAAM,IAAI,MAAM,8BAA8B;AAE9D,MAAI,UAAU,CAAC;AACf,UAAQ,QAAQ,MAAM;AAAA,IACpB,K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,QAAQ;AAGhC,MAAI,YAAY,SAAS,WAAW;AAAG,WAAO;AAG9C,MAAI,SAAS;AAAA,IACX,MAAM,SAAS;AAAA,IACf,aAAa,gBAAgB,SAAS,aAAa,UAAU;AAAA,EAC/D;AAEA,SAAO,QAAQ,QAAQ,UAAU;AACnC;AAvCS;AAgDT,SAAS,YAAY,QAAQ;AAC3B,MAAI,MAAM,QAAQ,OAAO,CAAC,CAAC;AAAG,WAAO,YAAY,OAAO,CAAC,CAAC;AAC1D,SAAO,MAAM,OAAO,CAAC,CAAC;AACxB;AAHS;AAaT,SAAS,cAAc,QAAQ,MAAM;AACnC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,MAAM;AACrD,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,cAAc,OAAO,IAAI;AAAA,EAClC,CAAC;AACH;AALS;AAeT,SAAS,gBAAgB,QAAQ,MAAM;AACrC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,OAAO,MAAM;AAC5D,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,gBAAgB,OAAO,IAAI;AAAA,EACpC,CAAC;AACH;AALS;AAcT,SAAS,iBAAiB,SAAS;AACjC,MAAI,SAAS,OAAO,OAAO,EAAE,SAAS;AACtC,MAAI,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtC,SAAO,wBAAwB,EAAE,OAAO,QAAQ,EAAE,MAAM,WAAW;AACrE;AAJS;AAOT,IAAO,sBAAQ;","names":["feature","geometry","buffered"]}
1
+ {"version":3,"sources":["../../index.js"],"sourcesContent":["import { center } from \"@turf/center\";\nimport jsts from \"@turf/jsts\";\nimport { geomEach, featureEach } from \"@turf/meta\";\nimport { geoAzimuthalEquidistant } from \"d3-geo\";\nimport {\n feature,\n featureCollection,\n radiansToLength,\n lengthToRadians,\n earthRadius,\n} from \"@turf/helpers\";\n\nconst { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;\n\n/**\n * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.\n *\n * When using a negative radius, the resulting geometry may be invalid if\n * it's too small compared to the radius magnitude. If the input is a\n * FeatureCollection, only valid members will be returned in the output\n * FeatureCollection - i.e., the output collection may have fewer members than\n * the input, or even be empty.\n *\n * @name buffer\n * @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer (negative values are allowed)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] any of the options supported by turf units\n * @param {number} [options.steps=8] number of steps\n * @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features\n * @example\n * var point = turf.point([-90.548630, 14.616599]);\n * var buffered = turf.buffer(point, 500, {units: 'miles'});\n *\n * //addToMap\n * var addToMap = [point, buffered]\n */\nfunction buffer(geojson, radius, options) {\n // Optional params\n options = options || {};\n\n // use user supplied options or default values\n var units = options.units || \"kilometers\";\n var steps = options.steps || 8;\n\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (typeof options !== \"object\") throw new Error(\"options must be an object\");\n if (typeof steps !== \"number\") throw new Error(\"steps must be an number\");\n\n // Allow negative buffers (\"erosion\") or zero-sized buffers (\"repair geometry\")\n if (radius === undefined) throw new Error(\"radius is required\");\n if (steps <= 0) throw new Error(\"steps must be greater than 0\");\n\n var results = [];\n switch (geojson.type) {\n case \"GeometryCollection\":\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n case \"FeatureCollection\":\n featureEach(geojson, function (feature) {\n var multiBuffered = bufferFeature(feature, radius, units, steps);\n if (multiBuffered) {\n featureEach(multiBuffered, function (buffered) {\n if (buffered) results.push(buffered);\n });\n }\n });\n return featureCollection(results);\n }\n return bufferFeature(geojson, radius, units, steps);\n}\n\n/**\n * Buffer single Feature/Geometry\n *\n * @private\n * @param {Feature<any>} geojson input to be buffered\n * @param {number} radius distance to draw the buffer\n * @param {string} [units='kilometers'] any of the options supported by turf units\n * @param {number} [steps=8] number of steps\n * @returns {Feature<Polygon|MultiPolygon>} buffered feature\n */\nfunction bufferFeature(geojson, radius, units, steps) {\n var properties = geojson.properties || {};\n var geometry = geojson.type === \"Feature\" ? geojson.geometry : geojson;\n\n // Geometry Types faster than jsts\n if (geometry.type === \"GeometryCollection\") {\n var results = [];\n geomEach(geojson, function (geometry) {\n var buffered = bufferFeature(geometry, radius, units, steps);\n if (buffered) results.push(buffered);\n });\n return featureCollection(results);\n }\n\n // Project GeoJSON to Azimuthal Equidistant projection (convert to Meters)\n var projection = defineProjection(geometry);\n var projected = {\n type: geometry.type,\n coordinates: projectCoords(geometry.coordinates, projection),\n };\n\n // JSTS buffer operation\n var reader = new GeoJSONReader();\n var geom = reader.read(projected);\n var distance = radiansToLength(lengthToRadians(radius, units), \"meters\");\n var buffered = BufferOp.bufferOp(geom, distance, steps);\n var writer = new GeoJSONWriter();\n buffered = writer.write(buffered);\n\n // Detect if empty geometries\n if (coordsIsNaN(buffered.coordinates)) return undefined;\n\n // Unproject coordinates (convert to Degrees)\n var result = {\n type: buffered.type,\n coordinates: unprojectCoords(buffered.coordinates, projection),\n };\n\n return feature(result, properties);\n}\n\n/**\n * Coordinates isNaN\n *\n * @private\n * @param {Array<any>} coords GeoJSON Coordinates\n * @returns {boolean} if NaN exists\n */\nfunction coordsIsNaN(coords) {\n if (Array.isArray(coords[0])) return coordsIsNaN(coords[0]);\n return isNaN(coords[0]);\n}\n\n/**\n * Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} projected coordinates\n */\nfunction projectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj(coords);\n return coords.map(function (coord) {\n return projectCoords(coord, proj);\n });\n}\n\n/**\n * Un-Project coordinates to projection\n *\n * @private\n * @param {Array<any>} coords to un-project\n * @param {GeoProjection} proj D3 Geo Projection\n * @returns {Array<any>} un-projected coordinates\n */\nfunction unprojectCoords(coords, proj) {\n if (typeof coords[0] !== \"object\") return proj.invert(coords);\n return coords.map(function (coord) {\n return unprojectCoords(coord, proj);\n });\n}\n\n/**\n * Define Azimuthal Equidistant projection\n *\n * @private\n * @param {Geometry|Feature<any>} geojson Base projection on center of GeoJSON\n * @returns {GeoProjection} D3 Geo Azimuthal Equidistant Projection\n */\nfunction defineProjection(geojson) {\n var coords = center(geojson).geometry.coordinates;\n var rotation = [-coords[0], -coords[1]];\n return geoAzimuthalEquidistant().rotate(rotation).scale(earthRadius);\n}\n\nexport { buffer };\nexport default buffer;\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,UAAU,mBAAmB;AACtC,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,EAAE,UAAU,eAAe,cAAc,IAAI;AAyBnD,SAAS,OAAO,SAAS,QAAQ,SAAS;AAExC,YAAU,WAAW,CAAC;AAGtB,MAAI,QAAQ,QAAQ,SAAS;AAC7B,MAAI,QAAQ,QAAQ,SAAS;AAG7B,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,OAAO,YAAY;AAAU,UAAM,IAAI,MAAM,2BAA2B;AAC5E,MAAI,OAAO,UAAU;AAAU,UAAM,IAAI,MAAM,yBAAyB;AAGxE,MAAI,WAAW;AAAW,UAAM,IAAI,MAAM,oBAAoB;AAC9D,MAAI,SAAS;AAAG,UAAM,IAAI,MAAM,8BAA8B;AAE9D,MAAI,UAAU,CAAC;AACf,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,eAAS,SAAS,SAAU,UAAU;AACpC,YAAI,WAAW,cAAc,UAAU,QAAQ,OAAO,KAAK;AAC3D,YAAI;AAAU,kBAAQ,KAAK,QAAQ;AAAA,MACrC,CAAC;AACD,aAAO,kBA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AAQ,QAAQ,UAAU;AACnC;AASA,SAAS,YAAY,QAAQ;AAC3B,MAAI,MAAM,QAAQ,OAAO,CAAC,CAAC;AAAG,WAAO,YAAY,OAAO,CAAC,CAAC;AAC1D,SAAO,MAAM,OAAO,CAAC,CAAC;AACxB;AAUA,SAAS,cAAc,QAAQ,MAAM;AACnC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,MAAM;AACrD,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,cAAc,OAAO,IAAI;AAAA,EAClC,CAAC;AACH;AAUA,SAAS,gBAAgB,QAAQ,MAAM;AACrC,MAAI,OAAO,OAAO,CAAC,MAAM;AAAU,WAAO,KAAK,OAAO,MAAM;AAC5D,SAAO,OAAO,IAAI,SAAU,OAAO;AACjC,WAAO,gBAAgB,OAAO,IAAI;AAAA,EACpC,CAAC;AACH;AASA,SAAS,iBAAiB,SAAS;AACjC,MAAI,SAAS,OAAO,OAAO,EAAE,SAAS;AACtC,MAAI,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtC,SAAO,wBAAwB,EAAE,OAAO,QAAQ,EAAE,MAAM,WAAW;AACrE;AAGA,IAAO,sBAAQ;","names":["feature","geometry","buffered"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/buffer",
3
- "version": "7.0.0",
3
+ "version": "7.1.0-alpha.7+0ce6ecca0",
4
4
  "description": "turf buffer module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -60,7 +60,7 @@
60
60
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
61
61
  },
62
62
  "devDependencies": {
63
- "@turf/truncate": "^7.0.0",
63
+ "@turf/truncate": "^7.1.0-alpha.7+0ce6ecca0",
64
64
  "@types/benchmark": "^2.1.5",
65
65
  "@types/tape": "^4.2.32",
66
66
  "benchmark": "^2.1.4",
@@ -72,13 +72,13 @@
72
72
  "write-json-file": "^5.0.0"
73
73
  },
74
74
  "dependencies": {
75
- "@turf/bbox": "^7.0.0",
76
- "@turf/center": "^7.0.0",
77
- "@turf/helpers": "^7.0.0",
75
+ "@turf/bbox": "^7.1.0-alpha.7+0ce6ecca0",
76
+ "@turf/center": "^7.1.0-alpha.7+0ce6ecca0",
77
+ "@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
78
78
  "@turf/jsts": "^2.7.1",
79
- "@turf/meta": "^7.0.0",
80
- "@turf/projection": "^7.0.0",
79
+ "@turf/meta": "^7.1.0-alpha.7+0ce6ecca0",
80
+ "@turf/projection": "^7.1.0-alpha.7+0ce6ecca0",
81
81
  "d3-geo": "1.7.1"
82
82
  },
83
- "gitHead": "3d3a7917025fbabe191dbddbc89754b86f9c7739"
83
+ "gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
84
84
  }