优化虚拟生活区经纬度获取
This commit is contained in:
+12
-4
@@ -34,23 +34,31 @@ class CommitteeLatLng {
|
|||||||
executorService.submit(new Runnable() {
|
executorService.submit(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
void run() {
|
void run() {
|
||||||
|
def province_name = obj.province_name
|
||||||
def city = obj.city_name
|
def city = obj.city_name
|
||||||
def area = obj.area_name
|
def area = obj.area_name
|
||||||
|
def name = obj.name
|
||||||
if (city == "市辖区") {
|
if (city == "市辖区") {
|
||||||
city = obj.province_name
|
city = obj.province_name
|
||||||
} else if (city == "省直辖县级行政区划") {
|
} else if (city == "省直辖县级行政区划" || city == "自治区直辖县级行政区划") {
|
||||||
city = obj.area_name
|
city = obj.area_name
|
||||||
area = ""
|
area = ""
|
||||||
|
} else if (city == "县") {
|
||||||
|
city = obj.province_name
|
||||||
|
province_name = ""
|
||||||
}
|
}
|
||||||
if (obj.city_name != "省直辖县级行政区划") {
|
if (obj.name.contains("虚拟生活区") || obj.name.contains("管理区") || obj.name.contains("虚拟社区")) {
|
||||||
|
name = obj.street_name
|
||||||
|
}
|
||||||
|
if (!obj.name.contains("虚拟社区")) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
def address = obj.province_name + city + area + obj.street_name + obj.name;
|
|
||||||
|
|
||||||
|
String address = province_name + city + area + obj.street_name + name;
|
||||||
List<AmapPoi> amapPoi = GaoDeUtils.searchPoi(city, address, area, "130106|130105|130104")
|
List<AmapPoi> amapPoi = GaoDeUtils.searchPoi(city, address, area, "130106|130105|130104")
|
||||||
if (amapPoi && amapPoi.size() > 0) {
|
if (amapPoi && amapPoi.size() > 0) {
|
||||||
def poi = amapPoi[0]
|
def poi = amapPoi[0]
|
||||||
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, obj.name)
|
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, name)
|
||||||
if (similarity < 0.7) {
|
if (similarity < 0.7) {
|
||||||
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user