|
|
|
@ -102,15 +102,17 @@ public class CoordUtils {
|
|
|
|
|
|
|
|
|
|
String path = basePath + coords + "/" + baseFileName; |
|
|
|
|
|
|
|
|
|
try (InputStream inputStream = new ClassPathResource(path).getInputStream()) { |
|
|
|
|
byte[] binaryData = FileCopyUtils.copyToByteArray(inputStream); |
|
|
|
|
String content = new String(binaryData, "UTF-8"); |
|
|
|
|
try(InputStream inputStream = new ClassPathResource(path).getInputStream(); |
|
|
|
|
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8192)) { |
|
|
|
|
|
|
|
|
|
JSONParser jsonParser = new JSONParser(); |
|
|
|
|
jsonObject = (JSONObject) jsonParser.parse(content); |
|
|
|
|
|
|
|
|
|
jsonObject = (JSONObject) jsonParser.parse(reader); |
|
|
|
|
|
|
|
|
|
}catch(Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
|
|
e.getStackTrace(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return jsonObject; |
|
|
|
|
} |
|
|
|
@ -258,22 +260,25 @@ public class CoordUtils {
|
|
|
|
|
|
|
|
|
|
Point point = null; |
|
|
|
|
|
|
|
|
|
try (InputStream inputStream = new ClassPathResource(path).getInputStream()) { |
|
|
|
|
|
|
|
|
|
byte[] binaryData = FileCopyUtils.copyToByteArray(inputStream); |
|
|
|
|
String content = new String(binaryData, "UTF-8"); |
|
|
|
|
try(InputStream inputStream = new ClassPathResource(path).getInputStream(); |
|
|
|
|
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8192)) { |
|
|
|
|
|
|
|
|
|
JSONParser jsonParser = new JSONParser(); |
|
|
|
|
JSONObject jsonObject = (JSONObject) jsonParser.parse(content); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = (JSONObject) jsonParser.parse(reader); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
point = geometryFactory.createPoint(coordinate); |
|
|
|
|
|
|
|
|
|
features = (List<JSONObject>) jsonObject.get("features"); |
|
|
|
|
|
|
|
|
|
}catch(Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
|
|
e.getStackTrace(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.contains(features, point); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|