当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript polygon-to-line.default函数代码示例

本文整理汇总了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;
}
开发者ID:OlympicsORG,项目名称:turf,代码行数:27,代码来源:index.ts

示例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;
}
开发者ID:Turbo87,项目名称:turf,代码行数:27,代码来源:index.ts

示例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;
}
开发者ID:OlympicsORG,项目名称:turf,代码行数:12,代码来源:index.ts

示例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;
}
开发者ID:Turbo87,项目名称:turf,代码行数:12,代码来源:index.ts


注:本文中的@turf/polygon-to-line.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。