IcePoiSearchClient.java
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.glsx.ice.iceClient;
import Ice.Communicator;
import com.glsx.config.SystemProperty;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 计算里程
* @author Administrator
*
*/
@Slf4j
public class IcePoiSearchClient {
// ice接口服务器地址 ice.poisearch.interface.url=PoiSearchNear:default -h 47.107.239.127 -p 10081
private static String ICE_URL = SystemProperty.getProperty("ice.poisearchUrl");
static Communicator ic = Ice.Util.initialize();
static Ice.ObjectPrx base = ic.stringToProxy(ICE_URL).ice_timeout(Integer.parseInt(SystemProperty.getProperty("ice.connectTimeout")));
public static void main(String[] args) throws Exception {
}
/**
* 通过经纬度查询 地址信息
* @param lat
* @param lng
* @return
*/
//public static String mapGeoConvert(String lat, String lng) {
// String resultAddress = null;
//
// //请求和响应对象
// geopoint ptCenterGeopoint = new geopoint();
// ptCenterGeopoint.lng = Float.valueOf(lng);
// ptCenterGeopoint.lat = Float.valueOf(lat);
// StringHolder poiSearchHolder = new StringHolder();
// try {
// if (poiSearchNearPrx == null) {
// log.error("mapGeoConvert ice添加服务异常 servicePre is null");
// return resultAddress;
// }
// int geoRes = poiSearchNearPrx.ReverseGeocoding2(ptCenterGeopoint, poiSearchHolder);
// if(geoRes != 0) { // 结果为 0 表示调用成功
// return resultAddress;
// }
//
// if (poiSearchHolder.value==null
// || StringUtils.isEmpty(poiSearchHolder.value)) {
// return resultAddress;
// }
//
// resultAddress = poiSearchHolder.value;
// } catch (Ice.LocalException e) {
// log.error("mapGeoConvert ice localexception" + e.getMessage(), e);
// } catch (Exception e) {
// log.error("mapGeoConvert ice exception" + e.getMessage(), e);
// }
// log.info("mapGeoConvert ice添加接口调用结束");
// return resultAddress;
//}
}