From 2ed18e2ec77ba95f85576460fd200bb2d38806cc Mon Sep 17 00:00:00 2001 From: Riegel Date: Tue, 22 Oct 2024 15:57:11 +0200 Subject: [PATCH] Fix oversight in CityGML version number parsing --- .../de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 f8d7bcf7..58cdf289 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(); } } -- GitLab