diff --git a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/GreenEnricher.java b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/GreenEnricher.java index 1356a5cb23be4e838c91c5220056f5f515091668..752c8f9ca345ca753991bc8bca14c8e36eaf3e43 100644 --- a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/GreenEnricher.java +++ b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/GreenEnricher.java @@ -218,7 +218,7 @@ public class GreenEnricher WaterBody wb = new WaterBody(); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(waterArea.getArea()); if (poly == null) { - System.out.println("Skipping WaterBody " + waterArea.getArea()); +// System.out.println("Skipping WaterBody " + waterArea.getArea()); continue; } MultiSurface ms = new MultiSurface(); @@ -233,7 +233,7 @@ public class GreenEnricher for (GreenArea ga : greenAreas) { org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(ga.getArea()); if (poly == null) { - System.out.println("Skipping " + ga.getArea()); +// System.out.println("Skipping " + ga.getArea()); continue; } PlantCover cover = new PlantCover(); @@ -349,7 +349,7 @@ public class GreenEnricher GreenArea area2 = greenAreas.get(j); if (area1.getArea().intersects(area2.getArea())) { Geometry difference = area1.getArea().difference(area2.getArea()); - System.out.println(difference); +// System.out.println(difference); if (difference instanceof MultiPolygon) { MultiPolygon multi = (MultiPolygon) difference; Polygon poly1 = (Polygon) multi.getGeometryN(0); @@ -840,7 +840,7 @@ public class GreenEnricher Road road = new Road(); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(roadArea.getArea()); if (poly == null) { - System.out.println("Skipping RoadArea: " + roadArea.getArea()); +// System.out.println("Skipping RoadArea: " + roadArea.getArea()); continue; } MultiSurface ms = new MultiSurface(); @@ -857,7 +857,7 @@ public class GreenEnricher LandUse landUse = new LandUse(); org.xmlobjects.gml.model.geometry.primitives.Polygon poly = convertToCityGmlPoly(landUseArea.getArea()); if (poly == null) { - System.out.println("Skipping RoadArea: " + landUseArea.getArea()); +// System.out.println("Skipping RoadArea: " + landUseArea.getArea()); continue; } MultiSurface ms = new MultiSurface(); diff --git a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java index 3f1bddeadae5cb0add9e856ba3fd2e8f0b7e9696..4f53b3a5fec7052e48f78cc30e8e1dc7709a8897 100644 --- a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java +++ b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java @@ -42,13 +42,21 @@ public class TreeKatasterData Tree tree = new Tree(); 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); String type = feature.getAttribute("Bezeichnun").toString(); + if (type == null) { + System.out.println("Ignoring tree, no attribute with name \"Bezeichnun\" found"); + continue; + } tree.setType(type); Object treeHeightObject = feature.getAttribute("Baumhöhe"); if (treeHeightObject == null) { + System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Baumhöhe\" found"); continue; } double treeHeight = Double.parseDouble(treeHeightObject.toString()); @@ -59,11 +67,13 @@ public class TreeKatasterData Object crownWidth = feature.getAttribute("Kronenbrei"); if (crownWidth == null) { + System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Kronenbrei\" found"); continue; } tree.setCrownRadius(Float.parseFloat(crownWidth.toString()) / 2); Object trunkCirc = feature.getAttribute("Stammumfan"); if (trunkCirc == null) { + System.out.println("Ignoring tree of type " + type + ", no attribute with name \"Stammumfan\" found"); continue; } double circInCm = Double.parseDouble(trunkCirc.toString());