package org.argeo.app.geo.acr;
-import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.argeo.app.api.WGS84PosName;
import org.argeo.app.geo.GeoJson;
import org.argeo.app.geo.JTS;
-import org.argeo.cms.util.StreamUtils;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;
throw new UncheckedIOException("Cannot add geometry " + name + " to " + c, e);
}
- try (BufferedReader in = new BufferedReader(
- new InputStreamReader(geom.open(InputStream.class), StandardCharsets.UTF_8))) {
- System.out.println(in.readLine());
- } catch (IOException e) {
- throw new UncheckedIOException("Cannot parse " + c, e);
- }
+// try (BufferedReader in = new BufferedReader(
+// new InputStreamReader(geom.open(InputStream.class), StandardCharsets.UTF_8))) {
+// System.out.println(in.readLine());
+// } catch (IOException e) {
+// throw new UncheckedIOException("Cannot parse " + c, e);
+// }
updateBoundingBox(c);
}
Content geom = c.soleChild(jsonFileName).orElse(null);
if (geom == null)
return null;
- try (Reader in = new InputStreamReader(geom.open(InputStream.class), StandardCharsets.UTF_8)) {
- String json = StreamUtils.toString(new BufferedReader(in));
- System.out.println("JSON:\n" + json);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
+// try (Reader in = new InputStreamReader(geom.open(InputStream.class), StandardCharsets.UTF_8)) {
+// String json = StreamUtils.toString(new BufferedReader(in));
+// System.out.println("JSON:\n" + json);
+// } catch (IOException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// }
try (Reader in = new InputStreamReader(geom.open(InputStream.class), StandardCharsets.UTF_8)) {
JsonReader jsonReader = Json.createReader(in);
JsonObject jsonObject = jsonReader.readObject();
} catch (IOException e) {
throw new UncheckedIOException("Cannot parse " + c, e);
} catch (JsonParsingException e) {
- log.warn("Invalid GeoJson for " + geom);
+ if (log.isTraceEnabled())
+ log.warn("Invalid GeoJson for " + geom);
// json is invalid, returning null
return null;
}