优化镇分词经纬度获取
This commit is contained in:
+13
-5
@@ -20,10 +20,12 @@ import java.util.concurrent.Executors
|
||||
class CommitteeLatLng {
|
||||
|
||||
static DBCollection villagesConn = MongoUtils.getCollectionByName("fangjia", "villages", "192.168.0.43", 28017)
|
||||
static ExecutorService executorService = Executors.newFixedThreadPool(20)
|
||||
static ExecutorService executorService = Executors.newFixedThreadPool(1)
|
||||
|
||||
static void main(String[] args) {
|
||||
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)))
|
||||
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0))
|
||||
.append("province_name", '江苏省')
|
||||
)
|
||||
//dealLocation()
|
||||
executorService.shutdown()
|
||||
}
|
||||
@@ -38,6 +40,11 @@ class CommitteeLatLng {
|
||||
def city = obj.city_name
|
||||
def area = obj.area_name
|
||||
def name = obj.name
|
||||
|
||||
// if (!name.contains("社区居委会")) {
|
||||
// return ;
|
||||
// }
|
||||
|
||||
if (city == "市辖区") {
|
||||
city = obj.province_name
|
||||
} else if (city == "省直辖县级行政区划" || city == "自治区直辖县级行政区划") {
|
||||
@@ -50,11 +57,12 @@ class CommitteeLatLng {
|
||||
if (obj.name.contains("虚拟生活区") || obj.name.contains("管理区") || obj.name.contains("虚拟社区")) {
|
||||
name = obj.street_name
|
||||
}
|
||||
if (!obj.name.contains("虚拟社区")) {
|
||||
return ;
|
||||
if (name.contains("社区居委会")) {
|
||||
name = name.replace("居委会", "")
|
||||
}
|
||||
|
||||
String address = province_name + city + area + obj.street_name + name;
|
||||
String address = province_name + city + area + " " + obj.street_name + " " + name;
|
||||
//String address = province_name + city + area + name
|
||||
List<AmapPoi> amapPoi = GaoDeUtils.searchPoi(city, address, area, "130106|130105|130104")
|
||||
if (amapPoi && amapPoi.size() > 0) {
|
||||
def poi = amapPoi[0]
|
||||
|
||||
Reference in New Issue
Block a user