Commit 1ad28056 authored by Matthias Betz's avatar Matthias Betz
Browse files

add more logging information

parent c66b56c7
...@@ -218,7 +218,7 @@ public class GreenEnricher ...@@ -218,7 +218,7 @@ public class GreenEnricher
WaterBody wb = new WaterBody(); WaterBody wb = new WaterBody();
org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(waterArea.getArea()); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(waterArea.getArea());
if (poly == null) { if (poly == null) {
System.out.println("Skipping WaterBody " + waterArea.getArea()); // System.out.println("Skipping WaterBody " + waterArea.getArea());
continue; continue;
} }
MultiSurface ms = new MultiSurface(); MultiSurface ms = new MultiSurface();
...@@ -233,7 +233,7 @@ public class GreenEnricher ...@@ -233,7 +233,7 @@ public class GreenEnricher
for (GreenArea ga : greenAreas) { for (GreenArea ga : greenAreas) {
org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(ga.getArea()); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(ga.getArea());
if (poly == null) { if (poly == null) {
System.out.println("Skipping " + ga.getArea()); // System.out.println("Skipping " + ga.getArea());
continue; continue;
} }
PlantCover cover = new PlantCover(); PlantCover cover = new PlantCover();
...@@ -349,7 +349,7 @@ public class GreenEnricher ...@@ -349,7 +349,7 @@ public class GreenEnricher
GreenArea area2 = greenAreas.get(j); GreenArea area2 = greenAreas.get(j);
if (area1.getArea().intersects(area2.getArea())) { if (area1.getArea().intersects(area2.getArea())) {
Geometry difference = area1.getArea().difference(area2.getArea()); Geometry difference = area1.getArea().difference(area2.getArea());
System.out.println(difference); // System.out.println(difference);
if (difference instanceof MultiPolygon) { if (difference instanceof MultiPolygon) {
MultiPolygon multi = (MultiPolygon) difference; MultiPolygon multi = (MultiPolygon) difference;
Polygon poly1 = (Polygon) multi.getGeometryN(0); Polygon poly1 = (Polygon) multi.getGeometryN(0);
...@@ -840,7 +840,7 @@ public class GreenEnricher ...@@ -840,7 +840,7 @@ public class GreenEnricher
Road road = new Road(); Road road = new Road();
org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(roadArea.getArea()); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(roadArea.getArea());
if (poly == null) { if (poly == null) {
System.out.println("Skipping RoadArea: " + roadArea.getArea()); // System.out.println("Skipping RoadArea: " + roadArea.getArea());
continue; continue;
} }
MultiSurface ms = new MultiSurface(); MultiSurface ms = new MultiSurface();
...@@ -857,7 +857,7 @@ public class GreenEnricher ...@@ -857,7 +857,7 @@ public class GreenEnricher
LandUse landUse = new LandUse(); LandUse landUse = new LandUse();
org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(landUseArea.getArea()); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(landUseArea.getArea());
if (poly == null) { if (poly == null) {
System.out.println("Skipping RoadArea: " + landUseArea.getArea()); // System.out.println("Skipping RoadArea: " + landUseArea.getArea());
continue; continue;
} }
MultiSurface ms = new MultiSurface(); MultiSurface ms = new MultiSurface();
......
...@@ -42,13 +42,21 @@ public class TreeKatasterData ...@@ -42,13 +42,21 @@ public class TreeKatasterData
Tree tree = new Tree(); Tree tree = new Tree();
Point p = (Point) feature.getAttribute("the_geom"); Point p = (Point) feature.getAttribute("the_geom");
if (p == null) {
throw new IllegalArgumentException("The shape file does not contain Point attribute with the name: \"the_geom\"");
}
tree.setPoint(p); tree.setPoint(p);
String type = feature.getAttribute("Bezeichnun").toString(); String type = feature.getAttribute("Bezeichnun").toString();
if (type == null) {
System.out.println("Ignoring tree, no attribute with name \"Bezeichnun\" found");
continue;
}
tree.setType(type); tree.setType(type);
Object treeHeightObject = feature.getAttribute("Baumhöhe"); Object treeHeightObject = feature.getAttribute("Baumhöhe");
if (treeHeightObject == null) { if (treeHeightObject == null) {
System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Baumhöhe\" found");
continue; continue;
} }
double treeHeight = Double.parseDouble(treeHeightObject.toString()); double treeHeight = Double.parseDouble(treeHeightObject.toString());
...@@ -59,11 +67,13 @@ public class TreeKatasterData ...@@ -59,11 +67,13 @@ public class TreeKatasterData
Object crownWidth = feature.getAttribute("Kronenbrei"); Object crownWidth = feature.getAttribute("Kronenbrei");
if (crownWidth == null) { if (crownWidth == null) {
System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Kronenbrei\" found");
continue; continue;
} }
tree.setCrownRadius(Float.parseFloat(crownWidth.toString()) / 2); tree.setCrownRadius(Float.parseFloat(crownWidth.toString()) / 2);
Object trunkCirc = feature.getAttribute("Stammumfan"); Object trunkCirc = feature.getAttribute("Stammumfan");
if (trunkCirc == null) { if (trunkCirc == null) {
System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Stammumfan\" found");
continue; continue;
} }
double circInCm = Double.parseDouble(trunkCirc.toString()); double circInCm = Double.parseDouble(trunkCirc.toString());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment