mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
8751c0dee3
- 从 world-geo 生成国家质心表,Server 在仅有 ISO/国家名时补全 geo 坐标 - 全球态势板在缺少经纬度时按 geo_name 解析质心,避免 fallback 到美国
14 lines
286 B
Go
14 lines
286 B
Go
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)
|
|
}
|
|
}
|