From 62d82aba7c1a86c332a15ab2b8fc55419fafe0f6 Mon Sep 17 00:00:00 2001
From: Riegel <alexander.riegel@hft-stuttgart.de>
Date: Wed, 4 Dec 2024 11:38:44 +0100
Subject: [PATCH] Test: Add test for EPSG-parsing from ZIP-file

---
 .../stuttgart/citydoctor2/ziploader/ZipTest.java |  15 +++++++++++++++
 .../src/test/resources/epsg.zip                  | Bin 0 -> 1381 bytes
 .../src/test/resources/epsg/epsg1.gml            |   9 +++++++++
 .../src/test/resources/epsg/epsg2.gml            |   9 +++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg.zip
 create mode 100644 CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg1.gml
 create mode 100644 CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg2.gml

diff --git a/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/java/de/hft/stuttgart/citydoctor2/ziploader/ZipTest.java b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/java/de/hft/stuttgart/citydoctor2/ziploader/ZipTest.java
index b04095a..ac73522 100644
--- a/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/java/de/hft/stuttgart/citydoctor2/ziploader/ZipTest.java
+++ b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/java/de/hft/stuttgart/citydoctor2/ziploader/ZipTest.java
@@ -60,4 +60,19 @@ public class ZipTest {
         }
     }
 
+    @Test
+    public void testEpsgParsing() {
+        CityGmlArchive cgmlArch = CityGmlArchive.fromZipFile("src/test/resources/epsg.zip", config);
+        assertNotNull(cgmlArch);
+        List<String> epsgs = new ArrayList<>(2);
+        epsgs.add("25832");
+        epsgs.add("7415");
+        for (CityGmlZipEntry entry : cgmlArch.getEntries()) {
+            String srsName = entry.getModel().getCityModel().getBoundedBy().getEnvelope().getSrsName();
+            srsName = srsName.split(":")[6];
+            assertTrue(epsgs.remove(srsName));
+        }
+        assertTrue(epsgs.isEmpty());
+    }
+
 }
diff --git a/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg.zip b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg.zip
new file mode 100644
index 0000000000000000000000000000000000000000..34f56087e60dfdc9fcaa39e49ec0a52e7f7c73ea
GIT binary patch
literal 1381
zcmWIWW@Zs#00F7C=14FDO0Y60Fr*d~r|XA?@G`KcX!xh!)bvk(t?r**TEWf0$O2LZ
zCIY}la4>K%oIo<-J5Y`fW(3F_L%sCe9I#m{faYuiVsoIGXl6~F;+=QMK%nh<$Sc`J
zZ#I6`=#Owv)p*6W$}49V@3{$4r8z0;ytdKewn6Iyq%~%&3cWNp{m<Xe)j7TP_wC)b
z?{2DIzrbX2(wlaT54Hj!X+BSq_iLHoU083ubDvb;%7!x$KetVhEI7ZSMa|6e+x*i-
z-UjPlOP$p1n3Jip;K-E&l?Mw`vgLlrxG3jI1oUKuZ+{kfPa`J0=XUb$LnXU&uSl{5
zP37WRXVkn1XqfSh7?X$(_MvI-rEeFi#pxZeatnHD;WLTleYyXNwEc~N0xdr>cSc-H
z*SMr7ylacB#MCsG_mjCjFBkn^^?!%O`xA0rFWml#ESP(4PyO8z>DAt?!rL}l+xtte
zHm;4?wlO2}w%FF!zn><}dKK1Qetbc1>*@JS*-vi2G-ZiA?UgdY_rA}f&F9Y?)h-A=
zbJ^?uMy4YVg*$3zS9ow6-<~Su^6W~_;kJOKC;t?d`g>fFJ~mPJj-|+>O>Cx<Pwnt~
zbWcH&CvZZ=-n#c`79D{ym5f|Xg8w?_eVJN$eY0KXAqmxmSHClF-s35=xBHgehT9#v
zqW|BNw&?%Uv-`;u;LXl4zdy8U2_pjoD3%fNe+4Q2KcUCJ5j_460OS5BuK2(2cgR5G
z*m~2Cva{}9&NE;$`QsV#h*v^5e~;|lM3XYzOmnvL&szJRXy0HumuND({O!y4*75$g
zFZXZ%{xN4h=N9JN9g~Fh5A17qFq&F0({GPbe0kfwoT_5mG%x18kAEhv6cRYGYRN)9
zi;rfN`<Av$N$tEUmU4=B+63XWhbF>HUKh>#A(En;CwXDc%w2h^lePrz(ArUOdmZ=V
zx7z~KB|A!WB(F^6OzHLFZ94pG(E*=7D>r4w--s*tS;aWbc1?*_)5Q#zzSW{xKk^f<
ze`o%*DaK|qZ%Sdi_vGDNYfcqp^&M<YDy-XcwO&TXYV&fDWfRw{RpbkOSwA^1xpd_U
z-`h88<AL#?|H~#P`J&Nw?^nn8Pan<AiOSt~k1bc{RgGz(+q~Ct-WR57r7)d*dys8i
z-^87F8aJGraPir^bOrzU4(E#-k6Ucs8=K)7dMd|yjppUHbMxoPYsj`Z-haB+>Z#x=
zmfGc8Oy}|)*61jZ;0=`EJCrAWTfFy=;m?zyj}G0-RDH+3u)lrpL}C74c70WXTz@w2
z@!KWjv6n4e^=IU>88J1{NxwKj37{~bt8ytY0f3@8z?+dtgc)}!0xMPiJAzn5mMIV;
zVWkRkdIOazFtDxB8D=EWWem)@AhSU!7TGIkW-~#Z3o@Ii^c&#K$_8>9GZ1nEgU1CJ
HJPZr~XSxMo

literal 0
HcmV?d00001

diff --git a/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg1.gml b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg1.gml
new file mode 100644
index 0000000..d3dfdf5
--- /dev/null
+++ b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg1.gml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<core:CityModel xmlns:core="http://www.opengis.net/citygml/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:dem="http://www.opengis.net/citygml/relief/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/citygml/building/2.0 http://schemas.opengis.net/citygml/building/2.0/building.xsd http://www.opengis.net/citygml/appearance/2.0 http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd http://www.opengis.net/citygml/relief/2.0 http://schemas.opengis.net/citygml/relief/2.0/relief.xsd http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd http://www.opengis.net/citygml/generics/2.0 http://schemas.opengis.net/citygml/generics/2.0/generics.xsd">
+<gml:boundedBy>
+	<gml:Envelope srsDimension="3" srsName="urn:ogc:def:crs:EPSG::25832">
+		<gml:lowerCorner>357978.09 5654873.32 0.00</gml:lowerCorner>
+		<gml:upperCorner>359213.91 5656013.49 0.00</gml:upperCorner>
+	</gml:Envelope>
+</gml:boundedBy>
+</core:CityModel>
\ No newline at end of file
diff --git a/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg2.gml b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg2.gml
new file mode 100644
index 0000000..f423707
--- /dev/null
+++ b/CityDoctorParent/Extensions/CityDoctorZipLoader/src/test/resources/epsg/epsg2.gml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<core:CityModel xmlns:core="http://www.opengis.net/citygml/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:dem="http://www.opengis.net/citygml/relief/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/citygml/building/2.0 http://schemas.opengis.net/citygml/building/2.0/building.xsd http://www.opengis.net/citygml/appearance/2.0 http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd http://www.opengis.net/citygml/relief/2.0 http://schemas.opengis.net/citygml/relief/2.0/relief.xsd http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd http://www.opengis.net/citygml/generics/2.0 http://schemas.opengis.net/citygml/generics/2.0/generics.xsd">
+<gml:boundedBy>
+	<gml:Envelope srsDimension="3" srsName="urn:ogc:def:crs:EPSG::7415">
+		<gml:lowerCorner>84616.468 447422.999 0</gml:lowerCorner>
+		<gml:upperCorner>85140.839 447750.636 100</gml:upperCorner>
+	</gml:Envelope>
+</gml:boundedBy>
+</core:CityModel>
\ No newline at end of file
-- 
GitLab