我有一个geoJson结构,看起来像这样:

其中,位置0的数组是外部多边形,位置1的数组是内部多边形。为了设置多边形的样式,我添加了这些层:
{'id': dist.identifier,
'type': 'fill',
'source': dist.identifier,
'layout': {},
'paint': {
'fill-opacity': 0.3,
'fill-color': "#ffff00",
}
}
//and
{
'id': `${dist.identifier}-line-layer`,
'type': 'line',
'source': dist.identifier,
'layout': {},
'paint': {
'line-width': 3,
'line-color': '#ffff00'
}
}输出如下所示:

当我放大的时候:

我期望看到类似这样的东西:https://de.wikipedia.org/wiki/GeoJSON#/media/Datei:SFA_Polygon_with_hole.svg
但是内部多边形没有显示出来。我做错了什么吗,因为这应该是有效的geoJson结构(https://de.wikipedia.org/wiki/GeoJSON)。我查看了图层定义,但没有找到任何关于内部多边形的内容。
我会评估所有的输入,并提前感谢您!
编辑:
感谢@Steve Bennet,他给我指出了这个线条工具:https://geojsonlint.com/
我发现我
答:内部多边形应该遵循右手规则:https://mapster.me/right-hand-rule-geojson-fixer/
B:必须至少有4个起点和终点相同的点
C:内部多边形未正确嵌套在坐标数组中
发布于 2021-05-04 22:36:03
感谢@Steve Bennet (参见评论),他给我指出了这个lint工具:https://geojsonlint.com/
我发现我
答:内部多边形应该遵循右手规则:https://mapster.me/right-hand-rule-geojson-fixer/
B:必须至少有4个起点和终点相同的点
C:内部多边形未正确嵌套在坐标数组中
https://stackoverflow.com/questions/67370704
复制相似问题