h3 polyfill returns 空列表
h3 polyfill returns empty list
我有两个不同的多边形
poly1 = {'type': 'Polygon',
'coordinates': [[[37.813318999983238, -122.4089866999972145],
[ 37.7866302000007224, -122.3805436999997056 ],
[37.7198061999978478, -122.3544736999993603],
[ 37.7076131999975672, -122.5123436999983966 ],
[37.7835871999971715, -122.5247187000021967],
[37.8151571999998453, -122.4798767000009008]]] }
poly2 = {'type': 'Polygon',
'coordinates': [[[394848.932324579, 5815933.130831123],
[394848.932324579, 5818765.877144514],
[389427.971197729, 5818765.877144514],
[389427.971197729, 5815933.130831123],
[394848.932324579, 5815933.130831123]]] }
当我运行
hexagons = list(h3.polyfill(poly1, 10))
我明白了
['88283095d1fffff', '8828309427fffff', '88283082cbfffff', '8828308251fffff', '88283082abfffff', '88283082ddfffff', '882830820bfffff', '8828309585fffff', '88283082b1fffff', '882830821dfffff', '8828309425fffff', '8828309519fffff', '8828308747fffff', '88283095a1fffff', '8828308211fffff', ...
当我运行
hexagons = list(h3.polyfill(poly2, 10))
我明白了
[]
这是为什么?
显然,h3 仅适用于具有 EPSG 4326
的投影 WGS84
。 poly2
中提供的坐标确实有另一个投影!转换坐标,运行正常
我有两个不同的多边形
poly1 = {'type': 'Polygon',
'coordinates': [[[37.813318999983238, -122.4089866999972145],
[ 37.7866302000007224, -122.3805436999997056 ],
[37.7198061999978478, -122.3544736999993603],
[ 37.7076131999975672, -122.5123436999983966 ],
[37.7835871999971715, -122.5247187000021967],
[37.8151571999998453, -122.4798767000009008]]] }
poly2 = {'type': 'Polygon',
'coordinates': [[[394848.932324579, 5815933.130831123],
[394848.932324579, 5818765.877144514],
[389427.971197729, 5818765.877144514],
[389427.971197729, 5815933.130831123],
[394848.932324579, 5815933.130831123]]] }
当我运行
hexagons = list(h3.polyfill(poly1, 10))
我明白了
['88283095d1fffff', '8828309427fffff', '88283082cbfffff', '8828308251fffff', '88283082abfffff', '88283082ddfffff', '882830820bfffff', '8828309585fffff', '88283082b1fffff', '882830821dfffff', '8828309425fffff', '8828309519fffff', '8828308747fffff', '88283095a1fffff', '8828308211fffff', ...
当我运行
hexagons = list(h3.polyfill(poly2, 10))
我明白了
[]
这是为什么?
显然,h3 仅适用于具有 EPSG 4326
的投影 WGS84
。 poly2
中提供的坐标确实有另一个投影!转换坐标,运行正常