Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/runner/osm/translators/O5mWriter.cpp
Context not available. | |||||
16 | #include "GeoDataPlacemark.h" | 16 | #include "GeoDataPlacemark.h" | ||
---|---|---|---|---|---|
17 | #include "GeoDataRelation.h" | 17 | #include "GeoDataRelation.h" | ||
18 | #include "GeoDataPolygon.h" | 18 | #include "GeoDataPolygon.h" | ||
19 | #include "GeoDataBuilding.h" | ||||
20 | #include "GeoDataMultiGeometry.h" | ||||
19 | #include "GeoWriter.h" | 21 | #include "GeoWriter.h" | ||
20 | #include "osm/OsmPlacemarkData.h" | 22 | #include "osm/OsmPlacemarkData.h" | ||
21 | 23 | | |||
Context not available. | |||||
171 | referencesBuffer.open(QIODevice::WriteOnly); | 173 | referencesBuffer.open(QIODevice::WriteOnly); | ||
172 | QDataStream referencesStream(&referencesBuffer); | 174 | QDataStream referencesStream(&referencesBuffer); | ||
173 | if (const auto placemark = geodata_cast<GeoDataPlacemark>(relation.first)) { | 175 | if (const auto placemark = geodata_cast<GeoDataPlacemark>(relation.first)) { | ||
174 | auto polygon = geodata_cast<GeoDataPolygon>(placemark->geometry()); | 176 | if (const auto building = geodata_cast<GeoDataBuilding>(placemark->geometry())) { | ||
175 | Q_ASSERT(polygon); | 177 | auto polygon = geodata_cast<GeoDataPolygon>(&building->multiGeometry()->at(0)); | ||
176 | writeMultipolygonMembers(*polygon, lastReferenceId, osmData, stringTable, referencesStream); | 178 | Q_ASSERT(polygon); | ||
179 | writeMultipolygonMembers(*polygon, lastReferenceId, osmData, stringTable, referencesStream); | ||||
180 | } else { | ||||
181 | auto polygon = geodata_cast<GeoDataPolygon>(placemark->geometry()); | ||||
182 | Q_ASSERT(polygon); | ||||
183 | writeMultipolygonMembers(*polygon, lastReferenceId, osmData, stringTable, referencesStream); | ||||
184 | } | ||||
177 | } else if (const auto placemark = geodata_cast<GeoDataRelation>(relation.first)) { | 185 | } else if (const auto placemark = geodata_cast<GeoDataRelation>(relation.first)) { | ||
178 | writeRelationMembers(placemark, lastReferenceId, osmData, stringTable, referencesStream); | 186 | writeRelationMembers(placemark, lastReferenceId, osmData, stringTable, referencesStream); | ||
179 | } else { | 187 | } else { | ||
Context not available. |