This commit is contained in:
2023-10-10 09:39:32 +08:00
parent 9ea850e2ce
commit 4041af57cd
@@ -17,7 +17,10 @@ import java.util.concurrent.atomic.AtomicLong
class PoiWash {
def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009";
DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi_all_8", MAP_POI_URL)
DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL)
// DBCollection MAPPOI_CONN2 = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL)
DBCollection TOWNSHIP_CONN = MongoUtils.getCollectionByName2("fangjia", "township", MAP_POI_URL)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
@@ -27,12 +30,35 @@ class PoiWash {
static main(args) {
def task = new PoiWash()
task.run()
// task.check()
// task.run()
task.check()
// def s = "002乡道与767县道交叉口东北约60米 "
// def s1 = DataUtil.toDBCcase(s)
// println s1
// task.synch()
}
def synch(){
def rets = []
def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"]
for(def city : citys){
def datas = findPois(city)
println city +" "+datas.size()
for(def d : datas){
rets << d
if(rets.size()%10000==0){
MAPPOI_CONN2.insert(rets)
rets.clear()
}
}
}
if(rets.size()>0){
MAPPOI_CONN2.insert(rets)
rets.clear()
}
}
@@ -250,7 +276,7 @@ class PoiWash {
def check(){
def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","三明市"]
def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","三明市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"]
for(def city : citys){
def datas = findPois(city)
processUpdate(city, datas)