本文整理匯總了TypeScript中@turf/polygon-to-line.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isPolyInPoly
/**
* Is Polygon (geom1) in Polygon (geom2)
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
for (var i = 0; i < feature1.coordinates[0].length; i++) {
if (booleanPointInPolygon(feature1.coordinates[0][i], feature2)) {
return true;
}
}
for (var i2 = 0; i2 < feature2.coordinates[0].length; i2++) {
if (booleanPointInPolygon(feature2.coordinates[0][i2], feature1)) {
return true;
}
}
var doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
示例2: isPolyInPoly
/**
* Is Polygon (geom1) in Polygon (geom2)
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1: Polygon, feature2: Polygon) {
for (const coord1 of feature1.coordinates[0]) {
if (booleanPointInPolygon(coord1, feature2)) {
return true;
}
}
for (const coord2 of feature2.coordinates[0]) {
if (booleanPointInPolygon(coord2, feature1)) {
return true;
}
}
const doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
示例3: isLineInPoly
function isLineInPoly(polygon, lineString) {
for (var i = 0; i < lineString.coordinates.length; i++) {
if (booleanPointInPolygon(lineString.coordinates[i], polygon)) {
return true;
}
}
var doLinesIntersect = lineIntersect(lineString, polygonToLine(polygon));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
示例4: isLineInPoly
function isLineInPoly(polygon: Polygon, lineString: LineString) {
for (const coord of lineString.coordinates) {
if (booleanPointInPolygon(coord, polygon)) {
return true;
}
}
const doLinesIntersect = lineIntersect(lineString, polygonToLine(polygon));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}