diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java index f8d7bcf75f8b443fc77f66f4f2de1032a75125f7..58cdf28924438ef18243b99fa83307d82bd5418f 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java @@ -341,16 +341,17 @@ public class CityGmlParser { CityGMLInputFactory inputFactory, ObservedInputStream ois) throws CityGMLReadException { try (CityGMLReader reader = inputFactory.createCityGMLReader(ois)) { Citygml3FeatureMapper mapper = new Citygml3FeatureMapper(config, file); + CityGMLVersion version = null; // model is read in chunked mode // object members are replaced by href in model // need to remove the refs and re-add unparsed objects List acos = new ArrayList<>(); while (reader.hasNext()) { AbstractFeature chunk = reader.next(); + version = CityGMLModules.getCityGMLVersion(reader.getName().getNamespaceURI()); if (chunk instanceof CityModel cModel) { cModel.setCityObjectMembers(null); mapper.setCityModel(cModel); - CityGMLVersion version = CityGMLModules.getCityGMLVersion(reader.getName().getNamespaceURI()); mapper.setCityGMLVersion(version); } else if (chunk instanceof AbstractCityObject aco) { acos.add(aco); @@ -380,6 +381,7 @@ public class CityGmlParser { // Remove gag gagged = false; } + mapper.setCityGMLVersion(version); return mapper.getModel(); } }