使用Mysql数据库,主要字段有:
区域主键、区域名称、区域上级标识、地名简称、区域等级、区域编码、邮政编码、组合名称、经度、维度、拼音,
其页面展示效果图如下:
建表sql为:
CREATE TABLE `region` ( `id` int(11) NOT NULL COMMENT '区域主键', `name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域名称', `pid` int(11) NULL DEFAULT NULL COMMENT '区域上级标识', `sname` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地名简称', `level` int(11) NULL DEFAULT NULL COMMENT '区域等级', `citycode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域编码', `yzcode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮政编码', `mername` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组合名称', `Lng` float NULL DEFAULT NULL COMMENT '经度', `Lat` float NULL DEFAULT NULL COMMENT '维度', `pinyin` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拼音', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
插入全国最新数据地址库:
由于CSDN篇幅限制,数据一篇放不下,
sql文件下载地址为:https://download.csdn.net/download/macwx/11869084
下面只是部分数据,全部数据请下载文件,是CSDN篇幅限制不让我全部复制下来啊~~~~
INSERT INTO `fz_region` VALUES (100000, '中国', 0, '中国', 0, '', '', '中国', 116.368, 39.9151, 'China'); INSERT INTO `fz_region` VALUES (110000, '北京', 100000, '北京', 1, '', '', '中国,北京', 116.405, 39.905, 'Beijing'); INSERT INTO `fz_region` VALUES (110100, '北京市', 110000, '北京', 2, '010', '100000', '中国,北京,北京市', 116.405, 39.905, 'Beijing'); INSERT INTO `fz_region` VALUES (110101, '东城区', 110100, '东城', 3, '010', '100010', '中国,北京,北京市,东城区', 116.41, 39.9316, 'Dongcheng'); INSERT INTO `fz_region` VALUES (110102, '西城区', 110100, '西城', 3, '010', '100032', '中国,北京,北京市,西城区', 116.36, 39.9305, 'Xicheng'); INSERT INTO `fz_region` VALUES (110105, '朝阳区', 110100, '朝阳', 3, '010', '100020', '中国,北京,北京市,朝阳区', 116.485, 39.9484, 'Chaoyang'); INSERT INTO `fz_region` VALUES (110106, '丰台区', 110100, '丰台', 3, '010', '100071', '中国,北京,北京市,丰台区', 116.286, 39.8585, 'Fengtai'); INSERT INTO `fz_region` VALUES (110107, '石景山区', 110100, '石景山', 3, '010', '100043', '中国,北京,北京市,石景山区', 116.223, 39.9056, 'Shijingshan'); INSERT INTO `fz_region` VALUES (110108, '海淀区', 110100, '海淀', 3, '010', '100089', '中国,北京,北京市,海淀区', 116.298, 39.9593, 'Haidian'); INSERT INTO `fz_region` VALUES (110109, '门头沟区', 110100, '门头沟', 3, '010', '102300', '中国,北京,北京市,门头沟区', 116.101, 39.9404, 'Mentougou'); INSERT INTO `fz_region` VALUES (110111, '房山区', 110100, '房山', 3, '010', '102488', '中国,北京,北京市,房山区', 116.143, 39.7479, 'Fangshan'); INSERT INTO `fz_region` VALUES (110112, '通州区', 110100, '通州', 3, '010', '101149', '中国,北京,北京市,通州区', 116.657, 39.9097, 'Tongzhou'); INSERT INTO `fz_region` VALUES (110113, '顺义区', 110100, '顺义', 3, '010', '101300', '中国,北京,北京市,顺义区', 116.654, 40.1302, 'Shunyi'); INSERT INTO `fz_region` VALUES (110114, '昌平区', 110100, '昌平', 3, '010', '102200', '中国,北京,北京市,昌平区', 116.231, 40.2207, 'Changping'); INSERT INTO `fz_region` VALUES (110115, '大兴区', 110100, '大兴', 3, '010', '102600', '中国,北京,北京市,大兴区', 116.341, 39.7267, 'Daxing'); INSERT INTO `fz_region` VALUES (110116, '怀柔区', 110100, '怀柔', 3, '010', '101400', '中国,北京,北京市,怀柔区', 116.632, 40.316, 'Huairou'); INSERT INTO `fz_region` VALUES (110117, '平谷区', 110100, '平谷', 3, '010', '101200', '中国,北京,北京市,平谷区', 117.121, 40.1406, 'Pinggu'); INSERT INTO `fz_region` VALUES (110228, '密云县', 110100, '密云', 3, '010', '101500', '中国,北京,北京市,密云县', 116.843, 40.3762, 'Miyun'); INSERT INTO `fz_region` VALUES (110229, '延庆县', 110100, '延庆', 3, '010', '102100', '中国,北京,北京市,延庆县', 115.975, 40.4567, 'Yanqing'); INSERT INTO `fz_region` VALUES (120000, '天津', 100000, '天津', 1, '', '', '中国,天津', 117.19, 39.1256, 'Tianjin'); INSERT INTO `fz_region` VALUES (120100, '天津市', 120000, '天津', 2, '022', '300000', '中国,天津,天津市', 117.19, 39.1256, 'Tianjin'); INSERT INTO `fz_region` VALUES (120101, '和平区', 120100, '和平', 3, '022', '300041', '中国,天津,天津市,和平区', 117.215, 39.1172, 'Heping'); INSERT INTO `fz_region` VALUES (120102, '河东区', 120100, '河东', 3, '022', '300171', '中国,天津,天津市,河东区', 117.226, 39.1232, 'Hedong'); INSERT INTO `fz_region` VALUES (120103, '河西区', 120100, '河西', 3, '022', '300202', '中国,天津,天津市,河西区', 117.223, 39.1096, 'Hexi'); INSERT INTO `fz_region` VALUES (120104, '南开区', 120100, '南开', 3, '022', '300110', '中国,天津,天津市,南开区', 117.151, 39.1382, 'Nankai'); INSERT INTO `fz_region` VALUES (120105, '河北区', 120100, '河北', 3, '022', '300143', '中国,天津,天津市,河北区', 117.197, 39.1482, 'Hebei'); INSERT INTO `fz_region` VALUES (120106, '红桥区', 120100, '红桥', 3, '022', '300131', '中国,天津,天津市,红桥区', 117.151, 39.1671, 'Hongqiao'); INSERT INTO `fz_region` VALUES (120110, '东丽区', 120100, '东丽', 3, '022', '300300', '中国,天津,天津市,东丽区', 117.314, 39.0863, 'Dongli'); INSERT INTO `fz_region` VALUES (120111, '西青区', 120100, '西青', 3, '022', '300380', '中国,天津,天津市,西青区', 117.009, 39.1412, 'Xiqing'); INSERT INTO `fz_region` VALUES (120112, '津南区', 120100, '津南', 3, '022', '300350', '中国,天津,天津市,津南区', 117.385, 38.9914, 'Jinnan'); INSERT INTO `fz_region` VALUES (120113, '北辰区', 120100, '北辰', 3, '022', '300400', '中国,天津,天津市,北辰区', 117.132, 39.2213, 'Beichen'); INSERT INTO `fz_region` VALUES (120114, '武清区', 120100, '武清', 3, '022', '301700', '中国,天津,天津市,武清区', 117.044, 39.3842, 'Wuqing'); INSERT INTO `fz_region` VALUES (120115, '宝坻区', 120100, '宝坻', 3, '022', '301800', '中国,天津,天津市,宝坻区', 117.31, 39.7176, 'Baodi'); INSERT INTO `fz_region` VALUES (120116, '滨海新区', 120100, '滨海新区', 3, '022', '300451', '中国,天津,天津市,滨海新区', 117.702, 39.0267, 'Binhaixinqu'); INSERT INTO `fz_region` VALUES (120221, '宁河县', 120100, '宁河', 3, '022', '301500', '中国,天津,天津市,宁河县', 117.826, 39.3305, 'Ninghe'); INSERT INTO `fz_region` VALUES (120223, '静海县', 120100, '静海', 3, '022', '301600', '中国,天津,天津市,静海县', 116.974, 38.9458, 'Jinghai'); INSERT INTO `fz_region` VALUES (120225, '蓟县', 120100, '蓟县', 3, '022', '301900', '中国,天津,天津市,蓟县', 117.408, 40.0457, 'Jixian');