From 4a26a73da3343bc30c4ac7daa52899bf2526fe71 Mon Sep 17 00:00:00 2001 From: Eric Duminil Date: Mon, 8 Jul 2024 15:57:03 +0200 Subject: [PATCH] Prepare other scenarios for Marieke --- enrich-citygml-with-greenarea/.gitignore | 1 + .../scripts/PrepareDataForMarieke.java | 56 ++++++++++++++++++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/enrich-citygml-with-greenarea/.gitignore b/enrich-citygml-with-greenarea/.gitignore index 3181a02..e99e7c9 100644 --- a/enrich-citygml-with-greenarea/.gitignore +++ b/enrich-citygml-with-greenarea/.gitignore @@ -275,3 +275,4 @@ $RECYCLE.BIN/ *.lnk # End of https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij +/.apt_generated_tests/ diff --git a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/scripts/PrepareDataForMarieke.java b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/scripts/PrepareDataForMarieke.java index 8f739f8..ebbfc47 100644 --- a/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/scripts/PrepareDataForMarieke.java +++ b/enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/scripts/PrepareDataForMarieke.java @@ -14,9 +14,11 @@ public class PrepareDataForMarieke { // Add Trees to GML files inside data/Marieke/... public static void main(String[] whatever) throws Exception { - processWholeRegion(); - processSmallBlocks(); - processStatusQuo(); + // processGrafenbühl(); + processGrafenbühl3(); + // processWholeRegion(); + // processSmallBlocks(); + // processStatusQuo(); } private static void processStatusQuo() throws IOException, CityGMLContextException, CityGMLReadException, @@ -35,6 +37,54 @@ public class PrepareDataForMarieke } } + private static void processGrafenbühl() throws IOException, CityGMLContextException, CityGMLReadException, + InterruptedException, CityGMLWriteException, JAXBException, ParseException { + File folder = new File("data/Marieke/Grafenbühl"); + File shapefile = new File("data/Marieke/Grafenbühl/Baum_StatusQuo.shp"); + File[] gmls = folder.listFiles((dir, name) -> name.endsWith(".gml")); + for (File gml : gmls) { + System.err.println(">>> " + gml); + String extension = shapefile.getName().replaceAll("\\.shp", ""); + String[] args = new String[] { gml.toString(), // Input GML + shapefile.toString(), // Added trees, in Baumkatasterformat, + extension, // Output GML suffix + }; + GreenEnricher.main(args); + } + } + + private static void processGrafenbühl2() throws IOException, CityGMLContextException, CityGMLReadException, + InterruptedException, CityGMLWriteException, JAXBException, ParseException { + File folder = new File("data/Marieke/Grafenbühl/nur_mit_oben"); + String gml = "Grafenbühl_IST_oben.gml"; + File[] shapefiles = folder.listFiles((dir, name) -> name.endsWith(".shp")); + for (File shapefile : shapefiles) { + System.err.println(">>> " + shapefile); + String extension = shapefile.getName().replaceAll("\\.shp", ""); + String[] args = new String[] { folder.toPath().resolve(gml).toString(), // Input GML + shapefile.toString(), // Added trees, in Baumkatasterformat, + extension, // Output GML suffix + }; + GreenEnricher.main(args); + } + } + + private static void processGrafenbühl3() throws IOException, CityGMLContextException, CityGMLReadException, + InterruptedException, CityGMLWriteException, JAXBException, ParseException { + File folder = new File("data/Marieke/Grafenbühl/nur_mit_ganz"); + String gml = "Grafenbühl_IST_ganz.gml"; + File[] shapefiles = folder.listFiles((dir, name) -> name.endsWith(".shp")); + for (File shapefile : shapefiles) { + System.err.println(">>> " + shapefile); + String extension = shapefile.getName().replaceAll("\\.shp", ""); + String[] args = new String[] { folder.toPath().resolve(gml).toString(), // Input GML + shapefile.toString(), // Added trees, in Baumkatasterformat, + extension, // Output GML suffix + }; + GreenEnricher.main(args); + } + } + private static void processSmallBlocks() throws IOException, CityGMLContextException, CityGMLReadException, InterruptedException, CityGMLWriteException, JAXBException, ParseException { File[] folders = { -- GitLab