+3
-2
@@ -2,6 +2,7 @@ package com.fangjia.script.commData
|
|||||||
|
|
||||||
import com.fangjia.core.RegionData
|
import com.fangjia.core.RegionData
|
||||||
import com.fangjia.httpclient.UserAgents
|
import com.fangjia.httpclient.UserAgents
|
||||||
|
import com.fangjia.script.common.DataHandleUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ElasticUtils
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.script.util.JacksonUtil
|
import com.fangjia.script.util.JacksonUtil
|
||||||
@@ -3995,8 +3996,8 @@ class CommonDatautils {
|
|||||||
business_area = data.get("business.business_area")
|
business_area = data.get("business.business_area")
|
||||||
}
|
}
|
||||||
def location = [:]
|
def location = [:]
|
||||||
location.lon = point.x
|
location.lon = DataHandleUtils.getDoubleRound(6, point.x)
|
||||||
location.lat = point.y
|
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]
|
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]
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -166,16 +166,16 @@ class GaoDePoiDataProcess extends BaseBatch{
|
|||||||
retMap.township = InsidePolygon.isInArea2(arrs[0].toString().toDouble(), arrs[1].toString().toDouble(), townMap)
|
retMap.township = InsidePolygon.isInArea2(arrs[0].toString().toDouble(), arrs[1].toString().toDouble(), townMap)
|
||||||
|
|
||||||
def gd_location = [:]
|
def gd_location = [:]
|
||||||
gd_location.lon = arrs[0].toString().toDouble()
|
gd_location.lon = DataHandleUtils.getDoubleRound(6, arrs[0].toString().toDouble())
|
||||||
gd_location.lat = arrs[1].toString().toDouble()
|
gd_location.lat = DataHandleUtils.getDoubleRound(6, arrs[1].toString().toDouble())
|
||||||
retMap.location = gd_location
|
retMap.location = gd_location
|
||||||
|
|
||||||
//高德转百度
|
//高德转百度
|
||||||
def baiduMap = GeoUtils.gcj02ToBd09(arrs[1].toString().toDouble(), arrs[0].toString().toDouble())
|
def baiduMap = GeoUtils.gcj02ToBd09(arrs[1].toString().toDouble(), arrs[0].toString().toDouble())
|
||||||
if(baiduMap){
|
if(baiduMap){
|
||||||
def location = [:]
|
def location = [:]
|
||||||
location.lon = baiduMap.lng
|
location.lon = DataHandleUtils.getDoubleRound(6, baiduMap.lng)
|
||||||
location.lat = baiduMap.lat
|
location.lat = DataHandleUtils.getDoubleRound(6, baiduMap.lat)
|
||||||
retMap.bd_location = location
|
retMap.bd_location = location
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,8 +183,8 @@ class GaoDePoiDataProcess extends BaseBatch{
|
|||||||
def gpsLoactionMap = GeoUtils.gcjToGps84(arrs[1].toString().toDouble(), arrs[0].toString().toDouble())
|
def gpsLoactionMap = GeoUtils.gcjToGps84(arrs[1].toString().toDouble(), arrs[0].toString().toDouble())
|
||||||
if(gpsLoactionMap){
|
if(gpsLoactionMap){
|
||||||
def gpslocation = [:]
|
def gpslocation = [:]
|
||||||
gpslocation.lon = gpsLoactionMap.lng
|
gpslocation.lon = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lng)
|
||||||
gpslocation.lat = gpsLoactionMap.lat
|
gpslocation.lat = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lat)
|
||||||
retMap.gps_location = gpslocation
|
retMap.gps_location = gpslocation
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ class GaoDePoiDataProcess extends BaseBatch{
|
|||||||
map.fjw_city = fjw_city
|
map.fjw_city = fjw_city
|
||||||
|
|
||||||
if(map.cat){
|
if(map.cat){
|
||||||
def arrs = map.cat.split(";")
|
def arrs = map.cat.split(";|:")
|
||||||
map.type = arrs[0]
|
map.type = arrs[0]
|
||||||
if(arrs.size()>=2){
|
if(arrs.size()>=2){
|
||||||
map.secondary_type = arrs[1]
|
map.secondary_type = arrs[1]
|
||||||
@@ -246,8 +246,8 @@ class GaoDePoiDataProcess extends BaseBatch{
|
|||||||
def baiduMap = GeoUtils.gcj02ToBd09(map.location.lat, map.location.lon)
|
def baiduMap = GeoUtils.gcj02ToBd09(map.location.lat, map.location.lon)
|
||||||
if(baiduMap){
|
if(baiduMap){
|
||||||
def location = [:]
|
def location = [:]
|
||||||
location.lon = baiduMap.lng
|
location.lon = DataHandleUtils.getDoubleRound(6, baiduMap.lng)
|
||||||
location.lat = baiduMap.lat
|
location.lat = DataHandleUtils.getDoubleRound(6, baiduMap.lat)
|
||||||
map.bd_location = location
|
map.bd_location = location
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,8 +255,8 @@ class GaoDePoiDataProcess extends BaseBatch{
|
|||||||
def gpsLoactionMap = GeoUtils.gcjToGps84(map.location.lat, map.location.lon)
|
def gpsLoactionMap = GeoUtils.gcjToGps84(map.location.lat, map.location.lon)
|
||||||
if(gpsLoactionMap){
|
if(gpsLoactionMap){
|
||||||
def gpslocation = [:]
|
def gpslocation = [:]
|
||||||
gpslocation.lon = gpsLoactionMap.lng
|
gpslocation.lon = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lng)
|
||||||
gpslocation.lat = gpsLoactionMap.lat
|
gpslocation.lat = DataHandleUtils.getDoubleRound(6, gpsLoactionMap.lat)
|
||||||
map.gps_location = gpslocation
|
map.gps_location = gpslocation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class PoiWash {
|
|||||||
// task.synch()
|
// task.synch()
|
||||||
task.check()
|
task.check()
|
||||||
|
|
||||||
|
|
||||||
// task.checkSpecialSymbols()
|
// task.checkSpecialSymbols()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +256,7 @@ class PoiWash {
|
|||||||
def findPois(def city){
|
def findPois(def city){
|
||||||
def q = new BasicDBObject()
|
def q = new BasicDBObject()
|
||||||
q.put("city", city)
|
q.put("city", city)
|
||||||
// q.put("name", '教师公寓楼')
|
// q.put("name", '(三星)企业设立登记第二受理点')
|
||||||
|
|
||||||
def keys = new BasicDBObject()
|
def keys = new BasicDBObject()
|
||||||
keys.put("_id", 1)
|
keys.put("_id", 1)
|
||||||
@@ -395,7 +394,7 @@ class PoiWash {
|
|||||||
|
|
||||||
def check(){
|
def check(){
|
||||||
// "漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","重庆市","深圳市","北京市","广州市","杭州市","苏州市","成都市",
|
// "漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","重庆市","深圳市","北京市","广州市","杭州市","苏州市","成都市",
|
||||||
def citys = ["漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市","重庆市"]
|
def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"]
|
||||||
for(def city : citys){
|
for(def city : citys){
|
||||||
def datas = findPois(city)
|
def datas = findPois(city)
|
||||||
processUpdate(city, datas)
|
processUpdate(city, datas)
|
||||||
@@ -476,7 +475,7 @@ class PoiWash {
|
|||||||
|
|
||||||
if(udata){
|
if(udata){
|
||||||
updateTotalCount.addAndGet(1)
|
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
|
println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user