@@ -0,0 +1,571 @@
/**
* 中国行政区划经纬度数据库
*
* 数据来源:国家统计局行政区划代码 + 高德/百度地图 API
* 坐标参考:区县政府驻地坐标(GCJ-02 坐标系,近似为 WGS-84)
*
* 覆盖范围:
* - 4 个直辖市:所有区县
* - 所有省会城市:所有区县
* - 主要城市:主要区县
*
* @example
* ```typescript
* const result = lookupCityCoordinates('北京市海淀区')
* // => { longitude: 116.298, latitude: 39.959, displayName: '北京市海淀区' }
* ```
*/
export interface DistrictEntry {
/** 省级行政区 */
province : string
/** 城市 */
city : string
/** 区县 */
district : string
/** 经度 */
longitude : number
/** 纬度 */
latitude : number
}
/** 区县级行政区划坐标数据库 */
const DISTRICT_DATABASE : DistrictEntry [ ] = [
// ========== 北京市 ==========
{ province : '北京市' , city : '北京市' , district : '东城区' , longitude : 116.416 , latitude : 39.928 } ,
{ province : '北京市' , city : '北京市' , district : '西城区' , longitude : 116.366 , latitude : 39.912 } ,
{ province : '北京市' , city : '北京市' , district : '朝阳区' , longitude : 116.443 , latitude : 39.921 } ,
{ province : '北京市' , city : '北京市' , district : '海淀区' , longitude : 116.298 , latitude : 39.959 } ,
{ province : '北京市' , city : '北京市' , district : '丰台区' , longitude : 116.287 , latitude : 39.858 } ,
{ province : '北京市' , city : '北京市' , district : '石景山区' , longitude : 116.223 , latitude : 39.906 } ,
{ province : '北京市' , city : '北京市' , district : '通州区' , longitude : 116.657 , latitude : 39.902 } ,
{ province : '北京市' , city : '北京市' , district : '大兴区' , longitude : 116.339 , latitude : 39.727 } ,
{ province : '北京市' , city : '北京市' , district : '顺义区' , longitude : 116.654 , latitude : 40.130 } ,
{ province : '北京市' , city : '北京市' , district : '昌平区' , longitude : 116.231 , latitude : 40.221 } ,
{ province : '北京市' , city : '北京市' , district : '房山区' , longitude : 116.143 , latitude : 39.736 } ,
{ province : '北京市' , city : '北京市' , district : '门头沟区' , longitude : 116.102 , latitude : 39.940 } ,
{ province : '北京市' , city : '北京市' , district : '平谷区' , longitude : 117.121 , latitude : 40.141 } ,
{ province : '北京市' , city : '北京市' , district : '怀柔区' , longitude : 116.632 , latitude : 40.317 } ,
{ province : '北京市' , city : '北京市' , district : '密云区' , longitude : 116.843 , latitude : 40.377 } ,
{ province : '北京市' , city : '北京市' , district : '延庆区' , longitude : 115.975 , latitude : 40.457 } ,
// ========== 上海市 ==========
{ province : '上海市' , city : '上海市' , district : '黄浦区' , longitude : 121.485 , latitude : 31.231 } ,
{ province : '上海市' , city : '上海市' , district : '徐汇区' , longitude : 121.436 , latitude : 31.188 } ,
{ province : '上海市' , city : '上海市' , district : '长宁区' , longitude : 121.410 , latitude : 31.220 } ,
{ province : '上海市' , city : '上海市' , district : '静安区' , longitude : 121.447 , latitude : 31.228 } ,
{ province : '上海市' , city : '上海市' , district : '普陀区' , longitude : 121.396 , latitude : 31.250 } ,
{ province : '上海市' , city : '上海市' , district : '虹口区' , longitude : 121.488 , latitude : 31.264 } ,
{ province : '上海市' , city : '上海市' , district : '杨浦区' , longitude : 121.526 , latitude : 31.259 } ,
{ province : '上海市' , city : '上海市' , district : '闵行区' , longitude : 121.382 , latitude : 31.113 } ,
{ province : '上海市' , city : '上海市' , district : '宝山区' , longitude : 121.489 , latitude : 31.405 } ,
{ province : '上海市' , city : '上海市' , district : '嘉定区' , longitude : 121.265 , latitude : 31.375 } ,
{ province : '上海市' , city : '上海市' , district : '浦东新区' , longitude : 121.544 , latitude : 31.221 } ,
{ province : '上海市' , city : '上海市' , district : '金山区' , longitude : 121.342 , latitude : 30.742 } ,
{ province : '上海市' , city : '上海市' , district : '松江区' , longitude : 121.228 , latitude : 31.032 } ,
{ province : '上海市' , city : '上海市' , district : '青浦区' , longitude : 121.124 , latitude : 31.150 } ,
{ province : '上海市' , city : '上海市' , district : '奉贤区' , longitude : 121.474 , latitude : 30.918 } ,
{ province : '上海市' , city : '上海市' , district : '崇明区' , longitude : 121.397 , latitude : 31.623 } ,
// ========== 天津市 ==========
{ province : '天津市' , city : '天津市' , district : '和平区' , longitude : 117.215 , latitude : 39.117 } ,
{ province : '天津市' , city : '天津市' , district : '河东区' , longitude : 117.252 , latitude : 39.128 } ,
{ province : '天津市' , city : '天津市' , district : '河西区' , longitude : 117.223 , latitude : 39.110 } ,
{ province : '天津市' , city : '天津市' , district : '南开区' , longitude : 117.151 , latitude : 39.122 } ,
{ province : '天津市' , city : '天津市' , district : '河北区' , longitude : 117.197 , latitude : 39.148 } ,
{ province : '天津市' , city : '天津市' , district : '红桥区' , longitude : 117.152 , latitude : 39.167 } ,
{ province : '天津市' , city : '天津市' , district : '东丽区' , longitude : 117.314 , latitude : 39.087 } ,
{ province : '天津市' , city : '天津市' , district : '西青区' , longitude : 117.009 , latitude : 39.141 } ,
{ province : '天津市' , city : '天津市' , district : '津南区' , longitude : 117.357 , latitude : 38.938 } ,
{ province : '天津市' , city : '天津市' , district : '北辰区' , longitude : 117.135 , latitude : 39.225 } ,
{ province : '天津市' , city : '天津市' , district : '武清区' , longitude : 117.044 , latitude : 39.384 } ,
{ province : '天津市' , city : '天津市' , district : '宝坻区' , longitude : 117.310 , latitude : 39.717 } ,
{ province : '天津市' , city : '天津市' , district : '滨海新区' , longitude : 117.694 , latitude : 39.013 } ,
{ province : '天津市' , city : '天津市' , district : '宁河区' , longitude : 117.826 , latitude : 39.330 } ,
{ province : '天津市' , city : '天津市' , district : '静海区' , longitude : 116.974 , latitude : 38.947 } ,
{ province : '天津市' , city : '天津市' , district : '蓟州区' , longitude : 117.408 , latitude : 40.046 } ,
// ========== 重庆市 ==========
{ province : '重庆市' , city : '重庆市' , district : '渝中区' , longitude : 106.569 , latitude : 29.553 } ,
{ province : '重庆市' , city : '重庆市' , district : '江北区' , longitude : 106.574 , latitude : 29.606 } ,
{ province : '重庆市' , city : '重庆市' , district : '南岸区' , longitude : 106.644 , latitude : 29.500 } ,
{ province : '重庆市' , city : '重庆市' , district : '沙坪坝区' , longitude : 106.458 , latitude : 29.541 } ,
{ province : '重庆市' , city : '重庆市' , district : '九龙坡区' , longitude : 106.511 , latitude : 29.502 } ,
{ province : '重庆市' , city : '重庆市' , district : '大渡口区' , longitude : 106.482 , latitude : 29.485 } ,
{ province : '重庆市' , city : '重庆市' , district : '渝北区' , longitude : 106.631 , latitude : 29.718 } ,
{ province : '重庆市' , city : '重庆市' , district : '巴南区' , longitude : 106.540 , latitude : 29.402 } ,
{ province : '重庆市' , city : '重庆市' , district : '北碚区' , longitude : 106.396 , latitude : 29.805 } ,
{ province : '重庆市' , city : '重庆市' , district : '万州区' , longitude : 108.409 , latitude : 30.808 } ,
{ province : '重庆市' , city : '重庆市' , district : '涪陵区' , longitude : 107.390 , latitude : 29.703 } ,
{ province : '重庆市' , city : '重庆市' , district : '黔江区' , longitude : 108.771 , latitude : 29.534 } ,
{ province : '重庆市' , city : '重庆市' , district : '长寿区' , longitude : 107.081 , latitude : 29.858 } ,
{ province : '重庆市' , city : '重庆市' , district : '江津区' , longitude : 106.259 , latitude : 29.290 } ,
{ province : '重庆市' , city : '重庆市' , district : '合川区' , longitude : 106.276 , latitude : 29.973 } ,
{ province : '重庆市' , city : '重庆市' , district : '永川区' , longitude : 105.927 , latitude : 29.356 } ,
{ province : '重庆市' , city : '重庆市' , district : '南川区' , longitude : 107.099 , latitude : 29.158 } ,
{ province : '重庆市' , city : '重庆市' , district : '璧山区' , longitude : 106.231 , latitude : 29.592 } ,
{ province : '重庆市' , city : '重庆市' , district : '铜梁区' , longitude : 106.057 , latitude : 29.845 } ,
{ province : '重庆市' , city : '重庆市' , district : '潼南区' , longitude : 105.840 , latitude : 30.191 } ,
{ province : '重庆市' , city : '重庆市' , district : '荣昌区' , longitude : 105.594 , latitude : 29.405 } ,
{ province : '重庆市' , city : '重庆市' , district : '开州区' , longitude : 108.393 , latitude : 31.161 } ,
{ province : '重庆市' , city : '重庆市' , district : '梁平区' , longitude : 107.802 , latitude : 30.674 } ,
{ province : '重庆市' , city : '重庆市' , district : '武隆区' , longitude : 107.760 , latitude : 29.326 } ,
// ========== 广东省 ==========
// 广州市
{ province : '广东省' , city : '广州市' , district : '越秀区' , longitude : 113.267 , latitude : 23.128 } ,
{ province : '广东省' , city : '广州市' , district : '荔湾区' , longitude : 113.244 , latitude : 23.126 } ,
{ province : '广东省' , city : '广州市' , district : '海珠区' , longitude : 113.258 , latitude : 23.084 } ,
{ province : '广东省' , city : '广州市' , district : '天河区' , longitude : 113.362 , latitude : 23.125 } ,
{ province : '广东省' , city : '广州市' , district : '白云区' , longitude : 113.273 , latitude : 23.157 } ,
{ province : '广东省' , city : '广州市' , district : '黄埔区' , longitude : 113.480 , latitude : 23.181 } ,
{ province : '广东省' , city : '广州市' , district : '番禺区' , longitude : 113.384 , latitude : 22.938 } ,
{ province : '广东省' , city : '广州市' , district : '花都区' , longitude : 113.220 , latitude : 23.404 } ,
{ province : '广东省' , city : '广州市' , district : '南沙区' , longitude : 113.525 , latitude : 22.801 } ,
{ province : '广东省' , city : '广州市' , district : '从化区' , longitude : 113.587 , latitude : 23.548 } ,
{ province : '广东省' , city : '广州市' , district : '增城区' , longitude : 113.811 , latitude : 23.261 } ,
// 深圳市
{ province : '广东省' , city : '深圳市' , district : '福田区' , longitude : 114.055 , latitude : 22.521 } ,
{ province : '广东省' , city : '深圳市' , district : '罗湖区' , longitude : 114.131 , latitude : 22.548 } ,
{ province : '广东省' , city : '深圳市' , district : '南山区' , longitude : 113.930 , latitude : 22.533 } ,
{ province : '广东省' , city : '深圳市' , district : '盐田区' , longitude : 114.237 , latitude : 22.557 } ,
{ province : '广东省' , city : '深圳市' , district : '宝安区' , longitude : 113.883 , latitude : 22.555 } ,
{ province : '广东省' , city : '深圳市' , district : '龙岗区' , longitude : 114.248 , latitude : 22.721 } ,
{ province : '广东省' , city : '深圳市' , district : '龙华区' , longitude : 114.035 , latitude : 22.720 } ,
{ province : '广东省' , city : '深圳市' , district : '坪山区' , longitude : 114.346 , latitude : 22.709 } ,
{ province : '广东省' , city : '深圳市' , district : '光明区' , longitude : 113.936 , latitude : 22.748 } ,
// 珠海市
{ province : '广东省' , city : '珠海市' , district : '香洲区' , longitude : 113.544 , latitude : 22.266 } ,
{ province : '广东省' , city : '珠海市' , district : '斗门区' , longitude : 113.296 , latitude : 22.209 } ,
{ province : '广东省' , city : '珠海市' , district : '金湾区' , longitude : 113.363 , latitude : 22.147 } ,
// 佛山市
{ province : '广东省' , city : '佛山市' , district : '禅城区' , longitude : 113.122 , latitude : 23.009 } ,
{ province : '广东省' , city : '佛山市' , district : '南海区' , longitude : 113.143 , latitude : 23.029 } ,
{ province : '广东省' , city : '佛山市' , district : '顺德区' , longitude : 113.293 , latitude : 22.805 } ,
{ province : '广东省' , city : '佛山市' , district : '三水区' , longitude : 112.897 , latitude : 23.156 } ,
{ province : '广东省' , city : '佛山市' , district : '高明区' , longitude : 112.893 , latitude : 22.900 } ,
// 东莞市
{ province : '广东省' , city : '东莞市' , district : '莞城区' , longitude : 113.751 , latitude : 23.053 } ,
// 中山市
{ province : '广东省' , city : '中山市' , district : '中山市' , longitude : 113.383 , latitude : 22.521 } ,
// 惠州市
{ province : '广东省' , city : '惠州市' , district : '惠城区' , longitude : 114.383 , latitude : 23.084 } ,
{ province : '广东省' , city : '惠州市' , district : '惠阳区' , longitude : 114.456 , latitude : 22.789 } ,
// 汕头市
{ province : '广东省' , city : '汕头市' , district : '金平区' , longitude : 116.703 , latitude : 23.366 } ,
{ province : '广东省' , city : '汕头市' , district : '龙湖区' , longitude : 116.716 , latitude : 23.372 } ,
// ========== 浙江省 ==========
// 杭州市
{ province : '浙江省' , city : '杭州市' , district : '上城区' , longitude : 120.170 , latitude : 30.243 } ,
{ province : '浙江省' , city : '杭州市' , district : '拱墅区' , longitude : 120.142 , latitude : 30.319 } ,
{ province : '浙江省' , city : '杭州市' , district : '西湖区' , longitude : 120.130 , latitude : 30.259 } ,
{ province : '浙江省' , city : '杭州市' , district : '滨江区' , longitude : 120.212 , latitude : 30.208 } ,
{ province : '浙江省' , city : '杭州市' , district : '萧山区' , longitude : 120.264 , latitude : 30.185 } ,
{ province : '浙江省' , city : '杭州市' , district : '余杭区' , longitude : 120.299 , latitude : 30.419 } ,
{ province : '浙江省' , city : '杭州市' , district : '临平区' , longitude : 120.299 , latitude : 30.419 } ,
{ province : '浙江省' , city : '杭州市' , district : '钱塘区' , longitude : 120.494 , latitude : 30.323 } ,
{ province : '浙江省' , city : '杭州市' , district : '富阳区' , longitude : 119.960 , latitude : 30.049 } ,
{ province : '浙江省' , city : '杭州市' , district : '临安区' , longitude : 119.725 , latitude : 30.234 } ,
// 宁波市
{ province : '浙江省' , city : '宁波市' , district : '海曙区' , longitude : 121.551 , latitude : 29.860 } ,
{ province : '浙江省' , city : '宁波市' , district : '江北区' , longitude : 121.555 , latitude : 29.887 } ,
{ province : '浙江省' , city : '宁波市' , district : '鄞州区' , longitude : 121.547 , latitude : 29.817 } ,
{ province : '浙江省' , city : '宁波市' , district : '镇海区' , longitude : 121.597 , latitude : 29.949 } ,
{ province : '浙江省' , city : '宁波市' , district : '北仑区' , longitude : 121.844 , latitude : 29.899 } ,
// 温州市
{ province : '浙江省' , city : '温州市' , district : '鹿城区' , longitude : 120.655 , latitude : 28.015 } ,
{ province : '浙江省' , city : '温州市' , district : '龙湾区' , longitude : 120.811 , latitude : 27.933 } ,
{ province : '浙江省' , city : '温州市' , district : '瓯海区' , longitude : 120.615 , latitude : 27.967 } ,
// 绍兴市
{ province : '浙江省' , city : '绍兴市' , district : '越城区' , longitude : 120.582 , latitude : 29.989 } ,
{ province : '浙江省' , city : '绍兴市' , district : '柯桥区' , longitude : 120.495 , latitude : 30.082 } ,
// 嘉兴市
{ province : '浙江省' , city : '嘉兴市' , district : '南湖区' , longitude : 120.783 , latitude : 30.749 } ,
{ province : '浙江省' , city : '嘉兴市' , district : '秀洲区' , longitude : 120.709 , latitude : 30.765 } ,
// ========== 江苏省 ==========
// 南京市
{ province : '江苏省' , city : '南京市' , district : '玄武区' , longitude : 118.798 , latitude : 32.049 } ,
{ province : '江苏省' , city : '南京市' , district : '秦淮区' , longitude : 118.795 , latitude : 32.039 } ,
{ province : '江苏省' , city : '南京市' , district : '建邺区' , longitude : 118.732 , latitude : 32.003 } ,
{ province : '江苏省' , city : '南京市' , district : '鼓楼区' , longitude : 118.770 , latitude : 32.066 } ,
{ province : '江苏省' , city : '南京市' , district : '浦口区' , longitude : 118.628 , latitude : 32.059 } ,
{ province : '江苏省' , city : '南京市' , district : '栖霞区' , longitude : 118.909 , latitude : 32.096 } ,
{ province : '江苏省' , city : '南京市' , district : '雨花台区' , longitude : 118.779 , latitude : 31.991 } ,
{ province : '江苏省' , city : '南京市' , district : '江宁区' , longitude : 118.840 , latitude : 31.953 } ,
{ province : '江苏省' , city : '南京市' , district : '六合区' , longitude : 118.822 , latitude : 32.323 } ,
{ province : '江苏省' , city : '南京市' , district : '溧水区' , longitude : 119.028 , latitude : 31.651 } ,
{ province : '江苏省' , city : '南京市' , district : '高淳区' , longitude : 118.892 , latitude : 31.328 } ,
// 苏州市
{ province : '江苏省' , city : '苏州市' , district : '姑苏区' , longitude : 120.617 , latitude : 31.336 } ,
{ province : '江苏省' , city : '苏州市' , district : '虎丘区' , longitude : 120.572 , latitude : 31.295 } ,
{ province : '江苏省' , city : '苏州市' , district : '吴中区' , longitude : 120.632 , latitude : 31.263 } ,
{ province : '江苏省' , city : '苏州市' , district : '相城区' , longitude : 120.642 , latitude : 31.369 } ,
{ province : '江苏省' , city : '苏州市' , district : '吴江区' , longitude : 120.645 , latitude : 31.138 } ,
{ province : '江苏省' , city : '苏州市' , district : '常熟市' , longitude : 120.752 , latitude : 31.654 } ,
{ province : '江苏省' , city : '苏州市' , district : '张家港市' , longitude : 120.556 , latitude : 31.875 } ,
{ province : '江苏省' , city : '苏州市' , district : '昆山市' , longitude : 120.981 , latitude : 31.385 } ,
{ province : '江苏省' , city : '苏州市' , district : '太仓市' , longitude : 121.130 , latitude : 31.458 } ,
// 无锡市
{ province : '江苏省' , city : '无锡市' , district : '梁溪区' , longitude : 120.303 , latitude : 31.566 } ,
{ province : '江苏省' , city : '无锡市' , district : '锡山区' , longitude : 120.358 , latitude : 31.590 } ,
{ province : '江苏省' , city : '无锡市' , district : '惠山区' , longitude : 120.298 , latitude : 31.681 } ,
{ province : '江苏省' , city : '无锡市' , district : '滨湖区' , longitude : 120.283 , latitude : 31.527 } ,
{ province : '江苏省' , city : '无锡市' , district : '新吴区' , longitude : 120.364 , latitude : 31.491 } ,
// 常州市
{ province : '江苏省' , city : '常州市' , district : '天宁区' , longitude : 119.975 , latitude : 31.780 } ,
{ province : '江苏省' , city : '常州市' , district : '钟楼区' , longitude : 119.902 , latitude : 31.802 } ,
{ province : '江苏省' , city : '常州市' , district : '新北区' , longitude : 119.972 , latitude : 31.831 } ,
{ province : '江苏省' , city : '常州市' , district : '武进区' , longitude : 119.943 , latitude : 31.701 } ,
// 南通市
{ province : '江苏省' , city : '南通市' , district : '崇川区' , longitude : 120.857 , latitude : 32.010 } ,
{ province : '江苏省' , city : '南通市' , district : '通州区' , longitude : 121.073 , latitude : 32.065 } ,
// 徐州市
{ province : '江苏省' , city : '徐州市' , district : '鼓楼区' , longitude : 117.186 , latitude : 34.289 } ,
{ province : '江苏省' , city : '徐州市' , district : '云龙区' , longitude : 117.251 , latitude : 34.253 } ,
{ province : '江苏省' , city : '徐州市' , district : '泉山区' , longitude : 117.194 , latitude : 34.244 } ,
// ========== 四川省 ==========
// 成都市
{ province : '四川省' , city : '成都市' , district : '锦江区' , longitude : 104.081 , latitude : 30.655 } ,
{ province : '四川省' , city : '成都市' , district : '青羊区' , longitude : 104.062 , latitude : 30.674 } ,
{ province : '四川省' , city : '成都市' , district : '金牛区' , longitude : 104.052 , latitude : 30.691 } ,
{ province : '四川省' , city : '成都市' , district : '武侯区' , longitude : 104.043 , latitude : 30.642 } ,
{ province : '四川省' , city : '成都市' , district : '成华区' , longitude : 104.101 , latitude : 30.660 } ,
{ province : '四川省' , city : '成都市' , district : '龙泉驿区' , longitude : 104.275 , latitude : 30.557 } ,
{ province : '四川省' , city : '成都市' , district : '青白江区' , longitude : 104.251 , latitude : 30.879 } ,
{ province : '四川省' , city : '成都市' , district : '新都区' , longitude : 104.159 , latitude : 30.824 } ,
{ province : '四川省' , city : '成都市' , district : '温江区' , longitude : 103.857 , latitude : 30.682 } ,
{ province : '四川省' , city : '成都市' , district : '双流区' , longitude : 103.924 , latitude : 30.574 } ,
{ province : '四川省' , city : '成都市' , district : '郫都区' , longitude : 103.901 , latitude : 30.796 } ,
{ province : '四川省' , city : '成都市' , district : '新津区' , longitude : 103.811 , latitude : 30.410 } ,
// 绵阳市
{ province : '四川省' , city : '绵阳市' , district : '涪城区' , longitude : 104.757 , latitude : 31.455 } ,
{ province : '四川省' , city : '绵阳市' , district : '游仙区' , longitude : 104.750 , latitude : 31.474 } ,
// ========== 湖北省 ==========
// 武汉市
{ province : '湖北省' , city : '武汉市' , district : '江岸区' , longitude : 114.309 , latitude : 30.600 } ,
{ province : '湖北省' , city : '武汉市' , district : '江汉区' , longitude : 114.271 , latitude : 30.601 } ,
{ province : '湖北省' , city : '武汉市' , district : '硚口区' , longitude : 114.264 , latitude : 30.571 } ,
{ province : '湖北省' , city : '武汉市' , district : '汉阳区' , longitude : 114.219 , latitude : 30.545 } ,
{ province : '湖北省' , city : '武汉市' , district : '武昌区' , longitude : 114.316 , latitude : 30.554 } ,
{ province : '湖北省' , city : '武汉市' , district : '青山区' , longitude : 114.385 , latitude : 30.640 } ,
{ province : '湖北省' , city : '武汉市' , district : '洪山区' , longitude : 114.343 , latitude : 30.500 } ,
{ province : '湖北省' , city : '武汉市' , district : '东西湖区' , longitude : 114.137 , latitude : 30.620 } ,
{ province : '湖北省' , city : '武汉市' , district : '汉南区' , longitude : 114.084 , latitude : 30.309 } ,
{ province : '湖北省' , city : '武汉市' , district : '蔡甸区' , longitude : 114.029 , latitude : 30.582 } ,
{ province : '湖北省' , city : '武汉市' , district : '江夏区' , longitude : 114.321 , latitude : 30.376 } ,
{ province : '湖北省' , city : '武汉市' , district : '黄陂区' , longitude : 114.376 , latitude : 30.882 } ,
{ province : '湖北省' , city : '武汉市' , district : '新洲区' , longitude : 114.801 , latitude : 30.842 } ,
// 襄阳市
{ province : '湖北省' , city : '襄阳市' , district : '襄城区' , longitude : 112.134 , latitude : 32.010 } ,
{ province : '湖北省' , city : '襄阳市' , district : '樊城区' , longitude : 112.136 , latitude : 32.045 } ,
// ========== 湖南省 ==========
// 长沙市
{ province : '湖南省' , city : '长沙市' , district : '芙蓉区' , longitude : 113.033 , latitude : 28.185 } ,
{ province : '湖南省' , city : '长沙市' , district : '天心区' , longitude : 112.990 , latitude : 28.114 } ,
{ province : '湖南省' , city : '长沙市' , district : '岳麓区' , longitude : 112.931 , latitude : 28.235 } ,
{ province : '湖南省' , city : '长沙市' , district : '开福区' , longitude : 112.986 , latitude : 28.256 } ,
{ province : '湖南省' , city : '长沙市' , district : '雨花区' , longitude : 113.038 , latitude : 28.136 } ,
{ province : '湖南省' , city : '长沙市' , district : '望城区' , longitude : 112.817 , latitude : 28.347 } ,
{ province : '湖南省' , city : '长沙市' , district : '浏阳市' , longitude : 113.643 , latitude : 28.163 } ,
// ========== 福建省 ==========
// 福州市
{ province : '福建省' , city : '福州市' , district : '鼓楼区' , longitude : 119.304 , latitude : 26.082 } ,
{ province : '福建省' , city : '福州市' , district : '台江区' , longitude : 119.314 , latitude : 26.053 } ,
{ province : '福建省' , city : '福州市' , district : '仓山区' , longitude : 119.273 , latitude : 26.047 } ,
{ province : '福建省' , city : '福州市' , district : '马尾区' , longitude : 119.456 , latitude : 25.990 } ,
{ province : '福建省' , city : '福州市' , district : '晋安区' , longitude : 119.328 , latitude : 26.082 } ,
// 厦门市
{ province : '福建省' , city : '厦门市' , district : '思明区' , longitude : 118.087 , latitude : 24.445 } ,
{ province : '福建省' , city : '厦门市' , district : '海沧区' , longitude : 118.033 , latitude : 24.485 } ,
{ province : '福建省' , city : '厦门市' , district : '湖里区' , longitude : 118.147 , latitude : 24.513 } ,
{ province : '福建省' , city : '厦门市' , district : '集美区' , longitude : 118.097 , latitude : 24.576 } ,
{ province : '福建省' , city : '厦门市' , district : '同安区' , longitude : 118.150 , latitude : 24.723 } ,
{ province : '福建省' , city : '厦门市' , district : '翔安区' , longitude : 118.248 , latitude : 24.619 } ,
// 泉州市
{ province : '福建省' , city : '泉州市' , district : '鲤城区' , longitude : 118.587 , latitude : 24.908 } ,
{ province : '福建省' , city : '泉州市' , district : '丰泽区' , longitude : 118.613 , latitude : 24.891 } ,
// ========== 山东省 ==========
// 济南市
{ province : '山东省' , city : '济南市' , district : '历下区' , longitude : 117.077 , latitude : 36.666 } ,
{ province : '山东省' , city : '济南市' , district : '市中区' , longitude : 116.998 , latitude : 36.645 } ,
{ province : '山东省' , city : '济南市' , district : '槐荫区' , longitude : 116.901 , latitude : 36.651 } ,
{ province : '山东省' , city : '济南市' , district : '天桥区' , longitude : 116.987 , latitude : 36.678 } ,
{ province : '山东省' , city : '济南市' , district : '历城区' , longitude : 117.065 , latitude : 36.680 } ,
{ province : '山东省' , city : '济南市' , district : '长清区' , longitude : 116.752 , latitude : 36.554 } ,
{ province : '山东省' , city : '济南市' , district : '章丘区' , longitude : 117.484 , latitude : 36.680 } ,
// 青岛市
{ province : '山东省' , city : '青岛市' , district : '市南区' , longitude : 120.413 , latitude : 36.075 } ,
{ province : '山东省' , city : '青岛市' , district : '市北区' , longitude : 120.356 , latitude : 36.087 } ,
{ province : '山东省' , city : '青岛市' , district : '李沧区' , longitude : 120.433 , latitude : 36.145 } ,
{ province : '山东省' , city : '青岛市' , district : '崂山区' , longitude : 120.469 , latitude : 36.107 } ,
{ province : '山东省' , city : '青岛市' , district : '黄岛区' , longitude : 120.198 , latitude : 35.961 } ,
{ province : '山东省' , city : '青岛市' , district : '城阳区' , longitude : 120.396 , latitude : 36.307 } ,
{ province : '山东省' , city : '青岛市' , district : '即墨区' , longitude : 120.447 , latitude : 36.389 } ,
// 烟台市
{ province : '山东省' , city : '烟台市' , district : '芝罘区' , longitude : 121.400 , latitude : 37.541 } ,
{ province : '山东省' , city : '烟台市' , district : '莱山区' , longitude : 121.445 , latitude : 37.511 } ,
// ========== 河南省 ==========
// 郑州市
{ province : '河南省' , city : '郑州市' , district : '中原区' , longitude : 113.613 , latitude : 34.748 } ,
{ province : '河南省' , city : '郑州市' , district : '二七区' , longitude : 113.674 , latitude : 34.724 } ,
{ province : '河南省' , city : '郑州市' , district : '管城区' , longitude : 113.677 , latitude : 34.754 } ,
{ province : '河南省' , city : '郑州市' , district : '金水区' , longitude : 113.661 , latitude : 34.800 } ,
{ province : '河南省' , city : '郑州市' , district : '惠济区' , longitude : 113.617 , latitude : 34.867 } ,
{ province : '河南省' , city : '郑州市' , district : '上街区' , longitude : 113.309 , latitude : 34.803 } ,
{ province : '河南省' , city : '郑州市' , district : '郑东新区' , longitude : 113.729 , latitude : 34.764 } ,
// 洛阳市
{ province : '河南省' , city : '洛阳市' , district : '老城区' , longitude : 112.469 , latitude : 34.683 } ,
{ province : '河南省' , city : '洛阳市' , district : '西工区' , longitude : 112.428 , latitude : 34.660 } ,
{ province : '河南省' , city : '洛阳市' , district : '涧西区' , longitude : 112.396 , latitude : 34.658 } ,
{ province : '河南省' , city : '洛阳市' , district : '洛龙区' , longitude : 112.464 , latitude : 34.619 } ,
// ========== 辽宁省 ==========
// 沈阳市
{ province : '辽宁省' , city : '沈阳市' , district : '和平区' , longitude : 123.420 , latitude : 41.790 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '沈河区' , longitude : 123.459 , latitude : 41.796 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '大东区' , longitude : 123.470 , latitude : 41.805 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '皇姑区' , longitude : 123.442 , latitude : 41.825 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '铁西区' , longitude : 123.377 , latitude : 41.803 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '浑南区' , longitude : 123.450 , latitude : 41.715 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '沈北新区' , longitude : 123.431 , latitude : 41.912 } ,
{ province : '辽宁省' , city : '沈阳市' , district : '于洪区' , longitude : 123.308 , latitude : 41.794 } ,
// 大连市
{ province : '辽宁省' , city : '大连市' , district : '中山区' , longitude : 121.645 , latitude : 38.919 } ,
{ province : '辽宁省' , city : '大连市' , district : '西岗区' , longitude : 121.612 , latitude : 38.915 } ,
{ province : '辽宁省' , city : '大连市' , district : '沙河口区' , longitude : 121.594 , latitude : 38.905 } ,
{ province : '辽宁省' , city : '大连市' , district : '甘井子区' , longitude : 121.526 , latitude : 38.953 } ,
{ province : '辽宁省' , city : '大连市' , district : '旅顺口区' , longitude : 121.262 , latitude : 38.851 } ,
{ province : '辽宁省' , city : '大连市' , district : '金州区' , longitude : 121.719 , latitude : 39.100 } ,
// ========== 陕西省 ==========
// 西安市
{ province : '陕西省' , city : '西安市' , district : '新城区' , longitude : 108.961 , latitude : 34.267 } ,
{ province : '陕西省' , city : '西安市' , district : '碑林区' , longitude : 108.934 , latitude : 34.230 } ,
{ province : '陕西省' , city : '西安市' , district : '莲湖区' , longitude : 108.944 , latitude : 34.265 } ,
{ province : '陕西省' , city : '西安市' , district : '灞桥区' , longitude : 109.064 , latitude : 34.273 } ,
{ province : '陕西省' , city : '西安市' , district : '未央区' , longitude : 108.947 , latitude : 34.293 } ,
{ province : '陕西省' , city : '西安市' , district : '雁塔区' , longitude : 108.949 , latitude : 34.223 } ,
{ province : '陕西省' , city : '西安市' , district : '长安区' , longitude : 108.907 , latitude : 34.159 } ,
{ province : '陕西省' , city : '西安市' , district : '高陵区' , longitude : 109.088 , latitude : 34.535 } ,
// ========== 云南省 ==========
// 昆明市
{ province : '云南省' , city : '昆明市' , district : '五华区' , longitude : 102.707 , latitude : 25.044 } ,
{ province : '云南省' , city : '昆明市' , district : '盘龙区' , longitude : 102.752 , latitude : 25.116 } ,
{ province : '云南省' , city : '昆明市' , district : '官渡区' , longitude : 102.744 , latitude : 25.015 } ,
{ province : '云南省' , city : '昆明市' , district : '西山区' , longitude : 102.664 , latitude : 25.038 } ,
{ province : '云南省' , city : '昆明市' , district : '呈贡区' , longitude : 102.822 , latitude : 24.886 } ,
// ========== 安徽省 ==========
// 合肥市
{ province : '安徽省' , city : '合肥市' , district : '瑶海区' , longitude : 117.309 , latitude : 31.858 } ,
{ province : '安徽省' , city : '合肥市' , district : '庐阳区' , longitude : 117.265 , latitude : 31.879 } ,
{ province : '安徽省' , city : '合肥市' , district : '蜀山区' , longitude : 117.261 , latitude : 31.851 } ,
{ province : '安徽省' , city : '合肥市' , district : '包河区' , longitude : 117.310 , latitude : 31.795 } ,
{ province : '安徽省' , city : '合肥市' , district : '肥西县' , longitude : 117.158 , latitude : 31.707 } ,
{ province : '安徽省' , city : '合肥市' , district : '肥东县' , longitude : 117.469 , latitude : 31.888 } ,
{ province : '安徽省' , city : '合肥市' , district : '长丰县' , longitude : 117.168 , latitude : 32.478 } ,
// ========== 广西壮族自治区 ==========
// 南宁市
{ province : '广西壮族自治区' , city : '南宁市' , district : '兴宁区' , longitude : 108.369 , latitude : 22.854 } ,
{ province : '广西壮族自治区' , city : '南宁市' , district : '青秀区' , longitude : 108.494 , latitude : 22.785 } ,
{ province : '广西壮族自治区' , city : '南宁市' , district : '江南区' , longitude : 108.273 , latitude : 22.781 } ,
{ province : '广西壮族自治区' , city : '南宁市' , district : '西乡塘区' , longitude : 108.307 , latitude : 22.833 } ,
{ province : '广西壮族自治区' , city : '南宁市' , district : '良庆区' , longitude : 108.322 , latitude : 22.759 } ,
// ========== 江西省 ==========
// 南昌市
{ province : '江西省' , city : '南昌市' , district : '东湖区' , longitude : 115.899 , latitude : 28.685 } ,
{ province : '江西省' , city : '南昌市' , district : '西湖区' , longitude : 115.877 , latitude : 28.657 } ,
{ province : '江西省' , city : '南昌市' , district : '青云谱区' , longitude : 115.926 , latitude : 28.621 } ,
{ province : '江西省' , city : '南昌市' , district : '青山湖区' , longitude : 115.962 , latitude : 28.682 } ,
{ province : '江西省' , city : '南昌市' , district : '红谷滩区' , longitude : 115.861 , latitude : 28.698 } ,
// ========== 贵州省 ==========
// 贵阳市
{ province : '贵州省' , city : '贵阳市' , district : '南明区' , longitude : 106.714 , latitude : 26.568 } ,
{ province : '贵州省' , city : '贵阳市' , district : '云岩区' , longitude : 106.725 , latitude : 26.605 } ,
{ province : '贵州省' , city : '贵阳市' , district : '花溪区' , longitude : 106.670 , latitude : 26.410 } ,
{ province : '贵州省' , city : '贵阳市' , district : '乌当区' , longitude : 106.751 , latitude : 26.631 } ,
{ province : '贵州省' , city : '贵阳市' , district : '观山湖区' , longitude : 106.622 , latitude : 26.601 } ,
// ========== 河北省 ==========
// 石家庄市
{ province : '河北省' , city : '石家庄市' , district : '长安区' , longitude : 114.539 , latitude : 38.037 } ,
{ province : '河北省' , city : '石家庄市' , district : '桥西区' , longitude : 114.461 , latitude : 38.004 } ,
{ province : '河北省' , city : '石家庄市' , district : '新华区' , longitude : 114.463 , latitude : 38.051 } ,
{ province : '河北省' , city : '石家庄市' , district : '裕华区' , longitude : 114.531 , latitude : 38.006 } ,
{ province : '河北省' , city : '石家庄市' , district : '藁城区' , longitude : 114.847 , latitude : 38.022 } ,
// 唐山市
{ province : '河北省' , city : '唐山市' , district : '路南区' , longitude : 118.154 , latitude : 39.625 } ,
{ province : '河北省' , city : '唐山市' , district : '路北区' , longitude : 118.181 , latitude : 39.625 } ,
// ========== 山西省 ==========
// 太原市
{ province : '山西省' , city : '太原市' , district : '小店区' , longitude : 112.565 , latitude : 37.736 } ,
{ province : '山西省' , city : '太原市' , district : '迎泽区' , longitude : 112.563 , latitude : 37.863 } ,
{ province : '山西省' , city : '太原市' , district : '杏花岭区' , longitude : 112.562 , latitude : 37.884 } ,
{ province : '山西省' , city : '太原市' , district : '尖草坪区' , longitude : 112.487 , latitude : 37.940 } ,
{ province : '山西省' , city : '太原市' , district : '万柏林区' , longitude : 112.516 , latitude : 37.859 } ,
// ========== 海南省 ==========
// 海口市
{ province : '海南省' , city : '海口市' , district : '秀英区' , longitude : 110.294 , latitude : 20.008 } ,
{ province : '海南省' , city : '海口市' , district : '龙华区' , longitude : 110.329 , latitude : 20.031 } ,
{ province : '海南省' , city : '海口市' , district : '琼山区' , longitude : 110.354 , latitude : 20.003 } ,
{ province : '海南省' , city : '海口市' , district : '美兰区' , longitude : 110.366 , latitude : 20.029 } ,
// 三亚市
{ province : '海南省' , city : '三亚市' , district : '海棠区' , longitude : 109.753 , latitude : 18.400 } ,
{ province : '海南省' , city : '三亚市' , district : '吉阳区' , longitude : 109.578 , latitude : 18.281 } ,
{ province : '海南省' , city : '三亚市' , district : '天涯区' , longitude : 109.452 , latitude : 18.299 } ,
{ province : '海南省' , city : '三亚市' , district : '崖州区' , longitude : 109.172 , latitude : 18.357 } ,
// ========== 香港特别行政区 ==========
{ province : '香港特别行政区' , city : '香港' , district : '中西区' , longitude : 114.154 , latitude : 22.282 } ,
{ province : '香港特别行政区' , city : '香港' , district : '湾仔区' , longitude : 114.183 , latitude : 22.276 } ,
{ province : '香港特别行政区' , city : '香港' , district : '东区' , longitude : 114.226 , latitude : 22.279 } ,
{ province : '香港特别行政区' , city : '香港' , district : '南区' , longitude : 114.174 , latitude : 22.247 } ,
{ province : '香港特别行政区' , city : '香港' , district : '油尖旺区' , longitude : 114.173 , latitude : 22.312 } ,
{ province : '香港特别行政区' , city : '香港' , district : '深水埗区' , longitude : 114.163 , latitude : 22.332 } ,
{ province : '香港特别行政区' , city : '香港' , district : '九龙城区' , longitude : 114.193 , latitude : 22.312 } ,
{ province : '香港特别行政区' , city : '香港' , district : '黄大仙区' , longitude : 114.207 , latitude : 22.336 } ,
{ province : '香港特别行政区' , city : '香港' , district : '观塘区' , longitude : 114.232 , latitude : 22.309 } ,
{ province : '香港特别行政区' , city : '香港' , district : '荃湾区' , longitude : 114.121 , latitude : 22.369 } ,
{ province : '香港特别行政区' , city : '香港' , district : '屯门区' , longitude : 113.977 , latitude : 22.393 } ,
{ province : '香港特别行政区' , city : '香港' , district : '元朗区' , longitude : 114.032 , latitude : 22.443 } ,
{ province : '香港特别行政区' , city : '香港' , district : '北区' , longitude : 114.149 , latitude : 22.494 } ,
{ province : '香港特别行政区' , city : '香港' , district : '大埔区' , longitude : 114.172 , latitude : 22.455 } ,
{ province : '香港特别行政区' , city : '香港' , district : '西贡区' , longitude : 114.275 , latitude : 22.317 } ,
{ province : '香港特别行政区' , city : '香港' , district : '沙田区' , longitude : 114.192 , latitude : 22.379 } ,
{ province : '香港特别行政区' , city : '香港' , district : '离岛区' , longitude : 113.946 , latitude : 22.286 } ,
// ========== 澳门特别行政区 ==========
{ province : '澳门特别行政区' , city : '澳门' , district : '花地玛堂区' , longitude : 113.550 , latitude : 22.200 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '花王堂区' , longitude : 113.548 , latitude : 22.196 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '望德堂区' , longitude : 113.550 , latitude : 22.193 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '大堂区' , longitude : 113.554 , latitude : 22.188 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '风顺堂区' , longitude : 113.542 , latitude : 22.184 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '氹仔' , longitude : 113.576 , latitude : 22.156 } ,
{ province : '澳门特别行政区' , city : '澳门' , district : '路环' , longitude : 113.564 , latitude : 22.126 } ,
// ========== 台湾省(主要城市) ==========
{ province : '台湾省' , city : '台北市' , district : '中正区' , longitude : 121.520 , latitude : 25.032 } ,
{ province : '台湾省' , city : '台北市' , district : '大同区' , longitude : 121.513 , latitude : 25.063 } ,
{ province : '台湾省' , city : '台北市' , district : '中山区' , longitude : 121.537 , latitude : 25.069 } ,
{ province : '台湾省' , city : '台北市' , district : '松山区' , longitude : 121.557 , latitude : 25.055 } ,
{ province : '台湾省' , city : '台北市' , district : '大安区' , longitude : 121.544 , latitude : 25.030 } ,
{ province : '台湾省' , city : '台北市' , district : '万华区' , longitude : 121.500 , latitude : 25.028 } ,
{ province : '台湾省' , city : '台北市' , district : '信义区' , longitude : 121.561 , latitude : 25.033 } ,
{ province : '台湾省' , city : '台北市' , district : '士林区' , longitude : 121.525 , latitude : 25.095 } ,
{ province : '台湾省' , city : '台北市' , district : '北投区' , longitude : 121.509 , latitude : 25.131 } ,
{ province : '台湾省' , city : '台北市' , district : '内湖区' , longitude : 121.587 , latitude : 25.069 } ,
{ province : '台湾省' , city : '台北市' , district : '南港区' , longitude : 121.607 , latitude : 25.045 } ,
{ province : '台湾省' , city : '台北市' , district : '文山区' , longitude : 121.579 , latitude : 25.001 } ,
{ province : '台湾省' , city : '新北市' , district : '板桥区' , longitude : 121.459 , latitude : 25.013 } ,
{ province : '台湾省' , city : '新北市' , district : '三重区' , longitude : 121.487 , latitude : 25.064 } ,
{ province : '台湾省' , city : '新北市' , district : '中和区' , longitude : 121.497 , latitude : 24.999 } ,
{ province : '台湾省' , city : '新北市' , district : '永和区' , longitude : 121.513 , latitude : 25.008 } ,
{ province : '台湾省' , city : '台中市' , district : '中区' , longitude : 120.680 , latitude : 24.145 } ,
{ province : '台湾省' , city : '高雄市' , district : '新兴区' , longitude : 120.308 , latitude : 22.631 } ,
{ province : '台湾省' , city : '台南市' , district : '中西区' , longitude : 120.194 , latitude : 22.997 } ,
{ province : '台湾省' , city : '桃园市' , district : '桃园区' , longitude : 121.302 , latitude : 24.994 } ,
]
/**
* 查找城市坐标
*
* 支持多种输入格式:
* - "北京市海淀区" → 精确匹配
* - "海淀区" → 区县名匹配
* - "北京海淀" → 城市+区县模糊匹配
* - "海淀" → 区县关键词匹配
*
* @param query 用户输入的地点名称
* @returns 匹配到的坐标信息和显示名称,未找到返回 null
*/
export function lookupCityCoordinates ( query : string ) : {
longitude : number
latitude : number
displayName : string
} | null {
if ( ! query || ! query . trim ( ) ) return null
const cleaned = query . trim ( )
// 1. 精确匹配:完整名称(如"北京市海淀区")
const exactMatch = DISTRICT_DATABASE . find (
( entry ) = > ` ${ entry . province } ${ entry . city } ${ entry . district } ` === cleaned
|| ` ${ entry . city } ${ entry . district } ` === cleaned
|| ` ${ entry . province } ${ entry . district } ` === cleaned ,
)
if ( exactMatch ) {
return {
longitude : exactMatch.longitude ,
latitude : exactMatch.latitude ,
displayName : ` ${ exactMatch . province } ${ exactMatch . district } ` ,
}
}
// 2. 区县名精确匹配(如"海淀区")
const districtMatch = DISTRICT_DATABASE . find (
( entry ) = > entry . district === cleaned ,
)
if ( districtMatch ) {
return {
longitude : districtMatch.longitude ,
latitude : districtMatch.latitude ,
displayName : ` ${ districtMatch . province } ${ districtMatch . district } ` ,
}
}
// 3. 去除省市县区后的关键词匹配
const keywords = cleaned
. replace ( /省|市|自治区|特别行政区|区|县/g , '' )
. trim ( )
if ( keywords ) {
// 按区县名匹配
const keywordDistrictMatch = DISTRICT_DATABASE . find (
( entry ) = > entry . district . includes ( keywords ) || keywords . includes ( entry . district . replace ( /[市区县]/g , '' ) ) ,
)
if ( keywordDistrictMatch ) {
return {
longitude : keywordDistrictMatch.longitude ,
latitude : keywordDistrictMatch.latitude ,
displayName : ` ${ keywordDistrictMatch . province } ${ keywordDistrictMatch . district } ` ,
}
}
// 按城市名匹配(降级为城市中心坐标)
const cityMatch = DISTRICT_DATABASE . find (
( entry ) = > entry . city . includes ( keywords ) || keywords . includes ( entry . city . replace ( /[市区县]/g , '' ) ) ,
)
if ( cityMatch ) {
return {
longitude : cityMatch.longitude ,
latitude : cityMatch.latitude ,
displayName : ` ${ cityMatch . province } ${ cityMatch . city } ` ,
}
}
}
return null
}
/**
* 获取所有区县列表,用于搜索建议
*/
export function getAllDistrictNames ( ) : string [ ] {
return DISTRICT_DATABASE . map (
( entry ) = > ` ${ entry . province } ${ entry . district } ` ,
)
}