|
@@ -82,14 +82,19 @@ public class GeoQueryUtil {
|
|
AreaCityQuery.Init_StoreInWkbsFile(dataFilePath, saveWkbsFilePath, true);
|
|
AreaCityQuery.Init_StoreInWkbsFile(dataFilePath, saveWkbsFilePath, true);
|
|
System.out.println(AreaCityQuery.GetInitInfo().toString()); //打印初始化详细信息,包括性能信息
|
|
System.out.println(AreaCityQuery.GetInitInfo().toString()); //打印初始化详细信息,包括性能信息
|
|
}
|
|
}
|
|
- public boolean queryPoint(String location) throws Exception {
|
|
|
|
|
|
+ public boolean queryPoint(String location) {
|
|
String[] split = location.split(",");
|
|
String[] split = location.split(",");
|
|
if (split.length<2){
|
|
if (split.length<2){
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
double lng= Double.parseDouble(split[0]);
|
|
double lng= Double.parseDouble(split[0]);
|
|
double lat= Double.parseDouble(split[1]);
|
|
double lat= Double.parseDouble(split[1]);
|
|
- AreaCityQuery.QueryResult res1=AreaCityQuery.QueryPoint(lng, lat, null, null);
|
|
|
|
|
|
+ AreaCityQuery.QueryResult res1= null;
|
|
|
|
+ try {
|
|
|
|
+ res1 = AreaCityQuery.QueryPoint(lng, lat, null, null);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
+ }
|
|
if (res1!=null &&res1.Result.size()>0){
|
|
if (res1!=null &&res1.Result.size()>0){
|
|
log.info("查询结果:{},{}",true,res1);
|
|
log.info("查询结果:{},{}",true,res1);
|
|
return true;
|
|
return true;
|
|
@@ -98,8 +103,13 @@ public class GeoQueryUtil {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- public boolean queryPoint(Double lng,Double lat) throws Exception {
|
|
|
|
- AreaCityQuery.QueryResult res1=AreaCityQuery.QueryPoint(lng, lat, null, null);
|
|
|
|
|
|
+ public boolean queryPoint(Double lng,Double lat) {
|
|
|
|
+ AreaCityQuery.QueryResult res1= null;
|
|
|
|
+ try {
|
|
|
|
+ res1 = AreaCityQuery.QueryPoint(lng, lat, null, null);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
+ }
|
|
if (res1!=null &&res1.Result.size()>0){
|
|
if (res1!=null &&res1.Result.size()>0){
|
|
log.info("查询结果:{},{}",true,res1);
|
|
log.info("查询结果:{},{}",true,res1);
|
|
return true;
|
|
return true;
|