优化居委经纬度
This commit is contained in:
+2
-2
@@ -24,7 +24,7 @@ class CommitteeLatLng {
|
|||||||
static ExecutorService executorService = Executors.newFixedThreadPool(10)
|
static ExecutorService executorService = Executors.newFixedThreadPool(10)
|
||||||
|
|
||||||
static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)).append("year", 2021))
|
dealPoi(new BasicDBObject("location", "").append("year", 2022))
|
||||||
//dealLocation()
|
//dealLocation()
|
||||||
executorService.shutdown()
|
executorService.shutdown()
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ class CommitteeLatLng {
|
|||||||
if (amapPoi && amapPoi.size() > 0) {
|
if (amapPoi && amapPoi.size() > 0) {
|
||||||
def poi = amapPoi[0]
|
def poi = amapPoi[0]
|
||||||
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, name)
|
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, name)
|
||||||
if (similarity <= 0.8) {
|
if (similarity <= 0.8 && !String.valueOf(poi.name).contains(name)) {
|
||||||
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
||||||
}
|
}
|
||||||
poi = amapPoi[0]
|
poi = amapPoi[0]
|
||||||
|
|||||||
+13
-9
@@ -55,13 +55,17 @@ class GaoDeUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static String getGaodeKey(String type) {
|
static String getGaodeKey(String type) {
|
||||||
Map<String, String> params = new HashMap<>();
|
// Map<String, String> params = new HashMap<>();
|
||||||
params.put("type", type)
|
// params.put("type", type)
|
||||||
JSONObject json = HttpRequestUtil.getJsonContent("http://192.168.0.100:38080/FangJiaDataService/getAmapKey", params)
|
// JSONObject json = HttpRequestUtil.getJsonContent("http://192.168.0.100:38080/FangJiaDataService/getAmapKey", params)
|
||||||
if (json.status == 0 && json.result != null) {
|
// if (json.status == 0 && json.result != null) {
|
||||||
return json.result
|
// return json.result
|
||||||
}
|
// }
|
||||||
System.exit(1);
|
// System.exit(1);
|
||||||
|
return "8796b9dfb3889b57c38e2fff1b7e51bd";
|
||||||
|
// 'eb69e4ad2a9cdd31f163a0ed32effe6e', '60f764d228d64addf390e28d68a01a35', '66e6771767ab293ace441553c36621c1',
|
||||||
|
// 'a63254b4a1b2e6f4bb11058e0b5d9fa2', '743ad872ad39f0a10665b28fa968af0b', '3b7c1d201c403bb416b63535ed3d0e98',
|
||||||
|
// 'a34894d151fffff94f9a33bae3d5565c', '389e0a3a155e8d28728c3faede4ebd4f'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -330,10 +334,10 @@ class GaoDeUtils {
|
|||||||
params.page = "${page}".toString()
|
params.page = "${page}".toString()
|
||||||
page++
|
page++
|
||||||
params.key = this.getGaodeKey("v5/place/text")
|
params.key = this.getGaodeKey("v5/place/text")
|
||||||
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
|
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/text", params);
|
||||||
if (json == null) {
|
if (json == null) {
|
||||||
params.key = this.getGaodeKey("v5/place/text")
|
params.key = this.getGaodeKey("v5/place/text")
|
||||||
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
|
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/text", params);
|
||||||
}
|
}
|
||||||
if (json && json.info && json.info == "OK") {
|
if (json && json.info && json.info == "OK") {
|
||||||
count = json.getString("count").toInteger()
|
count = json.getString("count").toInteger()
|
||||||
|
|||||||
Reference in New Issue
Block a user