Commit c4182e82 authored by Eric Duminil's avatar Eric Duminil
Browse files

Updated "tests" for Marieke

parent 00ed1cf4
...@@ -4,28 +4,33 @@ import java.io.File; ...@@ -4,28 +4,33 @@ import java.io.File;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import de.hft.stuttgart.citygml.green.osm.GreenEnricher; import de.hft.stuttgart.citygml.green.osm.GreenEnricher;
class AlkisGreenEnricherTest {
class AlkisGreenEnricherTest
{
// @Test // @Test
// void testAlkisGreen() throws Exception { // void testAlkisGreen() throws Exception {
// //NOTE: From https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/wikis/Fallstudien/Gromb%C3%BChl // //NOTE: From
// https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/wikis/Fallstudien/Gromb%C3%BChl
// Path outputGML = Paths.get("data/Grombühl_v4_case_study_alkis_test.gml"); // Path outputGML = Paths.get("data/Grombühl_v4_case_study_alkis_test.gml");
// Files.deleteIfExists(outputGML); // Files.deleteIfExists(outputGML);
// assertFalse(Files.exists(outputGML)); // assertFalse(Files.exists(outputGML));
// String[] args = new String[] { "data/Grombühl_v4_case_study.gml", // Input GML // String[] args = new String[] { "data/Grombühl_v4_case_study.gml", // Input
// GML
// "data/tn_09663/Nutzung.shp", // ALKIS Data // "data/tn_09663/Nutzung.shp", // ALKIS Data
// //NOTE: From https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/issues/26#note_6544 // //NOTE: From
// "data/Trees/Trees_realisticScenario_20240201.shp", // Added trees, in Baumkatasterformat, // https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/issues/26#note_6544
// "data/Trees/Trees_realisticScenario_20240201.shp", // Added trees, in
// Baumkatasterformat,
// "alkis_test", // Output GML suffix // "alkis_test", // Output GML suffix
// "POLYGON((9.946874 49.803172, 9.949785 49.803205, 9.952122 49.803312, 9.953435 49.803089, 9.956488 49.803150, 9.955465 49.802374, 9.953216 49.800916, 9.952371 49.800676, 9.951810 49.800509, 9.949172 49.800829, 9.946792 49.800796, 9.946874 49.803172))" // "POLYGON((9.946874 49.803172, 9.949785 49.803205, 9.952122 49.803312,
// 9.953435 49.803089, 9.956488 49.803150, 9.955465 49.802374, 9.953216
// 49.800916, 9.952371 49.800676, 9.951810 49.800509, 9.949172 49.800829,
// 9.946792 49.800796, 9.946874 49.803172))"
// }; // };
// AlkisGreenEnricher.main(args); // AlkisGreenEnricher.main(args);
// assertTrue(Files.exists(outputGML)); // assertTrue(Files.exists(outputGML));
// } // }
@Test @Test
void testGreen() throws Exception { void testMariekeGanzesGebiet() throws Exception {
File folder = new File("data/Marieke/ganzes_gebiet/"); File folder = new File("data/Marieke/ganzes_gebiet/");
String gml = "Grombühl_BA_IST.gml"; String gml = "Grombühl_BA_IST.gml";
File[] shapefiles = folder.listFiles((dir, name) -> name.endsWith(".shp")); File[] shapefiles = folder.listFiles((dir, name) -> name.endsWith(".shp"));
...@@ -38,6 +43,32 @@ class AlkisGreenEnricherTest ...@@ -38,6 +43,32 @@ class AlkisGreenEnricherTest
}; };
GreenEnricher.main(args); GreenEnricher.main(args);
} }
}
@Test
void testMariekeSpezial() throws Exception {
File[] folders = {
new File("data/Marieke/75Bäume/"),
new File("data/Marieke/250Bäume/Abstand5m"),
new File("data/Marieke/250Bäume/Abstand15m/49_801844__49_802502__9_948075__9_949534_15m_Block24"),
new File("data/Marieke/250Bäume/Abstand15m/49_802605__49_804087__9_94036__9_948417_15m_Block7-11_14-17"),
new File("data/Marieke/500Bäume/Abstand10m/49_801844__49_802502__9_948075__9_949534_10m_block_24"),
new File("data/Marieke/500Bäume/Abstand10m/49_802605__49_804087__9_94036__9_948417_10m_block_7-11_14-17"),
};
for (File folder : folders) {
String gml = folder.listFiles((dir, name) -> name.endsWith(".gml"))[0].getName();
File[] shapefiles = folder.listFiles((dir, name) -> name.endsWith(".shp"));
for (File shapefile : shapefiles) {
System.out.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);
}
}
// assertTrue(Files.exists(outputGML)); // assertTrue(Files.exists(outputGML));
} }
} }
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