From 5782999d08a06849f71f08e0075f128f1013f95d Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 17 Oct 2023 14:31:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89id=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/commData/CommonDatautils.groovy | 5 +++-- .../gj/xiamen/GaoDePoiDataProcess.groovy | 22 +++++++++---------- .../fangjia/script/gj/xiamen/PoiWash.groovy | 7 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy index 5d4fe0bbd..728dd6c78 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy @@ -2,6 +2,7 @@ package com.fangjia.script.commData import com.fangjia.core.RegionData import com.fangjia.httpclient.UserAgents +import com.fangjia.script.common.DataHandleUtils import com.fangjia.script.util.DbUtils import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.JacksonUtil @@ -3995,8 +3996,8 @@ class CommonDatautils { business_area = data.get("business.business_area") } def location = [:] - location.lon = point.x - location.lat = point.y + location.lon = DataHandleUtils.getDoubleRound(6, point.x) + location.lat = DataHandleUtils.getDoubleRound(6, point.y) rets << ["province":data.pname,"city":data.cityname, "district":data.adname, "name":data.name, "address":data.address, "cat":data.type, "location":location, "business_area":business_area] // } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy index b57b42ef1..c4670e27e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy @@ -166,16 +166,16 @@ class GaoDePoiDataProcess extends BaseBatch{ retMap.township = InsidePolygon.isInArea2(arrs[0].toString().toDouble(), arrs[1].toString().toDouble(), townMap) def gd_location = [:] - gd_location.lon = arrs[0].toString().toDouble() - gd_location.lat = arrs[1].toString().toDouble() + gd_location.lon = DataHandleUtils.getDoubleRound(6, arrs[0].toString().toDouble()) + gd_location.lat = DataHandleUtils.getDoubleRound(6, arrs[1].toString().toDouble()) retMap.location = gd_location //高德转百度 def baiduMap = GeoUtils.gcj02ToBd09(arrs[1].toString().toDouble(), arrs[0].toString().toDouble()) if(baiduMap){ def location = [:] - location.lon = baiduMap.lng - location.lat = baiduMap.lat + location.lon = DataHandleUtils.getDoubleRound(6, baiduMap.lng) + location.lat = DataHandleUtils.getDoubleRound(6, baiduMap.lat) retMap.bd_location = location } @@ -183,8 +183,8 @@ class GaoDePoiDataProcess extends BaseBatch{ def gpsLoactionMap = GeoUtils.gcjToGps84(arrs[1].toString().toDouble(), arrs[0].toString().toDouble()) if(gpsLoactionMap){ def gpslocation = [:] - gpslocation.lon = gpsLoactionMap.lng - gpslocation.lat = gpsLoactionMap.lat + gpslocation.lon = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lng) + gpslocation.lat = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lat) retMap.gps_location = gpslocation } @@ -226,7 +226,7 @@ class GaoDePoiDataProcess extends BaseBatch{ map.fjw_city = fjw_city if(map.cat){ - def arrs = map.cat.split(";") + def arrs = map.cat.split(";|:") map.type = arrs[0] if(arrs.size()>=2){ map.secondary_type = arrs[1] @@ -246,8 +246,8 @@ class GaoDePoiDataProcess extends BaseBatch{ def baiduMap = GeoUtils.gcj02ToBd09(map.location.lat, map.location.lon) if(baiduMap){ def location = [:] - location.lon = baiduMap.lng - location.lat = baiduMap.lat + location.lon = DataHandleUtils.getDoubleRound(6, baiduMap.lng) + location.lat = DataHandleUtils.getDoubleRound(6, baiduMap.lat) map.bd_location = location } @@ -255,8 +255,8 @@ class GaoDePoiDataProcess extends BaseBatch{ def gpsLoactionMap = GeoUtils.gcjToGps84(map.location.lat, map.location.lon) if(gpsLoactionMap){ def gpslocation = [:] - gpslocation.lon = gpsLoactionMap.lng - gpslocation.lat = gpsLoactionMap.lat + gpslocation.lon = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lng) + gpslocation.lat = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lat) map.gps_location = gpslocation } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy index 197f6c77f..8a7f8daf1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy @@ -37,7 +37,6 @@ class PoiWash { // task.synch() task.check() - // task.checkSpecialSymbols() } @@ -257,7 +256,7 @@ class PoiWash { def findPois(def city){ def q = new BasicDBObject() q.put("city", city) -// q.put("name", '教师公寓楼') +// q.put("name", '(三星)企业设立登记第二受理点') def keys = new BasicDBObject() keys.put("_id", 1) @@ -395,7 +394,7 @@ class PoiWash { def check(){ // "漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","重庆市","深圳市","北京市","广州市","杭州市","苏州市","成都市", - def citys = ["漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市","重庆市"] + def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] for(def city : citys){ def datas = findPois(city) processUpdate(city, datas) @@ -476,7 +475,7 @@ class PoiWash { if(udata){ updateTotalCount.addAndGet(1) - MAPPOI_CONN.update(new BasicDBObject('_id',map.id),new BasicDBObject('$set', udata)) + MAPPOI_CONN.update(new BasicDBObject('id',map.id),new BasicDBObject('$set', udata)) println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city }