@turf/circle 7.1.0 → 7.2.0
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.
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +11 -11
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-circle/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,gDAA4B;AAC5B,wCAA+B;AAsB/B,SAAS,MAAA,CACP,MAAA,EACA,MAAA,EACA,QAAA,EAII,CAAC,CAAA,EACgB;AAErB,EAAA,MAAM,MAAA,EAAQ,OAAA,CAAQ,MAAA,GAAS,EAAA;AAC/B,EAAA,MAAM,WAAA,EAAkB,OAAA,CAAQ,WAAA,EAC5B,OAAA,CAAQ,WAAA,EACR,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,EAAA,GAAK,MAAA,CAAO,KAAA,IAAS,UAAA,GAAa,MAAA,CAAO,WAAA,EAC5D,MAAA,CAAO,WAAA,EACP,CAAC,CAAA;AAGP,EAAA,MAAM,YAAA,EAAc,CAAC,CAAA;AACrB,EAAA,IAAA,CAAA,IAAS,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,KAAA,EAAO,CAAA,EAAA,EAAK;AAC9B,IAAA,WAAA,CAAY,IAAA;AAAA,MACV,sCAAA,MAAY,EAAQ,MAAA,EAAS,EAAA,EAAI,CAAA,IAAA,EAAQ,KAAA,EAAO,OAAO,CAAA,CAAE,QAAA,CACtD;AAAA,IACL,CAAA;AAAA,EACF;AACA,EAAA,WAAA,CAAY,IAAA,CAAK,WAAA,CAAY,CAAC,CAAC,CAAA;AAE/B,EAAA,OAAO,8BAAA,CAAS,WAAW,CAAA,EAAG,UAAU,CAAA;AAC1C;AAGA,IAAO,oBAAA,EAAQ,MAAA;ADvCf;AACE;AACA;AACF,+DAAC","file":"/home/runner/work/turf/turf/packages/turf-circle/dist/cjs/index.cjs","sourcesContent":[null,"import { GeoJsonProperties, Feature, Point, Polygon } from \"geojson\";\nimport { destination } from \"@turf/destination\";\nimport { polygon, Units } from \"@turf/helpers\";\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @function\n * @param {Feature<Point>|number[]} center center point\n * @param {number} radius radius of the circle\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] properties\n * @returns {Feature<Polygon>} circle polygon\n * @example\n * var center = [-75.343, 39.984];\n * var radius = 5;\n * var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};\n * var circle = turf.circle(center, radius, options);\n *\n * //addToMap\n * var addToMap = [turf.point(center), circle]\n */\nfunction circle<P extends GeoJsonProperties = GeoJsonProperties>(\n center: number[] | Point | Feature<Point, P>,\n radius: number,\n options: {\n steps?: number;\n units?: Units;\n properties?: P;\n } = {}\n): Feature<Polygon, P> {\n // default params\n const steps = options.steps || 64;\n const properties: any = options.properties\n ? options.properties\n : !Array.isArray(center) && center.type === \"Feature\" && center.properties\n ? center.properties\n : {};\n\n // main\n const coordinates = [];\n for (let i = 0; i < steps; i++) {\n coordinates.push(\n destination(center, radius, (i * -360) / steps, options).geometry\n .coordinates\n );\n }\n coordinates.push(coordinates[0]);\n\n return polygon([coordinates], properties);\n}\n\nexport { circle };\nexport default circle;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { Units } from '@turf/helpers';
|
|
|
4
4
|
/**
|
|
5
5
|
* Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {Feature<Point>|number[]} center center point
|
|
9
9
|
* @param {number} radius radius of the circle
|
|
10
10
|
* @param {Object} [options={}] Optional parameters
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Units } from '@turf/helpers';
|
|
|
4
4
|
/**
|
|
5
5
|
* Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {Feature<Point>|number[]} center center point
|
|
9
9
|
* @param {number} radius radius of the circle
|
|
10
10
|
* @param {Object} [options={}] Optional parameters
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { GeoJsonProperties, Feature, Point, Polygon } from \"geojson\";\nimport { destination } from \"@turf/destination\";\nimport { polygon, Units } from \"@turf/helpers\";\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { GeoJsonProperties, Feature, Point, Polygon } from \"geojson\";\nimport { destination } from \"@turf/destination\";\nimport { polygon, Units } from \"@turf/helpers\";\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @function\n * @param {Feature<Point>|number[]} center center point\n * @param {number} radius radius of the circle\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] properties\n * @returns {Feature<Polygon>} circle polygon\n * @example\n * var center = [-75.343, 39.984];\n * var radius = 5;\n * var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};\n * var circle = turf.circle(center, radius, options);\n *\n * //addToMap\n * var addToMap = [turf.point(center), circle]\n */\nfunction circle<P extends GeoJsonProperties = GeoJsonProperties>(\n center: number[] | Point | Feature<Point, P>,\n radius: number,\n options: {\n steps?: number;\n units?: Units;\n properties?: P;\n } = {}\n): Feature<Polygon, P> {\n // default params\n const steps = options.steps || 64;\n const properties: any = options.properties\n ? options.properties\n : !Array.isArray(center) && center.type === \"Feature\" && center.properties\n ? center.properties\n : {};\n\n // main\n const coordinates = [];\n for (let i = 0; i < steps; i++) {\n coordinates.push(\n destination(center, radius, (i * -360) / steps, options).geometry\n .coordinates\n );\n }\n coordinates.push(coordinates[0]);\n\n return polygon([coordinates], properties);\n}\n\nexport { circle };\nexport default circle;\n"],"mappings":";AACA,SAAS,mBAAmB;AAC5B,SAAS,eAAsB;AAsB/B,SAAS,OACP,QACA,QACA,UAII,CAAC,GACgB;AAErB,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,aAAkB,QAAQ,aAC5B,QAAQ,aACR,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS,aAAa,OAAO,aAC5D,OAAO,aACP,CAAC;AAGP,QAAM,cAAc,CAAC;AACrB,WAAS,IAAI,GAAG,IAAI,OAAO,KAAK;AAC9B,gBAAY;AAAA,MACV,YAAY,QAAQ,QAAS,IAAI,OAAQ,OAAO,OAAO,EAAE,SACtD;AAAA,IACL;AAAA,EACF;AACA,cAAY,KAAK,YAAY,CAAC,CAAC;AAE/B,SAAO,QAAQ,CAAC,WAAW,GAAG,UAAU;AAC1C;AAGA,IAAO,sBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/circle",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf circle module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@placemarkio/check-geojson": "^0.1.12",
|
|
58
|
-
"@turf/truncate": "^7.
|
|
58
|
+
"@turf/truncate": "^7.2.0",
|
|
59
59
|
"@types/benchmark": "^2.1.5",
|
|
60
|
-
"@types/tape": "^4.
|
|
60
|
+
"@types/tape": "^4.13.4",
|
|
61
61
|
"benchmark": "^2.1.4",
|
|
62
62
|
"load-json-file": "^7.0.1",
|
|
63
63
|
"npm-run-all": "^4.1.5",
|
|
64
|
-
"tape": "^5.
|
|
65
|
-
"tsup": "^8.
|
|
66
|
-
"tsx": "^4.
|
|
67
|
-
"typescript": "^5.
|
|
64
|
+
"tape": "^5.9.0",
|
|
65
|
+
"tsup": "^8.3.5",
|
|
66
|
+
"tsx": "^4.19.2",
|
|
67
|
+
"typescript": "^5.5.4",
|
|
68
68
|
"write-json-file": "^5.0.0"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@turf/destination": "^7.
|
|
72
|
-
"@turf/helpers": "^7.
|
|
71
|
+
"@turf/destination": "^7.2.0",
|
|
72
|
+
"@turf/helpers": "^7.2.0",
|
|
73
73
|
"@types/geojson": "^7946.0.10",
|
|
74
|
-
"tslib": "^2.
|
|
74
|
+
"tslib": "^2.8.1"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
77
77
|
}
|