mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-13 18:36:37 +08:00
fix(openflare): mmdb 国家名节点在世界地图使用正确质心
- 从 world-geo 生成国家质心表,Server 在仅有 ISO/国家名时补全 geo 坐标 - 全球态势板在缺少经纬度时按 geo_name 解析质心,避免 fallback 到美国
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package geoip
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestCountryCentroidGermany(t *testing.T) {
|
||||
lat, lon, ok := CountryCentroidByISO("DE")
|
||||
if !ok {
|
||||
t.Fatal("expected DE centroid")
|
||||
}
|
||||
if lat < 47 || lat > 55 || lon < 5 || lon > 15 {
|
||||
t.Fatalf("unexpected Germany centroid: %f,%f", lat, lon)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user