0

我有两个不同的多边形

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))

我明白了

[]

这是为什么?

4

1 回答 1

3

显然,h3 仅适用于WGS84具有EPSG 4326. 提供的坐标poly2确实有另一个投影!转换坐标,它按预期运行。

于 2021-11-01T10:12:59.597 回答