From 4621ba97f6a36f5c7c80916b8cba5678e56e98e6 Mon Sep 17 00:00:00 2001 From: Tom Commandeur Date: Thu, 30 Aug 2018 09:39:28 +0200 Subject: [PATCH 1/2] add all imgeo types with dash to accept underscore also --- src/Bridge.cpp | 3 +++ src/Forest.cpp | 6 ++++++ src/Road.cpp | 30 ++++++++++++++++++++++++++++++ src/Separation.cpp | 18 ++++++++++++++++++ src/Terrain.cpp | 6 ++++++ src/Water.cpp | 12 ++++++++++++ 6 files changed, 75 insertions(+) diff --git a/src/Bridge.cpp b/src/Bridge.cpp index 593da5f5..ed5027d9 100644 --- a/src/Bridge.cpp +++ b/src/Bridge.cpp @@ -107,6 +107,9 @@ void Bridge::get_citygml_imgeo(std::wostream& of) { std::string attribute; if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; + } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; } if (get_attribute("hoortbijtypeoverbrugging", attribute)) { of << "" << attribute << ""; diff --git a/src/Forest.cpp b/src/Forest.cpp index 33107f68..c1b7d019 100644 --- a/src/Forest.cpp +++ b/src/Forest.cpp @@ -95,12 +95,18 @@ void Forest::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-fysiekvoorkomen", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_fysiekvoorkomen", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("begroeidterreindeeloptalud", attribute, "false")) { of << "" << attribute << ""; } if (get_attribute("plus-fysiekvoorkomen", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_fysiekvoorkomen", attribute)) { + of << "" << attribute << ""; + } of << ""; of << ""; } diff --git a/src/Road.cpp b/src/Road.cpp index 697c7fb2..fcb60375 100644 --- a/src/Road.cpp +++ b/src/Road.cpp @@ -118,27 +118,45 @@ void Road::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-functie", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_functie", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-functiespoor", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_functiespoor", attribute)) { + of << "" << attribute << ""; + } of << ""; } else if (auxiliary) { if (get_attribute("bgt-functie", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_functie", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("bgt-fysiekvoorkomen", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_fysiekvoorkomen", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("ondersteunendwegdeeloptalud", attribute, "false")) { of << "" << attribute << ""; } if (get_attribute("plus-functieondersteunendwegdeel", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_functieondersteunendwegdeel", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-fysiekvoorkomenondersteunendwegdeel", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_fysiekvoorkomenondersteunendwegdeel", attribute)) { + of << "" << attribute << ""; + } of << ""; } else @@ -146,18 +164,30 @@ void Road::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-functie", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_functie", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("bgt-fysiekvoorkomen", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_fysiekvoorkomen", attribute)) { + of << "" << attribute << ""; + } if (!get_attribute("wegdeeloptalud", attribute, "false")) { of << "" << attribute << ""; } if (get_attribute("plus-functiewegdeel", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_functiewegdeel", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-fysiekvoorkomenwegdeel", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_fysiekvoorkomenwegdeel", attribute)) { + of << "" << attribute << ""; + } of << ""; } of << ""; diff --git a/src/Separation.cpp b/src/Separation.cpp index cd544f43..05ca18fb 100644 --- a/src/Separation.cpp +++ b/src/Separation.cpp @@ -111,27 +111,45 @@ void Separation::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_type", attribute)) { + of << "" << attribute << ""; + } of << ""; } else if (overigbouwwerk) { if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_type", attribute)) { + of << "" << attribute << ""; + } of << ""; } else { if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_type", attribute)) { + of << "" << attribute << ""; + } of << ""; } of << ""; diff --git a/src/Terrain.cpp b/src/Terrain.cpp index 03a6ec1a..d122228c 100644 --- a/src/Terrain.cpp +++ b/src/Terrain.cpp @@ -96,12 +96,18 @@ void Terrain::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-fysiekvoorkomen", attribute)) { of << "" << attribute /*"erf"*/ << ""; } + else if (get_attribute("bgt_fysiekvoorkomen", attribute)) { + of << "" << attribute /*"erf"*/ << ""; + } if (get_attribute("onbegroeidterreindeeloptalud", attribute, "false")) { of << "" << attribute << ""; } if (get_attribute("plus-fysiekvoorkomen", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_fysiekvoorkomen", attribute)) { + of << "" << attribute << ""; + } of << ""; of << ""; } diff --git a/src/Water.cpp b/src/Water.cpp index 3f8d91d5..d859d63d 100644 --- a/src/Water.cpp +++ b/src/Water.cpp @@ -106,18 +106,30 @@ void Water::get_citygml_imgeo(std::wostream& of) { if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_type", attribute)) { + of << "" << attribute << ""; + } of << ""; } else { if (get_attribute("bgt-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("bgt_type", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("plus-type", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_type", attribute)) { + of << "" << attribute << ""; + } of << ""; } of << ""; From dbef5fbc49730d79a95a2b747457dd38d4db0752 Mon Sep 17 00:00:00 2001 From: Tom Commandeur Date: Tue, 4 Sep 2018 16:17:16 +0200 Subject: [PATCH 2/2] add imgeo attributes with underscore to topofeature --- src/TopoFeature.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/TopoFeature.cpp b/src/TopoFeature.cpp index c9918202..0b6a1392 100644 --- a/src/TopoFeature.cpp +++ b/src/TopoFeature.cpp @@ -240,6 +240,9 @@ void TopoFeature::get_imgeo_object_info(std::wostream& of, std::string id) { if (get_attribute("lv-publicatiedatum", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("lv_publicatiedatum", attribute)) { + of << "" << attribute << ""; + } if (get_attribute("bronhouder", attribute)) { of << "" << attribute << ""; } @@ -252,9 +255,15 @@ void TopoFeature::get_imgeo_object_info(std::wostream& of, std::string id) { if (get_attribute("bgt-status", attribute, "bestaand")) { of << "" << attribute << ""; } + else if (get_attribute("bgt_status", attribute, "bestaand")) { + of << "" << attribute << ""; + } if (get_attribute("plus-status", attribute)) { of << "" << attribute << ""; } + else if (get_attribute("plus_status", attribute)) { + of << "" << attribute << ""; + } } void TopoFeature::get_cityjson_attributes(nlohmann::json& f, AttributeMap attributes) {