@trackunit/geo-json-utils 1.11.18 → 1.11.20
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/index.cjs.js +3 -7
- package/index.esm.js +3 -7
- package/package.json +1 -1
- package/src/GeoJsonUtils.d.ts +3 -7
package/index.cjs.js
CHANGED
|
@@ -442,15 +442,11 @@ const isFullyContainedInGeoJsonPolygon = (polygon1, polygon2) => {
|
|
|
442
442
|
return polygon1Parsed.data.coordinates.every(linearRing => polygon2Parsed.data.coordinates.some(lr => linearRing.every(position => isGeoJsonPositionInLinearRing({ position, linearRing: lr }))));
|
|
443
443
|
};
|
|
444
444
|
/**
|
|
445
|
-
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
446
|
-
*
|
|
445
|
+
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
446
|
+
* Returns a MultiPolygon representing the intersection, or null if there is no intersection.
|
|
447
447
|
* @param polygon1 The first polygon/multi-polygon to check intersection
|
|
448
448
|
* @param polygon2 The second polygon/multi-polygon to check intersection
|
|
449
|
-
* @
|
|
450
|
-
* - "outer": Return the containing polygon
|
|
451
|
-
* - "inner": Return the contained polygon
|
|
452
|
-
* - "none": Skip containment checks and return raw intersection
|
|
453
|
-
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon (if one contains the other) or MultiPolygon
|
|
449
|
+
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon or MultiPolygon
|
|
454
450
|
*/
|
|
455
451
|
const getGeoJsonPolygonIntersection = (polygon1, polygon2) => {
|
|
456
452
|
const intersectionResult = polygonClipping.intersection(polygon1.type === "MultiPolygon" ? polygon1.coordinates : [polygon1.coordinates], polygon2.type === "MultiPolygon" ? polygon2.coordinates : [polygon2.coordinates]);
|
package/index.esm.js
CHANGED
|
@@ -440,15 +440,11 @@ const isFullyContainedInGeoJsonPolygon = (polygon1, polygon2) => {
|
|
|
440
440
|
return polygon1Parsed.data.coordinates.every(linearRing => polygon2Parsed.data.coordinates.some(lr => linearRing.every(position => isGeoJsonPositionInLinearRing({ position, linearRing: lr }))));
|
|
441
441
|
};
|
|
442
442
|
/**
|
|
443
|
-
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
444
|
-
*
|
|
443
|
+
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
444
|
+
* Returns a MultiPolygon representing the intersection, or null if there is no intersection.
|
|
445
445
|
* @param polygon1 The first polygon/multi-polygon to check intersection
|
|
446
446
|
* @param polygon2 The second polygon/multi-polygon to check intersection
|
|
447
|
-
* @
|
|
448
|
-
* - "outer": Return the containing polygon
|
|
449
|
-
* - "inner": Return the contained polygon
|
|
450
|
-
* - "none": Skip containment checks and return raw intersection
|
|
451
|
-
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon (if one contains the other) or MultiPolygon
|
|
447
|
+
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon or MultiPolygon
|
|
452
448
|
*/
|
|
453
449
|
const getGeoJsonPolygonIntersection = (polygon1, polygon2) => {
|
|
454
450
|
const intersectionResult = polygonClipping.intersection(polygon1.type === "MultiPolygon" ? polygon1.coordinates : [polygon1.coordinates], polygon2.type === "MultiPolygon" ? polygon2.coordinates : [polygon2.coordinates]);
|
package/package.json
CHANGED
package/src/GeoJsonUtils.d.ts
CHANGED
|
@@ -70,15 +70,11 @@ export declare const isGeoJsonPointInPolygon: ({ point, polygon, }: {
|
|
|
70
70
|
*/
|
|
71
71
|
export declare const isFullyContainedInGeoJsonPolygon: (polygon1: GeoJsonPolygon, polygon2: GeoJsonPolygon) => boolean | null;
|
|
72
72
|
/**
|
|
73
|
-
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
74
|
-
*
|
|
73
|
+
* @description Gets the intersection between two GeoJSON polygons/multi-polygons.
|
|
74
|
+
* Returns a MultiPolygon representing the intersection, or null if there is no intersection.
|
|
75
75
|
* @param polygon1 The first polygon/multi-polygon to check intersection
|
|
76
76
|
* @param polygon2 The second polygon/multi-polygon to check intersection
|
|
77
|
-
* @
|
|
78
|
-
* - "outer": Return the containing polygon
|
|
79
|
-
* - "inner": Return the contained polygon
|
|
80
|
-
* - "none": Skip containment checks and return raw intersection
|
|
81
|
-
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon (if one contains the other) or MultiPolygon
|
|
77
|
+
* @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon or MultiPolygon
|
|
82
78
|
*/
|
|
83
79
|
export declare const getGeoJsonPolygonIntersection: (polygon1: GeoJsonPolygon | GeoJsonMultiPolygon, polygon2: GeoJsonPolygon | GeoJsonMultiPolygon) => GeoJsonMultiPolygon | GeoJsonPolygon | null;
|
|
84
80
|
/**
|