在我的多边形地图的difference()实现后,我发现,当我放大地图时,一些不应该出现的意外形状出现或消失。有MultyPolygon和Polygon类型的多边形,我对它们进行了比较,甚至检查了多边形坐标的长度,但这没有帮助。
let previousFeature = {}
let x
for(x = 0;x < second_features.length; x++){
if (x === 0) {
previousFeature = second_features[x]
} else {
if (previousFeature.geometry.coordinates.length ===
second_features[x].geometry.coordinates.length)
{
second_features[x - 1] = difference(previousFeature.geometry, second_features[x].geometry)
}
second_features[x - 1].properties.time_distance = previousFeature.properties.time_distance
second_features[x - 1].properties.gid = previousFeature.properties.gid
previousFeature = second_features[x]
}在执行放大和缩小操作时,会出现意外的形状,该形状会穿过多边形。
发布于 2020-01-20 22:55:05
我确实找到了geographic location on OSM,但我猜不出你在这张地图上叠加了哪种类型的白线和蓝色多边形。如果你谈到“意想不到的形状”,我想你指的是穿过白线的深蓝色三角形?
一些(一般)猜测为什么多边形看起来可能与预期的不同:
x-th支持点来自动简化多边形,其中x越大,缩放因子越高:换句话说:对于最大缩放,不会移除点,当您稍微缩小一点时,会移除多边形中越来越多的点。可能的情况是,您只能在最大缩放级别下看到多边形的真实形状。

进一步阅读
https://stackoverflow.com/questions/59715360
复制相似问题