From 96135fe88a5ea24661f10f80782a48e852683b72 Mon Sep 17 00:00:00 2001 From: "rushikesh.padsala" <rushikesh.padsala@hft-stuttgart.de> Date: Mon, 5 Jul 2021 16:02:06 +0200 Subject: [PATCH] addeded citygml4j --- .gitignore | 164 +++++ foodwaterenergycitygml4j/.classpath | 38 ++ foodwaterenergycitygml4j/.project | 23 + foodwaterenergycitygml4j/pom.xml | 46 ++ .../FoodWaterEnergyLandUseADEContext.java | 56 ++ .../FoodWaterEnergyLandUseADEMarshaller.java | 317 ++++++++++ ...FoodWaterEnergyLandUseADEUnMarshaller.java | 277 +++++++++ .../landuse/model/ConsistsOfFWESurvey.java | 79 +++ .../landuse/model/EnergySurvey.java | 257 ++++++++ .../landuse/model/FoodSurvey.java | 128 ++++ .../landuse/model/FoodWaterEnergy.java | 94 +++ .../landuse/model/LandUseSurvey.java | 176 ++++++ .../landuse/model/WaterSurvey.java | 144 +++++ .../model/xsd/ConsistsOfFWESurveyType.java | 49 ++ .../landuse/model/xsd/EnergySurveyType.java | 143 +++++ .../landuse/model/xsd/FoodSurveyType.java | 86 +++ .../model/xsd/FoodWaterEnergyType.java | 58 ++ .../landuse/model/xsd/LandUseSurveyType.java | 102 ++++ .../landuse/model/xsd/ObjectFactory.java | 90 +++ .../landuse/model/xsd/WaterSurveyType.java | 78 +++ .../landuse/model/xsd/package-info.java | 18 + .../FoodWaterEnergyLandUseADEModule.java | 95 +++ ...gml4j.model.citygml.ade.binding.ADEContext | 1 + .../src/main/resources/schema/FWELanduse.xsd | 126 ++++ .../main/resources/schema/fwelanduseADE.xsd | 126 ++++ .../FoodWaterEnergyLandUseTest.java | 562 ++++++++++++++++++ .../src/test/resources/FWELSample2.gml | 72 +++ .../src/test/resources/FWELandUseSample.gml | 72 +++ 28 files changed, 3477 insertions(+) create mode 100644 .gitignore create mode 100644 foodwaterenergycitygml4j/.classpath create mode 100644 foodwaterenergycitygml4j/.project create mode 100644 foodwaterenergycitygml4j/pom.xml create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseADEContext.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEMarshaller.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEUnMarshaller.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/ConsistsOfFWESurvey.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/EnergySurvey.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodSurvey.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodWaterEnergy.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/LandUseSurvey.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/WaterSurvey.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ConsistsOfFWESurveyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/EnergySurveyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodSurveyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodWaterEnergyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/LandUseSurveyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ObjectFactory.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/WaterSurveyType.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/package-info.java create mode 100644 foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/module/FoodWaterEnergyLandUseADEModule.java create mode 100644 foodwaterenergycitygml4j/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext create mode 100644 foodwaterenergycitygml4j/src/main/resources/schema/FWELanduse.xsd create mode 100644 foodwaterenergycitygml4j/src/main/resources/schema/fwelanduseADE.xsd create mode 100644 foodwaterenergycitygml4j/src/test/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseTest.java create mode 100644 foodwaterenergycitygml4j/src/test/resources/FWELSample2.gml create mode 100644 foodwaterenergycitygml4j/src/test/resources/FWELandUseSample.gml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..780c63a --- /dev/null +++ b/.gitignore @@ -0,0 +1,164 @@ +# Created by https://www.toptal.com/developers/gitignore/api/java,linux,windows,maven,git,eclipse +# Edit at https://www.toptal.com/developers/gitignore?templates=java,linux,windows,maven,git,eclipse + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/java,linux,windows,maven,git,eclipse diff --git a/foodwaterenergycitygml4j/.classpath b/foodwaterenergycitygml4j/.classpath new file mode 100644 index 0000000..fc67748 --- /dev/null +++ b/foodwaterenergycitygml4j/.classpath @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/foodwaterenergycitygml4j/.project b/foodwaterenergycitygml4j/.project new file mode 100644 index 0000000..e3e1ee8 --- /dev/null +++ b/foodwaterenergycitygml4j/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>foodwaterenergycitygml4j</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/foodwaterenergycitygml4j/pom.xml b/foodwaterenergycitygml4j/pom.xml new file mode 100644 index 0000000..70520b4 --- /dev/null +++ b/foodwaterenergycitygml4j/pom.xml @@ -0,0 +1,46 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.hft.stuttgart.ade</groupId> + <artifactId>foodwaterenergycitygml4j</artifactId> + <version>0.0.1</version> + <packaging>jar</packaging> + + <name>foodwaterenergycitygml4j</name> + <url>http://maven.apache.org</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + <citygml4j.version>2.10.2</citygml4j.version> + <jakarta.xml.bind>2.3.2</jakarta.xml.bind> + <junit.jupiter.version>5.7.0</junit.jupiter.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.citygml4j</groupId> + <artifactId>citygml4j</artifactId> + <version>${citygml4j.version}</version> + </dependency> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>${jakarta.xml.bind}</version> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>${junit.jupiter.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>${junit.jupiter.version}</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseADEContext.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseADEContext.java new file mode 100644 index 0000000..d22e658 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseADEContext.java @@ -0,0 +1,56 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j; + +import java.util.Collections; +import java.util.List; + +import org.citygml4j.model.citygml.ade.binding.ADEContext; +import org.citygml4j.model.citygml.ade.binding.ADEMarshaller; +import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller; +import org.citygml4j.model.module.ade.ADEModule; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.bind.FoodWaterEnergyLandUseADEMarshaller; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.bind.FoodWaterEnergyLandUseADEUnMarshaller; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.module.FoodWaterEnergyLandUseADEModule; + + +public class FoodWaterEnergyLandUseADEContext implements ADEContext { + + private final List<ADEModule> modules = Collections.singletonList(FoodWaterEnergyLandUseADEModule.V0_1); + + + @Override + public List<ADEModule> getADEModules() { + return modules; + } + + @Override + public List<String> getModelPackageNames() { + return Collections.singletonList("de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model"); + } + + @Override + public ADEMarshaller createADEMarshaller() { + return new FoodWaterEnergyLandUseADEMarshaller(); + } + + @Override + public ADEUnmarshaller createADEUnmarshaller() { + return new FoodWaterEnergyLandUseADEUnMarshaller(); + } + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEMarshaller.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEMarshaller.java new file mode 100644 index 0000000..64ec932 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEMarshaller.java @@ -0,0 +1,317 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.bind; + + +import javax.xml.bind.JAXBElement; + +import org.citygml4j.builder.jaxb.marshal.citygml.ade.ADEMarshallerHelper; +import org.citygml4j.model.citygml.ade.binding.ADEMarshaller; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.util.mapper.TypeMapper; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.ConsistsOfFWESurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.EnergySurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodWaterEnergy; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.LandUseSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.WaterSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.ConsistsOfFWESurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.EnergySurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.FoodSurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.FoodWaterEnergyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.LandUseSurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.ObjectFactory; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.WaterSurveyType; + + +public class FoodWaterEnergyLandUseADEMarshaller implements ADEMarshaller { + private final ObjectFactory factory = new ObjectFactory(); + private final TypeMapper<JAXBElement<?>> elementMapper; + private final TypeMapper<Object> typeMapper; + private ADEMarshallerHelper helper; + + public FoodWaterEnergyLandUseADEMarshaller() { + elementMapper = TypeMapper.<JAXBElement<?>>create() + .with(FoodWaterEnergy.class, this::createFoodWaterEnergy) + .with(ConsistsOfFWESurvey.class, this::createConsistsOfFWESurvey) + .with(LandUseSurvey.class, this::createLandUseSurvey) + .with(FoodSurvey.class, this::createFoodSurvey) + .with(WaterSurvey.class, this::createWaterSurvey) + .with(EnergySurvey.class, this::createEnergySurvey); + + typeMapper = TypeMapper.create() + .with(FoodWaterEnergy.class, this::marshalFoodWaterEnergy) + .with(ConsistsOfFWESurvey.class, this::marshalConsistsOfFWESurvey) + .with(LandUseSurvey.class, this::marshalLandUseSurvey) + .with(FoodSurvey.class, this::marshalFoodSurvey) + .with(WaterSurvey.class, this::marshalWaterSurvey) + .with(EnergySurvey.class, this::marshalEnergySurvey); + } + + @Override + public void setADEMarshallerHelper(ADEMarshallerHelper helper) { + this.helper = helper; + } + + @Override + public JAXBElement<?> marshalJAXBElement(ADEModelObject src) { + return elementMapper.apply(src); + } + + @Override + public Object marshal(ADEModelObject src) { + return typeMapper.apply(src); + } + + private JAXBElement<?> createFoodWaterEnergy(FoodWaterEnergy src) { + return factory.createFoodWaterEnergyType(marshalFoodWaterEnergy(src)); + } + + private FoodWaterEnergyType marshalFoodWaterEnergy(FoodWaterEnergy src) { + FoodWaterEnergyType dest = new FoodWaterEnergyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.isAreaName()) { + dest.setAreaName(src.getAreaName()); + } + if(src.isSystemName()) { + dest.setSystemName(src.getSystemName()); + } + if(src.isConsistsOfFWESurvey()) { + dest.setConsistsOfFWESurveyType(marshalConsistsOfFWESurvey(src.getConsistsOfFWESurvey()));; + } + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + return dest; + } + + private JAXBElement<?> createConsistsOfFWESurvey(ConsistsOfFWESurvey src) { + return factory.createFConsistsOfFWESurveyType(marshalConsistsOfFWESurvey(src)); + } + + + private ConsistsOfFWESurveyType marshalConsistsOfFWESurvey(ConsistsOfFWESurvey src) { + ConsistsOfFWESurveyType dest = new ConsistsOfFWESurveyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.isLandUseSurvey()) { + for(LandUseSurvey lus : src.getLandUseSurvey()) { + dest.getLandUseSurveyType().add(marshalLandUseSurvey(lus)); + } + } + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + return dest; + } + + private JAXBElement<?> createLandUseSurvey(LandUseSurvey src) { + return factory.createLandUseSurveyType(marshalLandUseSurvey(src)); + } + + private LandUseSurveyType marshalLandUseSurvey(LandUseSurvey src) { + LandUseSurveyType dest = new LandUseSurveyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.isBuildingFootprintArea()) { + dest.setBuildingFootprintArea(helper.getGMLMarshaller().marshalArea(src.getBuildingFootprintArea())); + } + if(src.isPopulation()) { + dest.setPopulation(src.getPopulation()); + } + if(src.isSurfaceArea()) { + dest.setSurfaceArea(helper.getGMLMarshaller().marshalArea(src.getSurfaceArea())); + } + if(src.isSurveyDescription()) { + dest.setSurveyDescription(src.getSurveyDescription()); + } + if(src.isSurveyYear()) { + dest.setSurveyYear(src.getSurveyYear()); + } + if(src.isSurveyYearVersion()) { + dest.setSurveyYearVersion(src.getSurveyYearVersion()); + } + if(src.isFoodsurvey()) { + dest.setFoodSurveyType(marshalFoodSurvey(src.getFoodsurvey())); + } + if(src.isWatersurvey()) { + dest.setWaterSurveyType(marshalWaterSurvey(src.getWatersurvey())); + } + if(src.isEnergySurvey()) { + dest.setEnergySurveyType(marshalEnergySurvey(src.getEnergySurvey())); + } + + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + + return dest; + } + + private JAXBElement<?> createFoodSurvey(FoodSurvey src) { + return factory.createFoodSurveyType(marshalFoodSurvey(src)); + } + + private FoodSurveyType marshalFoodSurvey(FoodSurvey src) { + FoodSurveyType dest = new FoodSurveyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.isFoodCategory()) { + dest.setFoodCategory(helper.getGMLMarshaller().marshalCode(src.getFoodCategory())); + } + if(src.isFoodConsumption()) { + dest.setFoodConsumption(helper.getGMLMarshaller().marshalScale(src.getFoodConsumption())); + } + + if(src.isFoodDemand()) { + dest.setFoodDemand(helper.getGMLMarshaller().marshalScale(src.getFoodDemand())); + } + + if(src.isFoodProduction()) { + dest.setFoodProduction(helper.getGMLMarshaller().marshalScale(src.getFoodProduction())); + } + + if(src.isFoodProductionEnergyDemand()) { + dest.setFoodProductionEnergyDemand(helper.getGMLMarshaller().marshalScale(src.getFoodProductionEnergyDemand())); + } + + if(src.isFoodProductionWaterDemand()) { + dest.setFoodProductionWaterDemand(helper.getGMLMarshaller().marshalScale(src.getFoodProductionWaterDemand())); + } + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + return dest; + } + + private JAXBElement<?> createWaterSurvey(WaterSurvey src) { + return factory.createWaterSurveyType(marshalWaterSurvey(src)); + } + + private WaterSurveyType marshalWaterSurvey(WaterSurvey src) { + WaterSurveyType dest = new WaterSurveyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + + if(src.isDomesticHotWaterDemand()) { + dest.setDomesticHotWaterDemand(helper.getGMLMarshaller().marshalScale(src.getDomesticHotWaterDemand())); + } + if(src.isDomesticHotWaterEnergyDemand()) { + dest.setDomesticHotWaterEnergyDemand(helper.getGMLMarshaller().marshalScale(src.getDomesticHotWaterEnergyDemand())); + } + if(src.isDomesticWaterDemand()) { + dest.setDomesticWaterDemand(helper.getGMLMarshaller().marshalScale(src.getDomesticWaterDemand())); + } + if(src.isDomesticSolidWaste()) { + dest.setDomesticSolidWaste(helper.getGMLMarshaller().marshalScale(src.getDomesticSolidWaste())); + } + if(src.isDomesticWaterWaste()) { + dest.setDomesticWaterWaste(helper.getGMLMarshaller().marshalScale(src.getDomesticWaterWaste())); + } + if(src.isTotalDomesticWaste()) { + dest.setTotalDomesticWaste(helper.getGMLMarshaller().marshalScale(src.getTotalDomesticWaste())); + } + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + + return dest; + } + + + private JAXBElement<?> createEnergySurvey(EnergySurvey src) { + return factory.createEnergySurveyType(marshalEnergySurvey(src)); + } + + private EnergySurveyType marshalEnergySurvey(EnergySurvey src) { + EnergySurveyType dest = new EnergySurveyType(); + /* + helper.getGMLMarshaller().marshalAbstractFeature(src, dest); + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + + + if(src.isBiomassPrimaryEnergyPotential()) { + dest.setBiomassPrimaryEnergyPotential(helper.getGMLMarshaller().marshalScale(src.getBiomassPrimaryEnergyPotential())); + } + if(src.isBiomassToBioethanol()) { + dest.setBiomassToBioethanol(helper.getGMLMarshaller().marshalScale(src.getBiomassToBioethanol())); + } + if(src.isBiomassToBiogas()) { + dest.setBiomassToBiogas(helper.getGMLMarshaller().marshalScale(src.getBiomassToBiogas())); + } + if(src.isBiomassToElectricityPotential()) { + dest.setBiomassToElectricityPotential(helper.getGMLMarshaller().marshalScale(src.getBiomassToElectricityPotential())); + } + if(src.isBiomassToEnergyWoods()) { + dest.setBiomassToEnergyWoods(helper.getGMLMarshaller().marshalScale(src.getBiomassToEnergyWoods())); + } + if(src.isBiomassToPlantOil()) { + dest.setBiomassToPlantOil(helper.getGMLMarshaller().marshalScale(src.getBiomassToPlantOil())); + } + if(src.isBiomassToResidualSolidFuel()) { + dest.setBiomassToResidualSolidFuel(helper.getGMLMarshaller().marshalScale(src.getBiomassToResidualSolidFuel())); + } + if(src.isBiomassToSolidFuel()) { + dest.setBiomassToSolidFuel(helper.getGMLMarshaller().marshalScale(src.getBiomassToSolidFuel())); + } + if(src.isBiomassToThermalPotential()) { + dest.setBiomassToThermalPotential(helper.getGMLMarshaller().marshalScale(src.getBiomassToThermalPotential())); + } + if(src.isSpaceCoolingDemand()) { + dest.setSpaceCoolingDemand(helper.getGMLMarshaller().marshalScale(src.getSpaceCoolingDemand())); + } + if(src.isSpaceHeatingDemand()) { + dest.setSpaceHeatingDemand(helper.getGMLMarshaller().marshalScale(src.getSpaceHeatingDemand())); + } + if(src.isElectricityPotentialFromPVBuildings()) { + dest.setElectricityPotentialFromPVBuildings(helper.getGMLMarshaller().marshalScale(src.getElectricityPotentialFromPVBuildings())); + } + if(src.isResidentialElectricityDemand()) { + dest.setResidentialElectricityDemand(helper.getGMLMarshaller().marshalScale(src.getResidentialElectricityDemand())); + } + if(src.isVegetationCoverCategory()) { + dest.setVegetationCoverCategory(helper.getGMLMarshaller().marshalCode(src.getVegetationCoverCategory())); + } + + helper.getGMLMarshaller().marshalAbstractGML(src, dest); + + return dest; + } + + +} + + diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEUnMarshaller.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEUnMarshaller.java new file mode 100644 index 0000000..2830d5d --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/bind/FoodWaterEnergyLandUseADEUnMarshaller.java @@ -0,0 +1,277 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.bind; + + +import javax.xml.bind.JAXBElement; + +import org.citygml4j.builder.jaxb.unmarshal.citygml.ade.ADEUnmarshallerHelper; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller; +import org.citygml4j.util.mapper.CheckedTypeMapper; +import org.citygml4j.xml.io.reader.MissingADESchemaException; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.ConsistsOfFWESurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.EnergySurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodWaterEnergy; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.LandUseSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.WaterSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.ConsistsOfFWESurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.EnergySurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.FoodSurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.FoodWaterEnergyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.LandUseSurveyType; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd.WaterSurveyType; + +public class FoodWaterEnergyLandUseADEUnMarshaller implements ADEUnmarshaller { + private final CheckedTypeMapper<ADEModelObject> typeMapper; + private ADEUnmarshallerHelper helper; + + public FoodWaterEnergyLandUseADEUnMarshaller() { + typeMapper = CheckedTypeMapper.<ADEModelObject>create() + .with(FoodWaterEnergyType.class, this::unmarshalFoodWaterEnergyType) + .with(ConsistsOfFWESurveyType.class, this::unmarshalConsistsOfFWESurveyType) + .with(LandUseSurveyType.class, this::unmarshalLandUseSurveyType) + .with(FoodSurveyType.class, this::unmarshalFoodSurveyType) + .with(WaterSurveyType.class, this::unmarshalWaterSurveyType) + .with(EnergySurveyType.class, this::unmarshalEnergySurveyType); + } + + private FoodWaterEnergy unmarshalFoodWaterEnergyType(FoodWaterEnergyType src) throws MissingADESchemaException { + FoodWaterEnergy dest = new FoodWaterEnergy(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getAreaName() != null) { + dest.setAreaName(src.getAreaName()); + } + if(src.getAreaName() != null) { + dest.setSystemName(src.getSystemName()); + } + if(src.getConsistsOfFWESurveyType() != null) { + dest.setConsistsOfFWESurvey(unmarshalConsistsOfFWESurveyType(src.getConsistsOfFWESurveyType())); + } + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + private ConsistsOfFWESurvey unmarshalConsistsOfFWESurveyType(ConsistsOfFWESurveyType src) throws MissingADESchemaException { + ConsistsOfFWESurvey dest = new ConsistsOfFWESurvey(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getLandUseSurveyType() !=null) { + for(LandUseSurveyType lust : src.getLandUseSurveyType()) { + dest.getLandUseSurvey().add(unmarshalLandUseSurveyType(lust)); + } + } + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + private LandUseSurvey unmarshalLandUseSurveyType(LandUseSurveyType src) throws MissingADESchemaException { + LandUseSurvey dest = new LandUseSurvey(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getBuildingFootprintArea() != null) { + dest.setBuildingFootprintArea(helper.getGMLUnmarshaller().unmarshalArea(src.getBuildingFootprintArea())); + } + if(src.getPopulation() != null) { + dest.setPopulation(src.getPopulation()); + } + if(src.getSurfaceArea() != null) { + dest.setSurfaceArea(helper.getGMLUnmarshaller().unmarshalArea(src.getSurfaceArea())); + } + if(src.getSurveyDescription()!=null) { + dest.setSurveyDescription(src.getSurveyDescription()); + } + if(src.getSurveyYear()!=null) { + dest.setSurveyYear(src.getSurveyYear()); + } + if(src.getSurveyYearVersion()!=null) { + dest.setSurveyYearVersion(src.getSurveyYearVersion()); + } + if(src.getFoodSurveyType() != null) { + dest.setFoodsurvey(unmarshalFoodSurveyType(src.getFoodSurveyType())); + } + if(src.getWaterSurveyType() !=null) { + dest.setWatersurvey(unmarshalWaterSurveyType(src.getWaterSurveyType())); + } + if(src.getEnergySurveyType() !=null) { + dest.setEnergySurvey(unmarshalEnergySurveyType(src.getEnergySurveyType())); + } + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + private FoodSurvey unmarshalFoodSurveyType(FoodSurveyType src) throws MissingADESchemaException { + FoodSurvey dest = new FoodSurvey(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getFoodCategory()!=null) { + dest.setFoodCategory(helper.getGMLUnmarshaller().unmarshalCode(src.getFoodCategory())); + } + if(src.getFoodConsumption()!=null) { + dest.setFoodConsumption(helper.getGMLUnmarshaller().unmarshalScale(src.getFoodConsumption())); + } + if(src.getFoodDemand()!=null) { + dest.setFoodDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getFoodDemand())); + } + if(src.getFoodProduction()!=null) { + dest.setFoodProduction(helper.getGMLUnmarshaller().unmarshalScale(src.getFoodProduction())); + } + if(src.getFoodProductionEnergyDemand()!=null) { + dest.setFoodProductionEnergyDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getFoodProductionEnergyDemand())); + } + if(src.getFoodProductionWaterDemand()!=null) { + dest.setFoodProductionWaterDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getFoodProductionWaterDemand())); + } + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + private WaterSurvey unmarshalWaterSurveyType(WaterSurveyType src) throws MissingADESchemaException { + WaterSurvey dest = new WaterSurvey(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getDomesticHotWaterDemand()!=null) { + dest.setDomesticHotWaterDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getDomesticHotWaterDemand())); + } + if(src.getDomesticHotWaterEnergyDemand()!=null) { + dest.setDomesticHotWaterEnergyDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getDomesticHotWaterEnergyDemand())); + } + if(src.getDomesticSolidWaste()!=null) { + dest.setDomesticSolidWaste(helper.getGMLUnmarshaller().unmarshalScale(src.getDomesticSolidWaste())); + } + if(src.getDomesticWaterDemand()!=null) { + dest.setDomesticWaterDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getDomesticWaterDemand())); + } + if(src.getDomesticWaterWaste()!=null) { + dest.setDomesticWaterWaste(helper.getGMLUnmarshaller().unmarshalScale(src.getDomesticWaterWaste())); + } + if(src.getTotalDomesticWaste()!=null) { + dest.setTotalDomesticWaste(helper.getGMLUnmarshaller().unmarshalScale(src.getTotalDomesticWaste())); + } + + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + private EnergySurvey unmarshalEnergySurveyType(EnergySurveyType src) throws MissingADESchemaException { + EnergySurvey dest = new EnergySurvey(); + /* + if(src.isSetId()) { + dest.setId(src.getId()); + } + */ + if(src.getBiomassPrimaryEnergyPotential()!=null) { + dest.setBiomassPrimaryEnergyPotential(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassPrimaryEnergyPotential())); + } + if(src.getBiomassToBioethanol()!=null) { + dest.setBiomassToBioethanol(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToBioethanol())); + } + if(src.getBiomassToBiogas()!=null) { + dest.setBiomassToBiogas(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToBiogas())); + } + if(src.getBiomassToElectricityPotential()!=null) { + dest.setBiomassToElectricityPotential(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToElectricityPotential())); + } + if(src.getBiomassToEnergyWoods() != null) { + dest.setBiomassToEnergyWoods(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToEnergyWoods())); + } + if(src.getBiomassToPlantOil()!=null) { + dest.setBiomassToPlantOil(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToPlantOil())); + } + if(src.getBiomassToResidualSolidFuel()!=null) { + dest.setBiomassToResidualSolidFuel(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToResidualSolidFuel())); + } + if(src.getBiomassToSolidFuel()!=null) { + dest.setBiomassToSolidFuel(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToSolidFuel())); + } + if(src.getBiomassToThermalPotential()!=null) { + dest.setBiomassToThermalPotential(helper.getGMLUnmarshaller().unmarshalScale(src.getBiomassToThermalPotential())); + } + if(src.getElectricityPotentialFromPVBuildings()!=null) { + dest.setElectricityPotentialFromPVBuildings(helper.getGMLUnmarshaller().unmarshalScale(src.getElectricityPotentialFromPVBuildings())); + } + if(src.getResidentialElectricityDemand()!=null) { + dest.setResidentialElectricityDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getResidentialElectricityDemand())); + } + if(src.getSpaceCoolingDemand()!=null) { + dest.setSpaceCoolingDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getSpaceCoolingDemand())); + } + if(src.getSpaceCoolingDemand()!=null) { + dest.setSpaceCoolingDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getSpaceCoolingDemand())); + } + if(src.getSpaceCoolingDemand()!=null) { + dest.setSpaceCoolingDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getSpaceCoolingDemand())); + } + if(src.getSpaceCoolingDemand()!=null) { + dest.setSpaceCoolingDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getSpaceCoolingDemand())); + } + if(src.getSpaceHeatingDemand()!=null) { + dest.setSpaceHeatingDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getSpaceHeatingDemand())); + } + if(src.getResidentialElectricityDemand()!=null) { + dest.setResidentialElectricityDemand(helper.getGMLUnmarshaller().unmarshalScale(src.getResidentialElectricityDemand())); + } + + if(src.getVegetationCoverCategory()!=null) { + dest.setVegetationCoverCategory(helper.getGMLUnmarshaller().unmarshalCode(src.getVegetationCoverCategory())); + } + + helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest); + return dest; + } + + @Override + public void setADEUnmarshallerHelper(ADEUnmarshallerHelper helper) { + this.helper = helper; + } + + @Override + public ADEModelObject unmarshal(JAXBElement<?> src) throws MissingADESchemaException { + final Object value = src.getValue(); + + return unmarshal(value); + } + + @Override + public ADEModelObject unmarshal(Object src) throws MissingADESchemaException { + return typeMapper.apply(src); + } + + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/ConsistsOfFWESurvey.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/ConsistsOfFWESurvey.java new file mode 100644 index 0000000..a5e77f3 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/ConsistsOfFWESurvey.java @@ -0,0 +1,79 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + +import java.util.ArrayList; +import java.util.List; + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.feature.AbstractFeature; + + + +public class ConsistsOfFWESurvey extends AbstractFeature implements ADEModelObject{ + + private static final long serialVersionUID = 5976037320544049731L; + + private List<LandUseSurvey> landUseSurvey; + + public List<LandUseSurvey> getLandUseSurvey() { + if(landUseSurvey == null) { + landUseSurvey = new ArrayList<>(); + } + return landUseSurvey; + } + + public boolean isLandUseSurvey() { + return landUseSurvey != null; + } + public void setLandUseSurvey(List<LandUseSurvey> landUseSurvey) { + this.landUseSurvey = landUseSurvey; + } + + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new ConsistsOfFWESurvey(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/EnergySurvey.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/EnergySurvey.java new file mode 100644 index 0000000..f5a7b5c --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/EnergySurvey.java @@ -0,0 +1,257 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.basicTypes.Code; +import org.citygml4j.model.gml.feature.AbstractFeature; +import org.citygml4j.model.gml.measures.Scale; + + + +public class EnergySurvey extends AbstractFeature implements ADEModelObject{ + + private static final long serialVersionUID = -7095068766106216686L; + private Scale spaceHeatingDemand; + private Scale spaceCoolingDemand; + private Scale residentialElectricityDemand; + private Scale electricityPotentialFromPVBuildings; + private Scale biomassPrimaryEnergyPotential; + private Scale biomassToEnergyWoods; + private Scale biomassToBiogas; + private Scale biomassToPlantOil; + private Scale biomassToBioethanol; + private Scale biomassToResidualSolidFuel; + private Scale biomassToSolidFuel; + private Scale biomassToElectricityPotential; + private Scale biomassToThermalPotential; + private Code vegetationCoverCategory; + + + public Scale getSpaceHeatingDemand() { + return spaceHeatingDemand; + } + + + public boolean isSpaceHeatingDemand() { + return spaceHeatingDemand != null; + } + + public void setSpaceHeatingDemand(Scale spaceHeatingDemand) { + this.spaceHeatingDemand = spaceHeatingDemand; + } + + public Scale getSpaceCoolingDemand() { + return spaceCoolingDemand; + } + + + public boolean isSpaceCoolingDemand() { + return spaceCoolingDemand!=null; + } + + public void setSpaceCoolingDemand(Scale spaceCoolingDemand) { + this.spaceCoolingDemand = spaceCoolingDemand; + } + + public Scale getResidentialElectricityDemand() { + return residentialElectricityDemand; + } + + public boolean isResidentialElectricityDemand() { + return residentialElectricityDemand != null; + } + + public void setResidentialElectricityDemand(Scale residentialElectricityDemand) { + this.residentialElectricityDemand = residentialElectricityDemand; + } + + public Scale getElectricityPotentialFromPVBuildings() { + return electricityPotentialFromPVBuildings; + } + + + public boolean isElectricityPotentialFromPVBuildings() { + return electricityPotentialFromPVBuildings!=null; + } + + public void setElectricityPotentialFromPVBuildings(Scale electricityPotentialFromPVBuildings) { + this.electricityPotentialFromPVBuildings = electricityPotentialFromPVBuildings; + } + + public Code getVegetationCoverCategory() { + return vegetationCoverCategory; + } + + + public boolean isVegetationCoverCategory() { + return vegetationCoverCategory != null; + } + + public void setVegetationCoverCategory(Code vegetationCoverCategory) { + this.vegetationCoverCategory = vegetationCoverCategory; + } + + public Scale getBiomassPrimaryEnergyPotential() { + return biomassPrimaryEnergyPotential; + } + + public boolean isBiomassPrimaryEnergyPotential() { + return biomassPrimaryEnergyPotential != null; + } + + public void setBiomassPrimaryEnergyPotential(Scale biomassPrimaryEnergyPotential) { + this.biomassPrimaryEnergyPotential = biomassPrimaryEnergyPotential; + } + + public Scale getBiomassToEnergyWoods() { + return biomassToEnergyWoods; + } + + + public boolean isBiomassToEnergyWoods() { + return biomassToEnergyWoods !=null; + } + + public void setBiomassToEnergyWoods(Scale biomassToEnergyWoods) { + this.biomassToEnergyWoods = biomassToEnergyWoods; + } + + public Scale getBiomassToBiogas() { + return biomassToBiogas; + } + + + public boolean isBiomassToBiogas() { + return biomassToBiogas != null; + } + + public void setBiomassToBiogas(Scale biomassToBiogas) { + this.biomassToBiogas = biomassToBiogas; + } + + public Scale getBiomassToPlantOil() { + return biomassToPlantOil; + } + + + public boolean isBiomassToPlantOil() { + return biomassToPlantOil != null; + } + + + public void setBiomassToPlantOil(Scale biomassToPlantOil) { + this.biomassToPlantOil = biomassToPlantOil; + } + + public Scale getBiomassToBioethanol() { + return biomassToBioethanol; + } + + + public boolean isBiomassToBioethanol() { + return biomassToBioethanol != null; + } + + public void setBiomassToBioethanol(Scale biomassToBioethanol) { + this.biomassToBioethanol = biomassToBioethanol; + } + + public Scale getBiomassToResidualSolidFuel() { + return biomassToResidualSolidFuel; + } + + + public boolean isBiomassToResidualSolidFuel() { + return biomassToResidualSolidFuel!=null; + } + + public void setBiomassToResidualSolidFuel(Scale biomassToResidualSolidFuel) { + this.biomassToResidualSolidFuel = biomassToResidualSolidFuel; + } + + public Scale getBiomassToSolidFuel() { + return biomassToSolidFuel; + } + + + public boolean isBiomassToSolidFuel() { + return biomassToSolidFuel !=null; + } + + public void setBiomassToSolidFuel(Scale biomassToSolidFuel) { + this.biomassToSolidFuel = biomassToSolidFuel; + } + + public Scale getBiomassToElectricityPotential() { + return biomassToElectricityPotential; + } + + + public boolean isBiomassToElectricityPotential() { + return biomassToElectricityPotential !=null; + } + + public void setBiomassToElectricityPotential(Scale biomassToElectricityPotential) { + this.biomassToElectricityPotential = biomassToElectricityPotential; + } + + public Scale getBiomassToThermalPotential() { + return biomassToThermalPotential; + } + + + public boolean isBiomassToThermalPotential() { + return biomassToThermalPotential != null; + } + + public void setBiomassToThermalPotential(Scale biomassToThermalPotential) { + this.biomassToThermalPotential = biomassToThermalPotential; + } + + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new EnergySurvey(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodSurvey.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodSurvey.java new file mode 100644 index 0000000..b89a030 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodSurvey.java @@ -0,0 +1,128 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.basicTypes.Code; +import org.citygml4j.model.gml.feature.AbstractFeature; +import org.citygml4j.model.gml.measures.Scale; + + +public class FoodSurvey extends AbstractFeature implements ADEModelObject{ + + + private static final long serialVersionUID = 6757445678768677685L; + + private Code foodCategory; + private Scale foodDemand; + private Scale foodProduction; + private Scale foodProductionWaterDemand; + private Scale foodProductionEnergyDemand; + private Scale foodConsumption; + + + + + public Code getFoodCategory() { + return foodCategory; + } + public boolean isFoodCategory() { + return foodCategory != null; + } + public void setFoodCategory(Code foodCategory) { + this.foodCategory = foodCategory; + } + + public Scale getFoodDemand() { + return foodDemand; + } + + + public boolean isFoodDemand() { + return foodDemand!=null; + } + public void setFoodDemand(Scale foodDemand) { + this.foodDemand = foodDemand; + } + public Scale getFoodProduction() { + return foodProduction; + } + public boolean isFoodProduction() { + return foodProduction != null; + } + public void setFoodProduction(Scale foodProduction) { + this.foodProduction = foodProduction; + } + public Scale getFoodProductionWaterDemand() { + return foodProductionWaterDemand; + } + public boolean isFoodProductionWaterDemand() { + return foodProductionWaterDemand!=null; + } + public void setFoodProductionWaterDemand(Scale foodProductionWaterDemand) { + this.foodProductionWaterDemand = foodProductionWaterDemand; + } + public Scale getFoodProductionEnergyDemand() { + return foodProductionEnergyDemand; + } + public boolean isFoodProductionEnergyDemand() { + return foodProductionEnergyDemand!=null; + } + public void setFoodProductionEnergyDemand(Scale foodProductionEnergyDemand) { + this.foodProductionEnergyDemand = foodProductionEnergyDemand; + } + public Scale getFoodConsumption() { + return foodConsumption; + } + public boolean isFoodConsumption() { + return foodConsumption!=null; + } + public void setFoodConsumption(Scale foodConsumption) { + this.foodConsumption = foodConsumption; + } + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new FoodSurvey(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodWaterEnergy.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodWaterEnergy.java new file mode 100644 index 0000000..781a8ad --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/FoodWaterEnergy.java @@ -0,0 +1,94 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.feature.AbstractFeature; + +public class FoodWaterEnergy extends AbstractFeature implements ADEModelObject { + + private static final long serialVersionUID = -3892787504021716683L; + private String areaName; + private String systemName; + private ConsistsOfFWESurvey consistsOfFWESurvey; + + public String getAreaName() { + return areaName; + } + + public boolean isAreaName() { + return areaName!=null; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getSystemName() { + return systemName; + } + + public boolean isSystemName() { + return systemName != null; + } + + public void setSystemName(String systemName) { + this.systemName = systemName; + } + + public ConsistsOfFWESurvey getConsistsOfFWESurvey() { + return consistsOfFWESurvey; + } + + public boolean isConsistsOfFWESurvey() { + return consistsOfFWESurvey!=null; + } + public void setConsistsOfFWESurvey(ConsistsOfFWESurvey consistsOfFWESurvey) { + this.consistsOfFWESurvey = consistsOfFWESurvey; + } + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new FoodWaterEnergy(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/LandUseSurvey.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/LandUseSurvey.java new file mode 100644 index 0000000..cf64d67 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/LandUseSurvey.java @@ -0,0 +1,176 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.feature.AbstractFeature; +import org.citygml4j.model.gml.measures.Area; + + +public class LandUseSurvey extends AbstractFeature implements ADEModelObject { + + private static final long serialVersionUID = -3539870873714199259L; + private Area buildingFootprintArea; + private Integer population; + private Integer surveyYear; + private Double surveyYearVersion; + private String surveyDescription; + private Area surfaceArea; + private FoodSurvey foodsurvey; + private WaterSurvey watersurvey; + private EnergySurvey energySurvey; + + + public Area getBuildingFootprintArea() { + return buildingFootprintArea; + } + + public boolean isBuildingFootprintArea() { + return buildingFootprintArea != null; + } + public void setBuildingFootprintArea(Area buildingFootprintArea) { + this.buildingFootprintArea = buildingFootprintArea; + } + public Integer getPopulation() { + return population; + } + + public boolean isPopulation() { + return population!=null; + } + public void setPopulation(Integer population) { + this.population = population; + } + public Integer getSurveyYear() { + return surveyYear; + } + public boolean isSurveyYear() { + return surveyYear!= null; + } + public void setSurveyYear(Integer surveyYear) { + this.surveyYear = surveyYear; + } + public Double getSurveyYearVersion() { + return surveyYearVersion; + } + public boolean isSurveyYearVersion() { + return surveyYearVersion != null; + } + public void setSurveyYearVersion(Double surveyYearVersion) { + this.surveyYearVersion = surveyYearVersion; + } + public String getSurveyDescription() { + return surveyDescription; + } + public boolean isSurveyDescription() { + return surveyDescription != null; + } + public void setSurveyDescription(String surveyDescription) { + this.surveyDescription = surveyDescription; + } + public Area getSurfaceArea() { + return surfaceArea; + } + public boolean isSurfaceArea() { + return surfaceArea != null; + } + public void setSurfaceArea(Area surfaceArea) { + this.surfaceArea = surfaceArea; + } + + + public FoodSurvey getFoodsurvey() { + return foodsurvey; + } + + public boolean isFoodsurvey() { + return foodsurvey!=null; + } + + public void setFoodsurvey(FoodSurvey foodsurvey) { + this.foodsurvey = foodsurvey; + } + + + + public WaterSurvey getWatersurvey() { + return watersurvey; + } + + public boolean isWatersurvey() { + return watersurvey!=null; + } + + public void setWatersurvey(WaterSurvey watersurvey) { + this.watersurvey = watersurvey; + } + + public EnergySurvey getEnergySurvey() { + return energySurvey; + } + + public boolean isEnergySurvey() { + return energySurvey != null; + } + + public void setEnergySurvey(EnergySurvey energySurvey) { + this.energySurvey = energySurvey; + } + + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new LandUseSurvey(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + + + + /* + private List<FoodSurveyType> foodSurvey; + private List<WaterSurveyType> waterSurvey; + private List<EnergySurveyType> energySurvey; + */ + + + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/WaterSurvey.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/WaterSurvey.java new file mode 100644 index 0000000..cb9f56d --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/WaterSurvey.java @@ -0,0 +1,144 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model; + + +import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.model.citygml.ade.binding.ADEModelObject; +import org.citygml4j.model.common.visitor.FeatureFunctor; +import org.citygml4j.model.common.visitor.FeatureVisitor; +import org.citygml4j.model.common.visitor.GMLFunctor; +import org.citygml4j.model.common.visitor.GMLVisitor; +import org.citygml4j.model.gml.feature.AbstractFeature; +import org.citygml4j.model.gml.measures.Scale; + + + +public class WaterSurvey extends AbstractFeature implements ADEModelObject { + + + private static final long serialVersionUID = 1712280908279134012L; + + private Scale domesticWaterDemand; + private Scale domesticHotWaterDemand; + private Scale domesticHotWaterEnergyDemand; + private Scale domesticWaterWaste; + private Scale domesticSolidWaste; + private Scale totalDomesticWaste; + + + + public Scale getDomesticWaterDemand() { + return domesticWaterDemand; + } + public boolean isDomesticWaterDemand() { + return domesticWaterDemand != null; + } + + public void setDomesticWaterDemand(Scale domesticWaterDemand) { + this.domesticWaterDemand = domesticWaterDemand; + } + + public Scale getDomesticHotWaterDemand() { + return domesticHotWaterDemand; + } + + public boolean isDomesticHotWaterDemand() { + return domesticHotWaterDemand != null; + } + + public void setDomesticHotWaterDemand(Scale domesticHotWaterDemand) { + this.domesticHotWaterDemand = domesticHotWaterDemand; + } + + public Scale getDomesticHotWaterEnergyDemand() { + return domesticHotWaterEnergyDemand; + } + + + public boolean isDomesticHotWaterEnergyDemand() { + return domesticHotWaterEnergyDemand != null; + } + + public void setDomesticHotWaterEnergyDemand(Scale domesticHotWaterEnergyDemand) { + this.domesticHotWaterEnergyDemand = domesticHotWaterEnergyDemand; + } + + public Scale getDomesticWaterWaste() { + return domesticWaterWaste; + } + + + public boolean isDomesticWaterWaste() { + return domesticWaterWaste !=null; + } + + public void setDomesticWaterWaste(Scale domesticWaterWaste) { + this.domesticWaterWaste = domesticWaterWaste; + } + + public Scale getDomesticSolidWaste() { + return domesticSolidWaste; + } + + public boolean isDomesticSolidWaste() { + return domesticSolidWaste!=null; + } + + public void setDomesticSolidWaste(Scale domesticSolidWaste) { + this.domesticSolidWaste = domesticSolidWaste; + } + + public Scale getTotalDomesticWaste() { + return totalDomesticWaste; + } + + public boolean isTotalDomesticWaste() { + return totalDomesticWaste!=null; + } + + public void setTotalDomesticWaste(Scale totalDomesticWaste) { + this.totalDomesticWaste = totalDomesticWaste; + } + + @Override + public Object copy(CopyBuilder copyBuilder) { + return copyTo(new WaterSurvey(),copyBuilder); + } + + @Override + public void accept(FeatureVisitor visitor) { + visitor.visit((ADEModelObject)this); + } + + @Override + public <T> T accept(FeatureFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + @Override + public void accept(GMLVisitor visitor) { + visitor.visit((ADEModelObject)this); + + } + + @Override + public <T> T accept(GMLFunctor<T> visitor) { + return visitor.apply((ADEModelObject)this); + } + + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ConsistsOfFWESurveyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ConsistsOfFWESurveyType.java new file mode 100644 index 0000000..d49c5f0 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ConsistsOfFWESurveyType.java @@ -0,0 +1,49 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import net.opengis.gml.AbstractFeatureType; + + +@XmlType(name = "consistsOfFWESurvey") +@XmlAccessorType(XmlAccessType.FIELD) +public class ConsistsOfFWESurveyType extends AbstractFeatureType { + + //@XmlElementWrapper(name = "LandUseSurveys") + @XmlElement(name = "landUseSurvey") + private List<LandUseSurveyType> landUseSurveyType; + + public List<LandUseSurveyType> getLandUseSurveyType() { + if(landUseSurveyType == null) { + landUseSurveyType = new ArrayList<>(); + } + return landUseSurveyType; + } + + + public void setLandUseSurveyType(List<LandUseSurveyType> landUseSurveyType) { + this.landUseSurveyType = landUseSurveyType; + } + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/EnergySurveyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/EnergySurveyType.java new file mode 100644 index 0000000..3ce456b --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/EnergySurveyType.java @@ -0,0 +1,143 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import net.opengis.gml.AbstractFeatureType; +import net.opengis.gml.CodeType; +import net.opengis.gml.ScaleType; + +@XmlType(name = "EnergySurvey") +public class EnergySurveyType extends AbstractFeatureType { + + + @XmlElement(name = "spaceHeatingDemand") + private ScaleType spaceHeatingDemand; + @XmlElement(name = "spaceCoolingDemand") + private ScaleType spaceCoolingDemand; + @XmlElement(name = "residentialElectricityDemand") + private ScaleType residentialElectricityDemand; + @XmlElement(name = "electricityPotentialFromPVBuildings") + private ScaleType electricityPotentialFromPVBuildings; + @XmlElement(name = "vegetationCoverCategory") + private CodeType vegetationCoverCategory; + @XmlElement(name = "biomassPrimaryEnergyPotential") + private ScaleType biomassPrimaryEnergyPotential; + @XmlElement(name = "biomassToEnergyWoods") + private ScaleType biomassToEnergyWoods; + @XmlElement(name = "biomassToBiogas") + private ScaleType biomassToBiogas; + @XmlElement(name = "biomassToPlantOil") + private ScaleType biomassToPlantOil; + @XmlElement(name = "biomassToBioethanol") + private ScaleType biomassToBioethanol; + @XmlElement(name = "biomassToResidualSolidFuel") + private ScaleType biomassToResidualSolidFuel; + @XmlElement(name = "biomassToSolidFuel") + private ScaleType biomassToSolidFuel; + @XmlElement(name = "biomassToElectricityPotential") + private ScaleType biomassToElectricityPotential; + @XmlElement(name = "biomassToThermalPotential") + private ScaleType biomassToThermalPotential; + + public ScaleType getSpaceHeatingDemand() { + return spaceHeatingDemand; + } + public void setSpaceHeatingDemand(ScaleType spaceHeatingDemand) { + this.spaceHeatingDemand = spaceHeatingDemand; + } + public ScaleType getSpaceCoolingDemand() { + return spaceCoolingDemand; + } + + public void setSpaceCoolingDemand(ScaleType spaceCoolingDemand) { + this.spaceCoolingDemand = spaceCoolingDemand; + } + public ScaleType getResidentialElectricityDemand() { + return residentialElectricityDemand; + } + public void setResidentialElectricityDemand(ScaleType residentialElectricityDemand) { + this.residentialElectricityDemand = residentialElectricityDemand; + } + public ScaleType getElectricityPotentialFromPVBuildings() { + return electricityPotentialFromPVBuildings; + } + public void setElectricityPotentialFromPVBuildings(ScaleType electricityPotentialFromPVBuildings) { + this.electricityPotentialFromPVBuildings = electricityPotentialFromPVBuildings; + } + public CodeType getVegetationCoverCategory() { + return vegetationCoverCategory; + } + public void setVegetationCoverCategory(CodeType vegetationCoverCategory) { + this.vegetationCoverCategory = vegetationCoverCategory; + } + public ScaleType getBiomassPrimaryEnergyPotential() { + return biomassPrimaryEnergyPotential; + } + public void setBiomassPrimaryEnergyPotential(ScaleType biomassPrimaryEnergyPotential) { + this.biomassPrimaryEnergyPotential = biomassPrimaryEnergyPotential; + } + public ScaleType getBiomassToEnergyWoods() { + return biomassToEnergyWoods; + } + public void setBiomassToEnergyWoods(ScaleType biomassToEnergyWoods) { + this.biomassToEnergyWoods = biomassToEnergyWoods; + } + public ScaleType getBiomassToBiogas() { + return biomassToBiogas; + } + public void setBiomassToBiogas(ScaleType biomassToBiogas) { + this.biomassToBiogas = biomassToBiogas; + } + public ScaleType getBiomassToPlantOil() { + return biomassToPlantOil; + } + public void setBiomassToPlantOil(ScaleType biomassToPlantOil) { + this.biomassToPlantOil = biomassToPlantOil; + } + public ScaleType getBiomassToBioethanol() { + return biomassToBioethanol; + } + public void setBiomassToBioethanol(ScaleType biomassToBioethanol) { + this.biomassToBioethanol = biomassToBioethanol; + } + public ScaleType getBiomassToResidualSolidFuel() { + return biomassToResidualSolidFuel; + } + public void setBiomassToResidualSolidFuel(ScaleType biomassToResidualSolidFuel) { + this.biomassToResidualSolidFuel = biomassToResidualSolidFuel; + } + public ScaleType getBiomassToSolidFuel() { + return biomassToSolidFuel; + } + public void setBiomassToSolidFuel(ScaleType biomassToSolidFuel) { + this.biomassToSolidFuel = biomassToSolidFuel; + } + public ScaleType getBiomassToElectricityPotential() { + return biomassToElectricityPotential; + } + public void setBiomassToElectricityPotential(ScaleType biomassToElectricityPotential) { + this.biomassToElectricityPotential = biomassToElectricityPotential; + } + public ScaleType getBiomassToThermalPotential() { + return biomassToThermalPotential; + } + public void setBiomassToThermalPotential(ScaleType biomassToThermalPotential) { + this.biomassToThermalPotential = biomassToThermalPotential; + } +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodSurveyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodSurveyType.java new file mode 100644 index 0000000..82e27c6 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodSurveyType.java @@ -0,0 +1,86 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import net.opengis.gml.AbstractFeatureType; +import net.opengis.gml.CodeType; +import net.opengis.gml.ScaleType; + +@XmlType(name = "FoodSurvey") +public class FoodSurveyType extends AbstractFeatureType { + + + @XmlElement(name = "foodCategory") + private CodeType foodCategory; + @XmlElement(name = "foodDemand") + private ScaleType foodDemand; + @XmlElement(name = "foodProduction") + private ScaleType foodProduction; + @XmlElement(name = "foodProductionWaterDemand") + private ScaleType foodProductionWaterDemand; + @XmlElement(name = "foodProductionEnergyDemand") + private ScaleType foodProductionEnergyDemand; + @XmlElement(name = "foodConsumption") + private ScaleType foodConsumption; + + public CodeType getFoodCategory() { + return foodCategory; + } + public void setFoodCategory(CodeType foodCategory) { + this.foodCategory = foodCategory; + } + public ScaleType getFoodDemand() { + return foodDemand; + } + public void setFoodDemand(ScaleType foodDemand) { + this.foodDemand = foodDemand; + } + + public ScaleType getFoodProduction() { + return foodProduction; + } + public void setFoodProduction(ScaleType foodProduction) { + this.foodProduction = foodProduction; + } + + public ScaleType getFoodProductionWaterDemand() { + return foodProductionWaterDemand; + } + public void setFoodProductionWaterDemand(ScaleType foodProductionWaterDemand) { + this.foodProductionWaterDemand = foodProductionWaterDemand; + } + + public ScaleType getFoodProductionEnergyDemand() { + return foodProductionEnergyDemand; + } + public void setFoodProductionEnergyDemand(ScaleType foodProductionEnergyDemand) { + this.foodProductionEnergyDemand = foodProductionEnergyDemand; + } + + public ScaleType getFoodConsumption() { + return foodConsumption; + } + public void setFoodConsumption(ScaleType foodConsumption) { + this.foodConsumption = foodConsumption; + } + + + + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodWaterEnergyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodWaterEnergyType.java new file mode 100644 index 0000000..6966312 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/FoodWaterEnergyType.java @@ -0,0 +1,58 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import net.opengis.gml.AbstractFeatureType; + + +@XmlType(name = "FoodWaterEnergy") +public class FoodWaterEnergyType extends AbstractFeatureType { + @XmlElement(name = "fweAreaName") + private String areaName; + + @XmlElement(name = "fweSystemName") + private String systemName; + + @XmlElement(name = "consistsOfFWESurvey") + private ConsistsOfFWESurveyType consistsOfFWESurveyType; + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getSystemName() { + return systemName; + } + + public void setSystemName(String systemName) { + this.systemName = systemName; + } + + public ConsistsOfFWESurveyType getConsistsOfFWESurveyType() { + return consistsOfFWESurveyType; + } + + public void setConsistsOfFWESurveyType(ConsistsOfFWESurveyType consistsOfFWESurveyType) { + this.consistsOfFWESurveyType = consistsOfFWESurveyType; + } +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/LandUseSurveyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/LandUseSurveyType.java new file mode 100644 index 0000000..236dcbf --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/LandUseSurveyType.java @@ -0,0 +1,102 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import net.opengis.gml.AbstractFeatureType; +import net.opengis.gml.AreaType; + + +@XmlType(name = "LandUseSurvey") +public class LandUseSurveyType extends AbstractFeatureType { + @XmlElement(name = "buildingFootprintArea") + private AreaType buildingFootprintArea; + @XmlElement(name = "population") + private Integer population; + @XmlElement(name = "surveyYear") + private Integer surveyYear; + @XmlElement(name = "surveyYearVersion") + private Double surveyYearVersion; + @XmlElement(name = "surveyDescription") + private String surveyDescription; + @XmlElement(name = "surfaceArea") + private AreaType surfaceArea; + @XmlElement(name = "foodSurvey") + private FoodSurveyType foodSurveyType; + @XmlElement(name = "waterSurvey") + private WaterSurveyType waterSurveyType; + @XmlElement(name = "energySurvey") + private EnergySurveyType energySurveyType; + + + public AreaType getBuildingFootprintArea() { + return buildingFootprintArea; + } + public void setBuildingFootprintArea(AreaType buildingFootprintArea) { + this.buildingFootprintArea = buildingFootprintArea; + } + public Integer getPopulation() { + return population; + } + public void setPopulation(Integer population) { + this.population = population; + } + public Integer getSurveyYear() { + return surveyYear; + } + public void setSurveyYear(Integer surveyYear) { + this.surveyYear = surveyYear; + } + public Double getSurveyYearVersion() { + return surveyYearVersion; + } + public void setSurveyYearVersion(Double surveyYearVersion) { + this.surveyYearVersion = surveyYearVersion; + } + public String getSurveyDescription() { + return surveyDescription; + } + public void setSurveyDescription(String surveyDescription) { + this.surveyDescription = surveyDescription; + } + public AreaType getSurfaceArea() { + return surfaceArea; + } + public void setSurfaceArea(AreaType surfaceArea) { + this.surfaceArea = surfaceArea; + } + public FoodSurveyType getFoodSurveyType() { + return foodSurveyType; + } + public void setFoodSurveyType(FoodSurveyType foodSurveyType) { + this.foodSurveyType = foodSurveyType; + } + public WaterSurveyType getWaterSurveyType() { + return waterSurveyType; + } + public void setWaterSurveyType(WaterSurveyType waterSurveyType) { + this.waterSurveyType = waterSurveyType; + } + public EnergySurveyType getEnergySurveyType() { + return energySurveyType; + } + public void setEnergySurveyType(EnergySurveyType energySurveyType) { + this.energySurveyType = energySurveyType; + } + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ObjectFactory.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ObjectFactory.java new file mode 100644 index 0000000..e970303 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/ObjectFactory.java @@ -0,0 +1,90 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.module.FoodWaterEnergyLandUseADEModule; + + +@XmlRegistry +public class ObjectFactory { + + private static final QName FOODWATERENERGY_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "foodwaterenergy"); + private static final QName CONSISTSOFFWESURVEY_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "consistsOfFWESurvey"); + private static final QName LandUseSurvey_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "LandUseSurvey"); + private static final QName FoodSurvey_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "FoodSurvey"); + private static final QName WaterSurvey_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "WaterSurvey"); + private static final QName EnergySurvey_QNAME = new QName(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, "EnergySurvey"); + + public FoodWaterEnergyType createFoodWaterEnergyType() { + return new FoodWaterEnergyType(); + } + public ConsistsOfFWESurveyType createConsistsOfFWESurveyType() { + return new ConsistsOfFWESurveyType(); + } + + public LandUseSurveyType createLandUseSurveyType() { + return new LandUseSurveyType(); + } + + public FoodSurveyType createFoodSurveyType() { + return new FoodSurveyType(); + } + + public WaterSurveyType createWaterSurveyType() { + return new WaterSurveyType(); + } + + public EnergySurveyType createEnergySurveyType() { + return new EnergySurveyType(); + } + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "foodwaterenergy", substitutionHeadNamespace = "http://www.opengis.net/citygml/landuse/2.0", substitutionHeadName = "_GenericApplicationPropertyOfLandUse") + public JAXBElement<FoodWaterEnergyType> createFoodWaterEnergyType(FoodWaterEnergyType type) { + return new JAXBElement<>(FOODWATERENERGY_QNAME, FoodWaterEnergyType.class, type); + } + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "consistsOfFWESurvey" ,substitutionHeadNamespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", substitutionHeadName = "foodwaterenergy") + public JAXBElement<ConsistsOfFWESurveyType> createFConsistsOfFWESurveyType(ConsistsOfFWESurveyType type) { + return new JAXBElement<>(CONSISTSOFFWESURVEY_QNAME, ConsistsOfFWESurveyType.class, type); + } + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "LandUseSurvey" ,substitutionHeadNamespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", substitutionHeadName = "consistsOfFWESurvey") + public JAXBElement<LandUseSurveyType> createLandUseSurveyType(LandUseSurveyType type) { + return new JAXBElement<>(LandUseSurvey_QNAME, LandUseSurveyType.class, type); + } + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "FoodSurvey", substitutionHeadNamespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", substitutionHeadName = "LandUseSurvey") + public JAXBElement<FoodSurveyType> createFoodSurveyType(FoodSurveyType type) { + return new JAXBElement<>(FoodSurvey_QNAME, FoodSurveyType.class, type); + } + + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "WaterSurvey",substitutionHeadNamespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", substitutionHeadName = "LandUseSurvey") + public JAXBElement<WaterSurveyType> createWaterSurveyType(WaterSurveyType type) { + return new JAXBElement<>(WaterSurvey_QNAME, WaterSurveyType.class, type); + } + + + @XmlElementDecl(namespace = FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, name = "EnergySurvey",substitutionHeadNamespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", substitutionHeadName = "LandUseSurvey") + public JAXBElement<EnergySurveyType> createEnergySurveyType(EnergySurveyType type) { + return new JAXBElement<>(EnergySurvey_QNAME, EnergySurveyType.class, type); + } +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/WaterSurveyType.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/WaterSurveyType.java new file mode 100644 index 0000000..3bea38a --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/WaterSurveyType.java @@ -0,0 +1,78 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import net.opengis.gml.AbstractFeatureType; +import net.opengis.gml.ScaleType; + +@XmlType(name = "WaterSurvey") +public class WaterSurveyType extends AbstractFeatureType { + + @XmlElement(name = "domesticWaterDemand") + private ScaleType domesticWaterDemand; + @XmlElement(name = "domesticHotWaterDemand") + private ScaleType domesticHotWaterDemand; + @XmlElement(name = "domesticHotWaterEnergyDemand") + private ScaleType domesticHotWaterEnergyDemand; + @XmlElement(name = "domesticWaterWaste") + private ScaleType domesticWaterWaste; + @XmlElement(name = "domesticSolidWaste") + private ScaleType domesticSolidWaste; + @XmlElement(name = "totalDomesticWaste") + private ScaleType totalDomesticWaste; + + + public ScaleType getDomesticWaterDemand() { + return domesticWaterDemand; + } + public void setDomesticWaterDemand(ScaleType domesticWaterDemand) { + this.domesticWaterDemand = domesticWaterDemand; + } + public ScaleType getDomesticHotWaterDemand() { + return domesticHotWaterDemand; + } + public void setDomesticHotWaterDemand(ScaleType domesticHotWaterDemand) { + this.domesticHotWaterDemand = domesticHotWaterDemand; + } + public ScaleType getDomesticHotWaterEnergyDemand() { + return domesticHotWaterEnergyDemand; + } + public void setDomesticHotWaterEnergyDemand(ScaleType domesticHotWaterEnergyDemand) { + this.domesticHotWaterEnergyDemand = domesticHotWaterEnergyDemand; + } + public ScaleType getDomesticWaterWaste() { + return domesticWaterWaste; + } + public void setDomesticWaterWaste(ScaleType domesticWaterWaste) { + this.domesticWaterWaste = domesticWaterWaste; + } + public ScaleType getDomesticSolidWaste() { + return domesticSolidWaste; + } + public void setDomesticSolidWaste(ScaleType domesticSolidWaste) { + this.domesticSolidWaste = domesticSolidWaste; + } + public ScaleType getTotalDomesticWaste() { + return totalDomesticWaste; + } + public void setTotalDomesticWaste(ScaleType totalDomesticWaste) { + this.totalDomesticWaste = totalDomesticWaste; + } + +} diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/package-info.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/package-info.java new file mode 100644 index 0000000..d495c08 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/landuse/model/xsd/package-info.java @@ -0,0 +1,18 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, xmlns = { + @javax.xml.bind.annotation.XmlNs(namespaceURI = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD", prefix = "fwel") }) +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd; diff --git a/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/module/FoodWaterEnergyLandUseADEModule.java b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/module/FoodWaterEnergyLandUseADEModule.java new file mode 100644 index 0000000..34b2f87 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/module/FoodWaterEnergyLandUseADEModule.java @@ -0,0 +1,95 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j.module; + + + +import org.citygml4j.model.gml.feature.AbstractFeature; +import org.citygml4j.model.module.ade.ADEModule; +import org.citygml4j.model.module.citygml.CityGMLVersion; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.FoodWaterEnergyLandUseADEContext; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodWaterEnergy; + +import javax.xml.namespace.QName; +import java.net.URL; +import java.util.*; +import java.util.Map.Entry; + +public class FoodWaterEnergyLandUseADEModule extends ADEModule { + public static final String NAMESPACE_URI = "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD"; + public static final FoodWaterEnergyLandUseADEModule V0_1 = new FoodWaterEnergyLandUseADEModule(); + + private HashMap<String, Class<? extends AbstractFeature>> features; + private HashSet<String> featureProperties; + + private static final long serialVersionUID = 8208579547274734280L; + + private FoodWaterEnergyLandUseADEModule() { + super(NAMESPACE_URI, "fwel", CityGMLVersion.v2_0_0); + + features = new HashMap<>(); + features.put("FoodWaterEnergy", FoodWaterEnergy.class); + + featureProperties = new HashSet<>(); + } + + @Override + public URL getSchemaResource() { + return FoodWaterEnergyLandUseADEContext.class.getResource("/schema/FWELanduse.xsd"); + } + + @Override + public List<String> getJAXBPackageNames() { + return Collections.singletonList("de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.xsd"); + } + + @Override + public boolean hasFeatureProperty(String name) { + return featureProperties.contains(name); + } + + @Override + public boolean hasFeature(String name) { + return features.containsKey(name); + } + + @Override + public Class<? extends AbstractFeature> getFeatureClass(String name) { + return features.get(name); + } + + @Override + public QName getFeatureName(Class<? extends AbstractFeature> featureClass) { + for (Entry<String, Class<? extends AbstractFeature>> entry : features.entrySet()) { + if (entry.getValue() == featureClass) + return new QName(getNamespaceURI(), entry.getKey()); + } + + return null; + } + + @Override + public Map<String, Class<? extends AbstractFeature>> getFeatures() { + return new HashMap<>(features); + } + + @Override + public boolean isTopLevelFeature(String name) { + return false; + } + +} diff --git a/foodwaterenergycitygml4j/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext b/foodwaterenergycitygml4j/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext new file mode 100644 index 0000000..f690a01 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext @@ -0,0 +1 @@ +de.hft.stuttgart.ade.foodwaterenergycitygml4j.FoodWaterEnergyLandUseADEContext \ No newline at end of file diff --git a/foodwaterenergycitygml4j/src/main/resources/schema/FWELanduse.xsd b/foodwaterenergycitygml4j/src/main/resources/schema/FWELanduse.xsd new file mode 100644 index 0000000..51a19d4 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/resources/schema/FWELanduse.xsd @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:fwel="http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD" + targetNamespace="http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD" + xmlns:core="http://www.opengis.net/citygml/2.0" + xmlns:bldg="http://www.opengis.net/citygml/building/2.0" + xmlns:luse="http://www.opengis.net/citygml/landuse/2.0" + xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" + version="1.0"> + <import namespace="http://www.opengis.net/citygml/2.0" + schemaLocation="http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd" /> + <import namespace="http://www.opengis.net/citygml/building/2.0" + schemaLocation="http://schemas.opengis.net/citygml/building/2.0/building.xsd" /> + <import namespace="http://www.opengis.net/citygml/landuse/2.0" + schemaLocation="http://schemas.opengis.net/citygml/landuse/2.0/landUse.xsd" /> + <import + namespace="http://www.opengis.net/citygml/appearance/2.0" + schemaLocation="http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd" /> + <import namespace="http://www.opengis.net/citygml/generics/2.0" + schemaLocation="http://schemas.opengis.net/citygml/generics/2.0/generics.xsd" /> + <import namespace="http://www.opengis.net/gml" + schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gmlBase.xsd" /> + + + <element name="foodwaterenergy" type="fwel:foodwaterenergyType" + substitutionGroup="luse:_GenericApplicationPropertyOfLandUse" /> + + <complexType name="foodwaterenergyType"> + <annotation> + <documentation>Data structure of foodwaterenergyType </documentation> + </annotation> + <sequence> + <element name="fweAreaName" minOccurs="0" maxOccurs="1" type="string"/> + <element name="fweSystemName" minOccurs="0" maxOccurs="1" type="string" /> + <element name="consistsOfFWESurvey" minOccurs="0" maxOccurs="1" type="fwel:consistsOffwesurveyType" /> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="consistsOffwesurveyType"> + <annotation> + <documentation>Data structure of consistsOffwesurveyType </documentation> + </annotation> + <sequence> + <element name="landUseSurvey" minOccurs="0" maxOccurs="unbounded" type="fwel:landUseSurveyType"/> + </sequence> + </complexType> + + <complexType name="landUseSurveyType"> + <annotation> + <documentation>Data structure of landUseSurveyType </documentation> + </annotation> + <sequence> + <element name="buildingFootprintArea" maxOccurs="1" type="gml:AreaType"/> + <element name="population" maxOccurs="1" type="int"/> + <element name="surveyYear" maxOccurs="1" type="int"/> + <element name="surveyYearVersion" maxOccurs="1" type="double"/> + <element name="surveyDescription" maxOccurs="1" type="string"/> + <element name="surfaceArea" minOccurs="0" type="gml:AreaType"/> + <element name="foodSurvey" minOccurs="0" maxOccurs="1" type="fwel:foodSurveyType"/> + <element name="waterSurvey" minOccurs="0" maxOccurs="1" type="fwel:waterSurveyType"/> + <element name="energySurvey" minOccurs="0" maxOccurs="1" type="fwel:energySurveyType"/> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="foodSurveyType"> + <annotation> + <documentation>Data structure of foodSurveyType </documentation> + </annotation> + <sequence> + <!-- <element name="animalCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> --> + <element name="foodCategory" minOccurs="0" maxOccurs="1" type="gml:CodeType"/> + <element name="foodDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProduction" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProductionWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProductionEnergyDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodConsumption" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <!-- <element name="vegetalCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="cropCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> --> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="waterSurveyType"> + <annotation> + <documentation>Data structure of waterSurveyType </documentation> + </annotation> + <sequence> + <element name="domesticHotWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticHotWaterEnergyDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticSolidWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticWaterWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="totalDomesticWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <!-- + <element name="irrigationDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="transpirationLoss" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + --> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="energySurveyType"> + <annotation> + <documentation>Data structure of energySurveyType </documentation> + </annotation> + <sequence> + <element name="spaceHeatingDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="spaceCoolingDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="residentialElectricityDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="electricityPotentialFromPVBuildings" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="vegetationCoverCategory" minOccurs="0" maxOccurs="1" type="gml:CodeType"/> + <element name="biomassPrimaryEnergyPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToEnergyWoods" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToBiogas" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToPlantOil" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToBioethanol" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToResidualSolidFuel" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToSolidFuel" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToElectricityPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToThermalPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + </sequence> + <attribute ref="gml:id"/> + </complexType> +</schema> diff --git a/foodwaterenergycitygml4j/src/main/resources/schema/fwelanduseADE.xsd b/foodwaterenergycitygml4j/src/main/resources/schema/fwelanduseADE.xsd new file mode 100644 index 0000000..a42dd67 --- /dev/null +++ b/foodwaterenergycitygml4j/src/main/resources/schema/fwelanduseADE.xsd @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:fwel="http://localhost:8080/3DTiles/ADE/foodwaterenergy/landuse/0.0.1" + targetNamespace="http://localhost:8080/3DTiles/ADE/foodwaterenergy/landuse/0.0.1" + xmlns:core="http://www.opengis.net/citygml/2.0" + xmlns:bldg="http://www.opengis.net/citygml/building/2.0" + xmlns:luse="http://www.opengis.net/citygml/landuse/2.0" + xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" + version="1.0"> + <import namespace="http://www.opengis.net/citygml/2.0" + schemaLocation="http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd" /> + <import namespace="http://www.opengis.net/citygml/building/2.0" + schemaLocation="http://schemas.opengis.net/citygml/building/2.0/building.xsd" /> + <import namespace="http://www.opengis.net/citygml/landuse/2.0" + schemaLocation="http://schemas.opengis.net/citygml/landuse/2.0/landUse.xsd" /> + <import + namespace="http://www.opengis.net/citygml/appearance/2.0" + schemaLocation="http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd" /> + <import namespace="http://www.opengis.net/citygml/generics/2.0" + schemaLocation="http://schemas.opengis.net/citygml/generics/2.0/generics.xsd" /> + <import namespace="http://www.opengis.net/gml" + schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gmlBase.xsd" /> + + + <element name="foodwaterenergy" type="fwel:foodwaterenergyType" + substitutionGroup="luse:_GenericApplicationPropertyOfLandUse" /> + + <complexType name="foodwaterenergyType"> + <annotation> + <documentation>Data structure of foodwaterenergyType </documentation> + </annotation> + <sequence> + <element name="fweAreaName" minOccurs="0" maxOccurs="1" type="string"/> + <element name="fweSystemName" minOccurs="0" maxOccurs="1" type="string" /> + <element name="consistsOfFWESurvey" minOccurs="0" maxOccurs="1" type="fwel:consistsOffwesurveyType" /> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="consistsOffwesurveyType"> + <annotation> + <documentation>Data structure of consistsOffwesurveyType </documentation> + </annotation> + <sequence> + <element name="landUseSurvey" minOccurs="0" maxOccurs="unbounded" type="fwel:landUseSurveyType"/> + </sequence> + </complexType> + + <complexType name="landUseSurveyType"> + <annotation> + <documentation>Data structure of landUseSurveyType </documentation> + </annotation> + <sequence> + <element name="buildingFootprintArea" maxOccurs="1" type="gml:AreaType"/> + <element name="population" maxOccurs="1" type="int"/> + <element name="surveyYear" maxOccurs="1" type="int"/> + <element name="surveyYearVersion" maxOccurs="1" type="double"/> + <element name="surveyDescription" maxOccurs="1" type="string"/> + <element name="surfaceArea" minOccurs="0" type="gml:AreaType"/> + <element name="foodSurvey" minOccurs="0" maxOccurs="1" type="fwel:foodSurveyType"/> + <element name="waterSurvey" minOccurs="0" maxOccurs="1" type="fwel:waterSurveyType"/> + <element name="energySurvey" minOccurs="0" maxOccurs="1" type="fwel:energySurveyType"/> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="foodSurveyType"> + <annotation> + <documentation>Data structure of foodSurveyType </documentation> + </annotation> + <sequence> + <!-- <element name="animalCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> --> + <element name="foodCategory" minOccurs="0" maxOccurs="1" type="gml:CodeType"/> + <element name="foodDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProduction" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProductionWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodProductionEnergyDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="foodConsumption" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <!-- <element name="vegetalCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="cropCalories" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> --> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="waterSurveyType"> + <annotation> + <documentation>Data structure of waterSurveyType </documentation> + </annotation> + <sequence> + <element name="domesticHotWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticHotWaterEnergyDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticSolidWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticWaterDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="domesticWaterWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="totalDomesticWaste" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <!-- + <element name="irrigationDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="transpirationLoss" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + --> + </sequence> + <attribute ref="gml:id"/> + </complexType> + + <complexType name="energySurveyType"> + <annotation> + <documentation>Data structure of energySurveyType </documentation> + </annotation> + <sequence> + <element name="spaceHeatingDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="spaceCoolingDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="residentialElectricityDemand" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="electricityPotentialFromPVBuildings" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="vegetationCoverCategory" minOccurs="0" maxOccurs="1" type="gml:CodeType"/> + <element name="biomassPrimaryEnergyPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToEnergyWoods" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToBiogas" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToPlantOil" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToBioethanol" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToResidualSolidFuel" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToSolidFuel" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToElectricityPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + <element name="biomassToThermalPotential" minOccurs="0" maxOccurs="1" type="gml:ScaleType"/> + </sequence> + <attribute ref="gml:id"/> + </complexType> +</schema> diff --git a/foodwaterenergycitygml4j/src/test/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseTest.java b/foodwaterenergycitygml4j/src/test/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseTest.java new file mode 100644 index 0000000..4579187 --- /dev/null +++ b/foodwaterenergycitygml4j/src/test/java/de/hft/stuttgart/ade/foodwaterenergycitygml4j/FoodWaterEnergyLandUseTest.java @@ -0,0 +1,562 @@ +/*- + * Copyright 2021 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.ade.foodwaterenergycitygml4j; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.ServiceLoader; + +import org.citygml4j.CityGMLContext; +import org.citygml4j.builder.jaxb.CityGMLBuilder; +import org.citygml4j.builder.jaxb.CityGMLBuilderException; +import org.citygml4j.model.citygml.ade.ADEComponent; +import org.citygml4j.model.citygml.ade.ADEException; +import org.citygml4j.model.citygml.ade.binding.ADEContext; +import org.citygml4j.model.citygml.core.AbstractCityObject; +import org.citygml4j.model.citygml.core.CityModel; +import org.citygml4j.model.citygml.core.CityObjectMember; +import org.citygml4j.model.citygml.landuse.LandUse; +import org.citygml4j.model.gml.basicTypes.Code; +import org.citygml4j.model.gml.measures.Area; +import org.citygml4j.model.gml.measures.Scale; +import org.citygml4j.model.module.citygml.CityGMLVersion; +import org.citygml4j.xml.io.CityGMLInputFactory; +import org.citygml4j.xml.io.CityGMLOutputFactory; +import org.citygml4j.xml.io.reader.CityGMLReadException; +import org.citygml4j.xml.io.reader.CityGMLReader; +import org.citygml4j.xml.io.reader.FeatureReadMode; +import org.citygml4j.xml.io.writer.CityGMLWriteException; +import org.citygml4j.xml.io.writer.CityGMLWriter; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.ConsistsOfFWESurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.EnergySurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.FoodWaterEnergy; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.LandUseSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.landuse.model.WaterSurvey; +import de.hft.stuttgart.ade.foodwaterenergycitygml4j.module.FoodWaterEnergyLandUseADEModule; + +class FoodWaterEnergyLandUseTest { + + private String path; + private String location; + + @BeforeEach + void setUp() throws Exception { + location = "src/test/resources/"; + String fileName= "FWELandUseSample.gml"; + path = location+fileName; + } + + private CityModel readCityGml(InputStream input) + throws ADEException, CityGMLBuilderException, CityGMLReadException { + CityGMLContext context = CityGMLContext.getInstance(); + //register ADE module + //context.registerADEContext(new FoodWaterEnergyADEContext()); + List<ADEContext> adeContexts = context.getADEContexts(); + if (adeContexts.isEmpty()) { + for (ADEContext adeContext : ServiceLoader.load(ADEContext.class)) { + context.registerADEContext(adeContext); + } + } + CityGMLBuilder builder = context.createCityGMLBuilder(); + CityGMLInputFactory in = builder.createCityGMLInputFactory(); + in.setProperty(CityGMLInputFactory.USE_VALIDATION, true); + in.setProperty(CityGMLInputFactory.FEATURE_READ_MODE, FeatureReadMode.NO_SPLIT); + in.setValidationEventHandler(event -> { + System.out.print( + "[" + event.getLocator().getLineNumber() + "," + event.getLocator().getColumnNumber() + "] "); + System.out.println(event.getMessage()); + throw new IllegalStateException(event.getLinkedException()); + }); + CityModel cityModel; + try (CityGMLReader reader = in.createCityGMLReader("?", input)) { + cityModel = (CityModel) reader.nextFeature(); + } + return cityModel; + } + + + private CityModel readCityGml(File f) + throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + return readCityGml(new FileInputStream(f)); + } + private CityModel readCityGml(String fileName) + throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + return readCityGml(new File(fileName)); + } + + /* + + private CityModel readCityGml(byte[] bytes) throws ADEException, CityGMLBuilderException, CityGMLReadException { + return readCityGml(new ByteArrayInputStream(bytes)); + } + */ + + private byte[] writeCityGml(CityModel model) throws ADEException, CityGMLBuilderException, CityGMLWriteException { + CityGMLContext context = CityGMLContext.getInstance(); + List<ADEContext> adeContexts = context.getADEContexts(); + if (adeContexts == null || adeContexts.isEmpty()) { + for (ADEContext adeContext : ServiceLoader.load(ADEContext.class)) { + context.registerADEContext(adeContext); + } + } + CityGMLBuilder builder = context.createCityGMLBuilder(); + CityGMLOutputFactory outputFactory = builder.createCityGMLOutputFactory(CityGMLVersion.DEFAULT); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (CityGMLWriter writer = outputFactory.createCityGMLWriter(out)) { + writer.setIndentString(" "); + writer.setPrefixes(CityGMLVersion.DEFAULT); + writer.setPrefix("fwel", FoodWaterEnergyLandUseADEModule.NAMESPACE_URI); + writer.setSchemaLocation(FoodWaterEnergyLandUseADEModule.NAMESPACE_URI, + "http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD"); + writer.setSchemaLocations(CityGMLVersion.DEFAULT); + writer.write(model); + return out.toByteArray(); + } + } + + @Test + void testForReadingCityObjectMember() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + assertEquals(1, listCityObjectMember.size()); + } + + + @Test + void testForReadingLandUse() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + assertTrue(abstractCityObject instanceof LandUse); + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + int count = landUse.getGenericApplicationPropertyOfLandUse().size(); + assertEquals(1, count); + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_AreaName() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + assertTrue(foodWaterEnergy.getAreaName().equals("Test_Stuttgart_Ost")); + } + } + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_SystemName() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + assertTrue(foodWaterEnergy.getSystemName().equals("Test_Stuttgart_System")); + } + } + } + + + @Test + void testForReadingLandUseADEFoodWaterEnergy_consistsOfFWEsurvey() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + assertNotNull(foodWaterEnergy.getConsistsOfFWESurvey()); + } + } + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_consistsOfFWEsurvey_landUseSurvey() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + ConsistsOfFWESurvey consistsOfFWESurvey = foodWaterEnergy.getConsistsOfFWESurvey(); + assertEquals(1, consistsOfFWESurvey.getLandUseSurvey().size()); + } + } + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_consistsOfFWEsurvey_landUseSurvey_FoodSurvey() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + ConsistsOfFWESurvey consistsOfFWESurvey = foodWaterEnergy.getConsistsOfFWESurvey(); + for(LandUseSurvey landUseSurvey : consistsOfFWESurvey.getLandUseSurvey()) { + assertEquals(5.0,landUseSurvey.getBuildingFootprintArea().getValue()); + assertTrue(landUseSurvey.getBuildingFootprintArea().getUom().equals("m2")); + assertNotNull(landUseSurvey.getFoodsurvey()); + if(landUseSurvey.getFoodsurvey() !=null) { + FoodSurvey foodSurvey = landUseSurvey.getFoodsurvey(); + assertEquals(12.0,foodSurvey.getFoodConsumption().getValue()); + assertTrue(foodSurvey.getFoodConsumption().getUom().equals("no_idea")); + assertTrue(foodSurvey.getFoodCategory().getValue().equals("no_idea_6")); + assertTrue(foodSurvey.getFoodCategory().getCodeSpace().equals("codeSpace_no_idea")); + assertEquals(122.0,foodSurvey.getFoodDemand().getValue()); + assertTrue(foodSurvey.getFoodDemand().getUom().equals("no_idea_2")); + assertEquals(123.0,foodSurvey.getFoodProduction().getValue()); + assertTrue(foodSurvey.getFoodProduction().getUom().equals("no_idea_3")); + assertEquals(124.0,foodSurvey.getFoodProductionEnergyDemand().getValue()); + assertTrue(foodSurvey.getFoodProductionEnergyDemand().getUom().equals("no_idea_4")); + assertEquals(125.0,foodSurvey.getFoodProductionWaterDemand().getValue()); + assertTrue(foodSurvey.getFoodProductionWaterDemand().getUom().equals("no_idea_5")); + + } + } + } + } + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_consistsOfFWEsurvey_landUseSurvey_WaterSurvey() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + ConsistsOfFWESurvey consistsOfFWESurvey = ((FoodWaterEnergy) component).getConsistsOfFWESurvey(); + for(LandUseSurvey landUseSurvey : consistsOfFWESurvey.getLandUseSurvey()) { + assertEquals(5.0,landUseSurvey.getBuildingFootprintArea().getValue()); + assertTrue(landUseSurvey.getBuildingFootprintArea().getUom().equals("m2")); + assertNotNull(landUseSurvey.getWatersurvey()); + if(landUseSurvey.getWatersurvey() !=null) { + WaterSurvey waterSurvey = landUseSurvey.getWatersurvey(); + assertEquals(30.0,waterSurvey.getDomesticHotWaterDemand().getValue()); + assertTrue(waterSurvey.getDomesticHotWaterDemand().getUom().equals("l")); + assertEquals(31.0,waterSurvey.getDomesticHotWaterEnergyDemand().getValue()); + assertTrue(waterSurvey.getDomesticHotWaterEnergyDemand().getUom().equals("l")); + assertEquals(32.0,waterSurvey.getDomesticSolidWaste().getValue()); + assertTrue(waterSurvey.getDomesticSolidWaste().getUom().equals("l")); + assertEquals(33.0,waterSurvey.getDomesticWaterDemand().getValue()); + assertTrue(waterSurvey.getDomesticWaterDemand().getUom().equals("l")); + assertEquals(34.0,waterSurvey.getDomesticWaterWaste().getValue()); + assertTrue(waterSurvey.getDomesticWaterWaste().getUom().equals("l")); + assertEquals(35.0,waterSurvey.getTotalDomesticWaste().getValue()); + assertTrue(waterSurvey.getTotalDomesticWaste().getUom().equals("l")); + } + } + } + } + } + + @Test + void testForReadingLandUseADEFoodWaterEnergy_consistsOfFWEsurvey_landUseSurvey_EnergySurvey() throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { + CityModel cityModel = readCityGml(path); + List<CityObjectMember> listCityObjectMember = cityModel.getCityObjectMember(); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + ConsistsOfFWESurvey consistsOfFWESurvey = ((FoodWaterEnergy) component).getConsistsOfFWESurvey(); + for(LandUseSurvey landUseSurvey : consistsOfFWESurvey.getLandUseSurvey()) { + assertEquals(5.0,landUseSurvey.getBuildingFootprintArea().getValue()); + assertTrue(landUseSurvey.getBuildingFootprintArea().getUom().equals("m2")); + assertNotNull(landUseSurvey.getEnergySurvey()); + if(landUseSurvey.getEnergySurvey() !=null) { + EnergySurvey energySurvey = landUseSurvey.getEnergySurvey(); + assertEquals(300.0,energySurvey.getSpaceCoolingDemand().getValue()); + assertTrue(energySurvey.getSpaceCoolingDemand().getUom().equals("J")); + assertEquals(301.0,energySurvey.getSpaceHeatingDemand().getValue()); + assertTrue(energySurvey.getSpaceHeatingDemand().getUom().equals("J")); + assertEquals(303.0,energySurvey.getElectricityPotentialFromPVBuildings().getValue()); + assertTrue(energySurvey.getElectricityPotentialFromPVBuildings().getUom().equals("J")); + assertEquals(304.0,energySurvey.getBiomassPrimaryEnergyPotential().getValue()); + assertTrue(energySurvey.getBiomassPrimaryEnergyPotential().getUom().equals("J")); + assertEquals(305.0,energySurvey.getBiomassToBioethanol().getValue()); + assertTrue(energySurvey.getBiomassToBioethanol().getUom().equals("J")); + assertEquals(306.0,energySurvey.getBiomassToBiogas().getValue()); + assertTrue(energySurvey.getBiomassToBiogas().getUom().equals("J")); + assertEquals(307.0,energySurvey.getBiomassToElectricityPotential().getValue()); + assertTrue(energySurvey.getBiomassToElectricityPotential().getUom().equals("J")); + assertEquals(308.0,energySurvey.getBiomassToEnergyWoods().getValue()); + assertTrue(energySurvey.getBiomassToEnergyWoods().getUom().equals("J")); + assertEquals(309.0,energySurvey.getBiomassToPlantOil().getValue()); + assertTrue(energySurvey.getBiomassToPlantOil().getUom().equals("J")); + assertEquals(310.0,energySurvey.getBiomassToResidualSolidFuel().getValue()); + assertTrue(energySurvey.getBiomassToResidualSolidFuel().getUom().equals("J")); + assertEquals(311.0,energySurvey.getBiomassToSolidFuel().getValue()); + assertTrue(energySurvey.getBiomassToSolidFuel().getUom().equals("J")); + assertEquals(312.0,energySurvey.getBiomassToThermalPotential().getValue()); + assertTrue(energySurvey.getBiomassToThermalPotential().getUom().equals("J")); + assertTrue(energySurvey.getVegetationCoverCategory().getCodeSpace().equals("Un_code")); + assertTrue(energySurvey.getVegetationCoverCategory().getValue().equals("ndlep")); + assertEquals(302.0,energySurvey.getResidentialElectricityDemand().getValue()); + assertTrue(energySurvey.getResidentialElectricityDemand().getUom().equals("J")); + + } + } + } + } + } + + @Test + void testForWritingFWELandUse() + throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + + CityModel myCityModel = new CityModel(); + LandUse luse = new LandUse(); + luse.setId("FWEL_DEST007"); + luse.getGenericApplicationPropertyOfLandUse().add(getOrCreateDummyData()); + myCityModel.getCityObjectMember().add(new CityObjectMember(luse)); + + byte[] gml = writeCityGml(myCityModel); + System.out.println(new String(gml)); + + List<CityObjectMember> listCityObjectMember = myCityModel.getCityObjectMember(); + assertEquals(1, listCityObjectMember.size()); + CityObjectMember cityObjectMember = listCityObjectMember.get(0); + AbstractCityObject abstractCityObject = cityObjectMember.getCityObject(); + assertTrue(abstractCityObject instanceof LandUse); + LandUse landUse = (LandUse) abstractCityObject; + for(ADEComponent component : landUse.getGenericApplicationPropertyOfLandUse()) { + if(component instanceof FoodWaterEnergy) { + FoodWaterEnergy foodWaterEnergy = (FoodWaterEnergy) component; + assertTrue(foodWaterEnergy.getAreaName().equals("Test_Stuttgart_Ost")); + assertTrue(foodWaterEnergy.getSystemName().equals("Test_Stuttgart_System")); + ConsistsOfFWESurvey consistsOfFWESurvey = foodWaterEnergy.getConsistsOfFWESurvey(); + assertEquals(1, consistsOfFWESurvey.getLandUseSurvey().size()); + for(LandUseSurvey landUseSurvey : consistsOfFWESurvey.getLandUseSurvey()) { + assertEquals(5.0,landUseSurvey.getBuildingFootprintArea().getValue()); + assertTrue(landUseSurvey.getBuildingFootprintArea().getUom().equals("m2")); + assertNotNull(landUseSurvey.getFoodsurvey()); + if(landUseSurvey.getFoodsurvey() !=null) { + FoodSurvey foodSurvey = landUseSurvey.getFoodsurvey(); + assertEquals(12.0,foodSurvey.getFoodConsumption().getValue()); + } + assertNotNull(landUseSurvey.getWatersurvey()); + if(landUseSurvey.getWatersurvey() !=null) { + WaterSurvey waterSurvey = landUseSurvey.getWatersurvey(); + assertEquals(30.0,waterSurvey.getDomesticHotWaterDemand().getValue()); + } + assertNotNull(landUseSurvey.getEnergySurvey()); + if(landUseSurvey.getEnergySurvey() !=null) { + EnergySurvey energySurvey = landUseSurvey.getEnergySurvey(); + assertEquals(300.0,energySurvey.getSpaceCoolingDemand().getValue()); + } + + } + } + } + } + + private FoodWaterEnergy getOrCreateDummyData() { + + LandUseSurvey landUseSurvey = new LandUseSurvey(); + landUseSurvey.setId("landUseSurvey_001"); + landUseSurvey.setSurveyDescription("Test_SurveyDescription"); + + Area surfaceArea = new Area(); + surfaceArea.setUom("m2"); + surfaceArea.setValue(12.5); + landUseSurvey.setSurfaceArea(surfaceArea); + landUseSurvey.setSurveyYear(1975); + landUseSurvey.setSurveyYearVersion(0.1); + landUseSurvey.setSurveyDescription("desc"); + + Area buildingFootPrintArea = new Area(); + buildingFootPrintArea.setUom("m2"); + buildingFootPrintArea.setValue(5); + landUseSurvey.setBuildingFootprintArea(buildingFootPrintArea); + landUseSurvey.setPopulation(15000); + + FoodSurvey foodSurvey = new FoodSurvey(); + foodSurvey.setId("foodSurvey_001"); + + Scale consumption = new Scale(); + consumption.setUom("no_idea"); + consumption.setValue(12); + foodSurvey.setFoodConsumption(consumption); + Scale foodDemand = new Scale(); + foodDemand.setUom("no_idea_2"); + foodDemand.setValue(122); + foodSurvey.setFoodDemand(foodDemand); + Scale foodProduction = new Scale(); + foodProduction.setUom("no_idea_3"); + foodProduction.setValue(123); + foodSurvey.setFoodProduction(foodProduction); + Scale foodProductionEnergyDemand = new Scale(); + foodProductionEnergyDemand.setUom("no_idea_4"); + foodProductionEnergyDemand.setValue(124); + foodSurvey.setFoodProductionEnergyDemand(foodProductionEnergyDemand); + Scale foodProductionWaterDemand = new Scale(); + foodProductionWaterDemand.setUom("no_idea_5"); + foodProductionWaterDemand.setValue(125); + foodSurvey.setFoodProductionWaterDemand(foodProductionWaterDemand); + Code foodCategory = new Code(); + foodCategory.setCodeSpace("codeSpace_no_idea"); + foodCategory.setValue("no_idea_6"); + foodSurvey.setFoodCategory(foodCategory); + + + WaterSurvey waterSurvey = new WaterSurvey(); + waterSurvey.setId("waterSurvey_001"); + Scale domesticHotWaterDemand = new Scale(); + domesticHotWaterDemand.setUom("l"); + domesticHotWaterDemand.setValue(30); + waterSurvey.setDomesticHotWaterDemand(domesticHotWaterDemand); + Scale domesticHotWaterEnergyDemand = new Scale(); + domesticHotWaterEnergyDemand.setUom("l"); + domesticHotWaterEnergyDemand.setValue(31); + waterSurvey.setDomesticHotWaterEnergyDemand(domesticHotWaterEnergyDemand); + Scale domesticSolidWaste = new Scale(); + domesticSolidWaste.setUom("l"); + domesticSolidWaste.setValue(32); + waterSurvey.setDomesticSolidWaste(domesticSolidWaste); + Scale domesticWaterDemand = new Scale(); + domesticWaterDemand.setUom("l"); + domesticWaterDemand.setValue(33); + waterSurvey.setDomesticWaterDemand(domesticWaterDemand); + Scale domesticWaterWaste = new Scale(); + domesticWaterWaste.setUom("l"); + domesticWaterWaste.setValue(34); + waterSurvey.setDomesticWaterWaste(domesticWaterWaste); + Scale totalDomesticWaste = new Scale(); + totalDomesticWaste.setUom("l"); + totalDomesticWaste.setValue(35); + waterSurvey.setTotalDomesticWaste(totalDomesticWaste); + + EnergySurvey energySurvey = new EnergySurvey(); + energySurvey.setId("energySurvey_001"); + Scale spaceCoolingDemand = new Scale(); + spaceCoolingDemand.setUom("J"); + spaceCoolingDemand.setValue(300); + energySurvey.setSpaceCoolingDemand(spaceCoolingDemand); + Scale spaceHeatingDemand = new Scale(); + spaceHeatingDemand.setUom("J"); + spaceHeatingDemand.setValue(301); + energySurvey.setSpaceHeatingDemand(spaceHeatingDemand); + Scale residentialElectricityDemand = new Scale(); + residentialElectricityDemand.setUom("J"); + residentialElectricityDemand.setValue(302); + energySurvey.setResidentialElectricityDemand(residentialElectricityDemand); + Scale electricityPotentialFromPVBuildings = new Scale(); + electricityPotentialFromPVBuildings.setUom("J"); + electricityPotentialFromPVBuildings.setValue(303); + energySurvey.setElectricityPotentialFromPVBuildings(electricityPotentialFromPVBuildings); + Scale biomassPrimaryEnergyPotential = new Scale(); + biomassPrimaryEnergyPotential.setUom("J"); + biomassPrimaryEnergyPotential.setValue(304); + energySurvey.setBiomassPrimaryEnergyPotential(biomassPrimaryEnergyPotential); + Scale biomassToBioethanol = new Scale(); + biomassToBioethanol.setUom("J"); + biomassToBioethanol.setValue(305); + energySurvey.setBiomassToBioethanol(biomassToBioethanol); + Scale biomassToBiogas = new Scale(); + biomassToBiogas.setUom("J"); + biomassToBiogas.setValue(306); + energySurvey.setBiomassToBiogas(biomassToBiogas); + Scale biomassToElectricityPotential = new Scale(); + biomassToElectricityPotential.setUom("J"); + biomassToElectricityPotential.setValue(307); + energySurvey.setBiomassToElectricityPotential(biomassToElectricityPotential); + Scale biomassToEnergyWoods = new Scale(); + biomassToEnergyWoods.setUom("J"); + biomassToEnergyWoods.setValue(308); + energySurvey.setBiomassToEnergyWoods(biomassToEnergyWoods); + Scale biomassToPlantOil = new Scale(); + biomassToPlantOil.setUom("J"); + biomassToPlantOil.setValue(309); + energySurvey.setBiomassToPlantOil(biomassToPlantOil); + Scale biomassToResidualSolidFuel = new Scale(); + biomassToResidualSolidFuel.setUom("J"); + biomassToResidualSolidFuel.setValue(310); + energySurvey.setBiomassToResidualSolidFuel(biomassToResidualSolidFuel); + Scale biomassToSolidFuel = new Scale(); + biomassToSolidFuel.setUom("J"); + biomassToSolidFuel.setValue(311); + energySurvey.setBiomassToSolidFuel(biomassToSolidFuel); + Scale biomassToThermalPotential = new Scale(); + biomassToThermalPotential.setUom("J"); + biomassToThermalPotential.setValue(312); + energySurvey.setBiomassToThermalPotential(biomassToThermalPotential); + Code vegetationCoverCategory = new Code(); + vegetationCoverCategory.setCodeSpace("Un_code"); + vegetationCoverCategory.setValue("ndlep"); + energySurvey.setVegetationCoverCategory(vegetationCoverCategory); + + + landUseSurvey.setFoodsurvey(foodSurvey); + landUseSurvey.setWatersurvey(waterSurvey); + landUseSurvey.setEnergySurvey(energySurvey); + + ConsistsOfFWESurvey consistsOfFWESurvey = new ConsistsOfFWESurvey(); + List<LandUseSurvey> surveyList = new ArrayList<LandUseSurvey>(); + surveyList.add(landUseSurvey); + consistsOfFWESurvey.setLandUseSurvey(surveyList); + + + + FoodWaterEnergy foodWaterEnergy = new FoodWaterEnergy(); + foodWaterEnergy.setId("foodWaterEnergy_001"); + foodWaterEnergy.setAreaName("Test_Stuttgart_Ost"); + foodWaterEnergy.setSystemName("Test_Stuttgart_System"); + foodWaterEnergy.setConsistsOfFWESurvey(consistsOfFWESurvey); + + return foodWaterEnergy; + + } + + +} diff --git a/foodwaterenergycitygml4j/src/test/resources/FWELSample2.gml b/foodwaterenergycitygml4j/src/test/resources/FWELSample2.gml new file mode 100644 index 0000000..7a08405 --- /dev/null +++ b/foodwaterenergycitygml4j/src/test/resources/FWELSample2.gml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CityModel xmlns:brid="http://www.opengis.net/citygml/bridge/2.0" xmlns:tran="http://www.opengis.net/citygml/transportation/2.0" xmlns:wtr="http://www.opengis.net/citygml/waterbody/2.0" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:veg="http://www.opengis.net/citygml/vegetation/2.0" xmlns:frn="http://www.opengis.net/citygml/cityfurniture/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:tex="http://www.opengis.net/citygml/texturedsurface/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:dem="http://www.opengis.net/citygml/relief/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:smil20="http://www.w3.org/2001/SMIL20/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil20lang="http://www.w3.org/2001/SMIL20/Language" xmlns:pbase="http://www.opengis.net/citygml/profiles/base/2.0" xmlns:tun="http://www.opengis.net/citygml/tunnel/2.0" xmlns:sc="http://www.interactive-instruments.de/ShapeChange/AppInfo" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns="http://www.opengis.net/citygml/2.0" xmlns:luse="http://www.opengis.net/citygml/landuse/2.0" xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:fwel="http://localhost:8080/3DTiles/ADE/foodwaterenergy/landuse/0.0.1" xsi:schemaLocation="http://localhost:8080/3DTiles/ADE/foodwaterenergy/landuse/0.0.1 http://localhost:8080/3DTiles/ADE/foodwaterenergy/landuse/0.0.1/fwelanduseADE.xsd"> +<gml:boundedBy> +<gml:Envelope srsName="EPSG:25832" srsDimension="3"> +<gml:lowerCorner>516309.7750000004 5416407.569 0</gml:lowerCorner> +<gml:upperCorner>527203.5820000004 5425829.982000001 0</gml:upperCorner> +</gml:Envelope> +</gml:boundedBy> +<cityObjectMember> +<luse:LandUse gml:id="DEBWB0010000FTzJ"> +<luse:lod0MultiSurface> +<gml:MultiSurface srsName="EPSG:25832" srsDimension="3"> +<gml:surfaceMember> +<gml:Polygon> +<gml:exterior> +<gml:LinearRing> +<gml:posList>519571.82100000046 5419893.291999999 0 519545.77300000004 5419981.391000001 0 519522.2520000003 5419976.294 0 519419.324 5419954.6 0 519409.01400000043 5419950.467 0 519403.70299999975 5419947.0030000005 0 519397.23699999973 5419941.173 0 519398.66000000015 5419937.584000001 0 519399.9299999997 5419933.636 0 519399.61000000034 5419929.368000001 0 519398.66000000015 5419925.729 0 519395.9009999996 5419922.970000001 0 519405.49700000044 5419912.085000001 0 519415.26300000027 5419905.977 0 519431.65699999966 5419898.43 0 519447.31099999975 5419890.693 0 519458.9160000002 5419884.795 0 519468.67200000025 5419878.168 0 519478.20799999963 5419870.111 0 519571.82100000046 5419893.291999999 0</gml:posList> +</gml:LinearRing> +</gml:exterior> +</gml:Polygon> +</gml:surfaceMember> +</gml:MultiSurface> +</luse:lod0MultiSurface> + <fwel:foodwaterenergy gml:id="foodWaterEnergy_001"> + <fwel:fweAreaName>Test_Stuttgart_Ost</fwel:fweAreaName> + <fwel:fweSystemName>Test_Stuttgart_System</fwel:fweSystemName> + <fwel:consistsOfFWESurvey> + <fwel:landUseSurvey gml:id="landUseSurvey_001"> + <fwel:buildingFootprintArea uom="m2">5.0</fwel:buildingFootprintArea> + <fwel:population>15000</fwel:population> + <fwel:surveyYear>1975</fwel:surveyYear> + <fwel:surveyYearVersion>0.1</fwel:surveyYearVersion> + <fwel:surveyDescription>desc</fwel:surveyDescription> + <fwel:surfaceArea uom="m2">12.5</fwel:surfaceArea> + <fwel:foodSurvey gml:id="foodSurvey_001"> + <fwel:foodCategory codeSpace="codeSpace_no_idea">no_idea_6</fwel:foodCategory> + <fwel:foodDemand uom="no_idea_2">122.0</fwel:foodDemand> + <fwel:foodProduction uom="no_idea_3">123.0</fwel:foodProduction> + <fwel:foodProductionWaterDemand uom="no_idea_5">125.0</fwel:foodProductionWaterDemand> + <fwel:foodProductionEnergyDemand uom="no_idea_4">124.0</fwel:foodProductionEnergyDemand> + <fwel:foodConsumption uom="no_idea">12.0</fwel:foodConsumption> + </fwel:foodSurvey> + <fwel:waterSurvey gml:id="waterSurvey_001"> + <fwel:domesticHotWaterDemand uom="l">30.0</fwel:domesticHotWaterDemand> + <fwel:domesticHotWaterEnergyDemand uom="l">31.0</fwel:domesticHotWaterEnergyDemand> + <fwel:domesticSolidWaste uom="l">32.0</fwel:domesticSolidWaste> + <fwel:domesticWaterDemand uom="l">33.0</fwel:domesticWaterDemand> + <fwel:domesticWaterWaste uom="l">34.0</fwel:domesticWaterWaste> + <fwel:totalDomesticWaste uom="l">35.0</fwel:totalDomesticWaste> + </fwel:waterSurvey> + <fwel:energySurvey gml:id="energySurvey_001"> + <fwel:spaceHeatingDemand uom="J">301.0</fwel:spaceHeatingDemand> + <fwel:spaceCoolingDemand uom="J">300.0</fwel:spaceCoolingDemand> + <fwel:residentialElectricityDemand uom="J">302.0</fwel:residentialElectricityDemand> + <fwel:electricityPotentialFromPVBuildings uom="J">303.0</fwel:electricityPotentialFromPVBuildings> + <fwel:vegetationCoverCategory codeSpace="Un_code">ndlep</fwel:vegetationCoverCategory> + <fwel:biomassPrimaryEnergyPotential uom="J">304.0</fwel:biomassPrimaryEnergyPotential> + <fwel:biomassToEnergyWoods uom="J">308.0</fwel:biomassToEnergyWoods> + <fwel:biomassToBiogas uom="J">306.0</fwel:biomassToBiogas> + <fwel:biomassToPlantOil uom="J">309.0</fwel:biomassToPlantOil> + <fwel:biomassToBioethanol uom="J">305.0</fwel:biomassToBioethanol> + <fwel:biomassToResidualSolidFuel uom="J">310.0</fwel:biomassToResidualSolidFuel> + <fwel:biomassToSolidFuel uom="J">311.0</fwel:biomassToSolidFuel> + <fwel:biomassToElectricityPotential uom="J">307.0</fwel:biomassToElectricityPotential> + <fwel:biomassToThermalPotential uom="J">312.0</fwel:biomassToThermalPotential> + </fwel:energySurvey> + </fwel:landUseSurvey> + </fwel:consistsOfFWESurvey> + </fwel:foodwaterenergy> +</luse:LandUse> +</cityObjectMember> +</CityModel> diff --git a/foodwaterenergycitygml4j/src/test/resources/FWELandUseSample.gml b/foodwaterenergycitygml4j/src/test/resources/FWELandUseSample.gml new file mode 100644 index 0000000..c2c7739 --- /dev/null +++ b/foodwaterenergycitygml4j/src/test/resources/FWELandUseSample.gml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CityModel xmlns:brid="http://www.opengis.net/citygml/bridge/2.0" xmlns:tran="http://www.opengis.net/citygml/transportation/2.0" xmlns:wtr="http://www.opengis.net/citygml/waterbody/2.0" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:veg="http://www.opengis.net/citygml/vegetation/2.0" xmlns:frn="http://www.opengis.net/citygml/cityfurniture/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:tex="http://www.opengis.net/citygml/texturedsurface/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:dem="http://www.opengis.net/citygml/relief/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:smil20="http://www.w3.org/2001/SMIL20/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil20lang="http://www.w3.org/2001/SMIL20/Language" xmlns:pbase="http://www.opengis.net/citygml/profiles/base/2.0" xmlns:tun="http://www.opengis.net/citygml/tunnel/2.0" xmlns:sc="http://www.interactive-instruments.de/ShapeChange/AppInfo" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns="http://www.opengis.net/citygml/2.0" xmlns:luse="http://www.opengis.net/citygml/landuse/2.0" xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:fwel="http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD" xsi:schemaLocation="http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD http://transfer.hft-stuttgart.de/pages/in-source/fwe-ade/FWELanduse/v2.1.1/XSD/FWELanduse.xsd"> +<gml:boundedBy> +<gml:Envelope srsName="EPSG:25832" srsDimension="3"> +<gml:lowerCorner>516309.7750000004 5416407.569 0</gml:lowerCorner> +<gml:upperCorner>527203.5820000004 5425829.982000001 0</gml:upperCorner> +</gml:Envelope> +</gml:boundedBy> +<cityObjectMember> +<luse:LandUse gml:id="DEBWB0010000FTzJ"> +<luse:lod0MultiSurface> +<gml:MultiSurface srsName="EPSG:25832" srsDimension="3"> +<gml:surfaceMember> +<gml:Polygon> +<gml:exterior> +<gml:LinearRing> +<gml:posList>519571.82100000046 5419893.291999999 0 519545.77300000004 5419981.391000001 0 519522.2520000003 5419976.294 0 519419.324 5419954.6 0 519409.01400000043 5419950.467 0 519403.70299999975 5419947.0030000005 0 519397.23699999973 5419941.173 0 519398.66000000015 5419937.584000001 0 519399.9299999997 5419933.636 0 519399.61000000034 5419929.368000001 0 519398.66000000015 5419925.729 0 519395.9009999996 5419922.970000001 0 519405.49700000044 5419912.085000001 0 519415.26300000027 5419905.977 0 519431.65699999966 5419898.43 0 519447.31099999975 5419890.693 0 519458.9160000002 5419884.795 0 519468.67200000025 5419878.168 0 519478.20799999963 5419870.111 0 519571.82100000046 5419893.291999999 0</gml:posList> +</gml:LinearRing> +</gml:exterior> +</gml:Polygon> +</gml:surfaceMember> +</gml:MultiSurface> +</luse:lod0MultiSurface> + <fwel:foodwaterenergy gml:id="foodWaterEnergy_001"> + <fwel:fweAreaName>Test_Stuttgart_Ost</fwel:fweAreaName> + <fwel:fweSystemName>Test_Stuttgart_System</fwel:fweSystemName> + <fwel:consistsOfFWESurvey > + <fwel:landUseSurvey gml:id="landUseSurvey_001"> + <fwel:buildingFootprintArea uom="m2">5.0</fwel:buildingFootprintArea> + <fwel:population>15000</fwel:population> + <fwel:surveyYear>1975</fwel:surveyYear> + <fwel:surveyYearVersion>0.1</fwel:surveyYearVersion> + <fwel:surveyDescription>desc</fwel:surveyDescription> + <fwel:surfaceArea uom="m2">12.5</fwel:surfaceArea> + <fwel:foodSurvey gml:id="foodSurvey_001"> + <fwel:foodCategory codeSpace="codeSpace_no_idea">no_idea_6</fwel:foodCategory> + <fwel:foodDemand uom="no_idea_2">122.0</fwel:foodDemand> + <fwel:foodProduction uom="no_idea_3">123.0</fwel:foodProduction> + <fwel:foodProductionWaterDemand uom="no_idea_5">125.0</fwel:foodProductionWaterDemand> + <fwel:foodProductionEnergyDemand uom="no_idea_4">124.0</fwel:foodProductionEnergyDemand> + <fwel:foodConsumption uom="no_idea">12.0</fwel:foodConsumption> + </fwel:foodSurvey> + <fwel:waterSurvey gml:id="waterSurvey_001"> + <fwel:domesticHotWaterDemand uom="l">30.0</fwel:domesticHotWaterDemand> + <fwel:domesticHotWaterEnergyDemand uom="l">31.0</fwel:domesticHotWaterEnergyDemand> + <fwel:domesticSolidWaste uom="l">32.0</fwel:domesticSolidWaste> + <fwel:domesticWaterDemand uom="l">33.0</fwel:domesticWaterDemand> + <fwel:domesticWaterWaste uom="l">34.0</fwel:domesticWaterWaste> + <fwel:totalDomesticWaste uom="l">35.0</fwel:totalDomesticWaste> + </fwel:waterSurvey> + <fwel:energySurvey gml:id="energySurvey_001"> + <fwel:spaceHeatingDemand uom="J">301.0</fwel:spaceHeatingDemand> + <fwel:spaceCoolingDemand uom="J">300.0</fwel:spaceCoolingDemand> + <fwel:residentialElectricityDemand uom="J">302.0</fwel:residentialElectricityDemand> + <fwel:electricityPotentialFromPVBuildings uom="J">303.0</fwel:electricityPotentialFromPVBuildings> + <fwel:vegetationCoverCategory codeSpace="Un_code">ndlep</fwel:vegetationCoverCategory> + <fwel:biomassPrimaryEnergyPotential uom="J">304.0</fwel:biomassPrimaryEnergyPotential> + <fwel:biomassToEnergyWoods uom="J">308.0</fwel:biomassToEnergyWoods> + <fwel:biomassToBiogas uom="J">306.0</fwel:biomassToBiogas> + <fwel:biomassToPlantOil uom="J">309.0</fwel:biomassToPlantOil> + <fwel:biomassToBioethanol uom="J">305.0</fwel:biomassToBioethanol> + <fwel:biomassToResidualSolidFuel uom="J">310.0</fwel:biomassToResidualSolidFuel> + <fwel:biomassToSolidFuel uom="J">311.0</fwel:biomassToSolidFuel> + <fwel:biomassToElectricityPotential uom="J">307.0</fwel:biomassToElectricityPotential> + <fwel:biomassToThermalPotential uom="J">312.0</fwel:biomassToThermalPotential> + </fwel:energySurvey> + </fwel:landUseSurvey> + </fwel:consistsOfFWESurvey> + </fwel:foodwaterenergy> +</luse:LandUse> +</cityObjectMember> +</CityModel> -- GitLab