Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CityGML 3.0: Add support for missing elements #90

Closed
wants to merge 17 commits into from
12 changes: 12 additions & 0 deletions sources/include/citygml/cityobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ namespace citygml {
// ADD Buildding model
COT_IntBuildingInstallation = 1ll<< 34,

COT_GenericOccupiedSpace = 1ll<< 40,
COT_GenericUnoccupiedSpace = 1ll<< 41,
COT_GenericLogicalSpace = 1ll<< 42,
COT_GenericThematicSurface = 1ll<< 43,
COT_TrafficSpace = 1ll<< 44,
COT_AuxiliaryTrafficSpace = 1ll<< 45,
COT_Intersection = 1ll<< 46,
COT_Section = 1ll<< 47,
COT_Waterway = 1ll<< 48,
COT_BuildingConstructiveElement = 1ll<< 49,
COT_BuildingRoom = 1ll<< 50,

COT_All = 0xFFFFFFFFFFFFFFFFll
};

Expand Down
26 changes: 26 additions & 0 deletions sources/include/parser/nodetypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace citygml {
NODETYPE( CORE, MimeType)
NODETYPE( CORE, LibraryObject)

NODETYPE( CORE, Boundary )

// GRP
NODETYPE( GRP, CityObjectGroup )
NODETYPE( GRP, GroupMember )
Expand Down Expand Up @@ -99,6 +101,22 @@ namespace citygml {
NODETYPE( GEN, Lod3ImplicitRepresentation )
NODETYPE( GEN, Lod4ImplicitRepresentation )

NODETYPE( GEN, GenericOccupiedSpace )
NODETYPE( GEN, GenericUnoccupiedSpace )
NODETYPE( GEN, GenericLogicalSpace )
NODETYPE( GEN, GenericThematicSurface )

NODETYPE( GEN, Lod0MultiCurve )
NODETYPE( GEN, Lod2MultiCurve )
NODETYPE( GEN, Lod3MultiCurve )
NODETYPE( GEN, Lod0MultiSurface )
NODETYPE( GEN, Lod2MultiSurface )
NODETYPE( GEN, Lod3MultiSurface )

NODETYPE( GEN, Area )
NODETYPE( GEN, SpaceType )
NODETYPE( GEN, Volume )

// TEX
// NODETYPE( GML, TexturedSurface ) // Deprecated

Expand Down Expand Up @@ -215,6 +233,8 @@ namespace citygml {
NODETYPE( BLDG, OuterFloorSurface )
NODETYPE( BLDG, BuildingFurniture )
NODETYPE( BLDG, IntBuildingInstallation)
NODETYPE( BLDG, BuildingConstructiveElement)
NODETYPE( BLDG, BuildingRoom)

NODETYPE( BLDG, CityFurniture )
NODETYPE( BLDG, Address)
Expand Down Expand Up @@ -299,14 +319,20 @@ namespace citygml {
NODETYPE( TRANS, TransportationComplex )
NODETYPE( TRANS, TrafficArea )
NODETYPE( TRANS, AuxiliaryTrafficArea )
NODETYPE( TRANS, TrafficSpace )
NODETYPE( TRANS, AuxiliaryTrafficSpace )
NODETYPE( TRANS, Track )
NODETYPE( TRANS, Road )
NODETYPE( TRANS, Railway )
NODETYPE( TRANS, Square )
NODETYPE( TRANS, Intersection )
NODETYPE( TRANS, Section )
NODETYPE( TRANS, Waterway )

NODETYPE( TRANS, Usage )
NODETYPE( TRANS, Function )
NODETYPE( TRANS, SurfaceMaterial )
NODETYPE( TRANS, Granularity )

NODETYPE( TRANS, Lod0Network )
NODETYPE( TRANS, Lod1MultiSurface )
Expand Down
28 changes: 26 additions & 2 deletions sources/src/citygml/cityobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ namespace citygml {
return "BuildingInstallation";
case CityObject::CityObjectsType::COT_BuildingFurniture:
return "BuildingFurniture";
case CityObject::CityObjectsType::COT_BuildingConstructiveElement:
return "BuildingConstructiveElement";
case CityObject::CityObjectsType::COT_BuildingRoom:
return "BuildingRoom";
case CityObject::CityObjectsType::COT_Door:
return "Door";
case CityObject::CityObjectsType::COT_Window:
Expand All @@ -183,6 +187,12 @@ namespace citygml {
return "Railway";
case CityObject::CityObjectsType::COT_Square:
return "Square";
case CityObject::CityObjectsType::COT_Intersection:
return "Intersection";
case CityObject::CityObjectsType::COT_Section:
return "Section";
case CityObject::CityObjectsType::COT_Waterway:
return "Waterway";
case CityObject::CityObjectsType::COT_PlantCover:
return "PlantCover";
case CityObject::CityObjectsType::COT_SolitaryVegetationObject:
Expand Down Expand Up @@ -226,7 +236,13 @@ namespace citygml {
case CityObject::CityObjectsType::COT_TransportationObject:
return "TransportationObject";
case CityObject::CityObjectsType::COT_IntBuildingInstallation:
return "IntBuildingInstallation";
return "IntBuildingInstallation";
case CityObject::CityObjectsType::COT_GenericOccupiedSpace:
return "GenericOccupiedSpace";
case CityObject::CityObjectsType::COT_GenericUnoccupiedSpace:
return "GenericUnoccupiedSpace";
case CityObject::CityObjectsType::COT_GenericLogicalSpace:
return "GenericLogicalSpace";
default:
return "Unknown";
}
Expand All @@ -244,13 +260,18 @@ namespace citygml {
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Room), CityObject::CityObjectsType::COT_Room},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_BuildingInstallation), CityObject::CityObjectsType::COT_BuildingInstallation},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_BuildingFurniture), CityObject::CityObjectsType::COT_BuildingFurniture},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_BuildingConstructiveElement), CityObject::CityObjectsType::COT_BuildingConstructiveElement},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_BuildingRoom), CityObject::CityObjectsType::COT_BuildingRoom},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Door), CityObject::CityObjectsType::COT_Door},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Window), CityObject::CityObjectsType::COT_Window},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_CityFurniture), CityObject::CityObjectsType::COT_CityFurniture},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Track), CityObject::CityObjectsType::COT_Track},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Road), CityObject::CityObjectsType::COT_Road},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Railway), CityObject::CityObjectsType::COT_Railway},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Square), CityObject::CityObjectsType::COT_Square},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Intersection), CityObject::CityObjectsType::COT_Intersection},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Section), CityObject::CityObjectsType::COT_Section},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_Waterway), CityObject::CityObjectsType::COT_Waterway},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_PlantCover), CityObject::CityObjectsType::COT_PlantCover},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_SolitaryVegetationObject), CityObject::CityObjectsType::COT_SolitaryVegetationObject},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_WaterBody), CityObject::CityObjectsType::COT_WaterBody},
Expand All @@ -272,7 +293,10 @@ namespace citygml {
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_OuterCeilingSurface), CityObject::CityObjectsType::COT_OuterCeilingSurface},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_OuterFloorSurface), CityObject::CityObjectsType::COT_OuterFloorSurface},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_TransportationObject), CityObject::CityObjectsType::COT_TransportationObject},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_IntBuildingInstallation), CityObject::CityObjectsType::COT_IntBuildingInstallation}
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_IntBuildingInstallation), CityObject::CityObjectsType::COT_IntBuildingInstallation},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_GenericOccupiedSpace), CityObject::CityObjectsType::COT_GenericOccupiedSpace},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_GenericUnoccupiedSpace), CityObject::CityObjectsType::COT_GenericUnoccupiedSpace},
{cityObjectsTypeToLowerString(CityObject::CityObjectsType::COT_GenericLogicalSpace), CityObject::CityObjectsType::COT_GenericLogicalSpace}
};

CityObject::CityObjectsType cityObjectsTypeFromString(const std::string& s, bool& valid)
Expand Down
70 changes: 66 additions & 4 deletions sources/src/parser/cityobjectelementparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ namespace citygml {

if (!typeIDTypeMapInitialized) {
typeIDTypeMap.insert(HANDLE_TYPE(GEN, GenericCityObject));
typeIDTypeMap.insert(HANDLE_TYPE(GEN, GenericOccupiedSpace));
typeIDTypeMap.insert(HANDLE_TYPE(GEN, GenericUnoccupiedSpace));
typeIDTypeMap.insert(HANDLE_TYPE(GEN, GenericLogicalSpace));
typeIDTypeMap.insert(HANDLE_TYPE(GEN, GenericThematicSurface));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, Building));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, BuildingPart));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, Room));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, BuildingInstallation));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, BuildingFurniture));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, BuildingConstructiveElement));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, BuildingRoom));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, Door));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, Window));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, CityFurniture));
Expand All @@ -69,9 +75,14 @@ namespace citygml {
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Road));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Railway));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Square));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Intersection));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Section));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, Waterway));
typeIDTypeMap.insert(HANDLE_GROUP_TYPE(TRANS, TransportationComplex, CityObject::CityObjectsType::COT_TransportationObject));
typeIDTypeMap.insert(HANDLE_GROUP_TYPE(TRANS, TrafficArea, CityObject::CityObjectsType::COT_TransportationObject));
typeIDTypeMap.insert(HANDLE_GROUP_TYPE(TRANS, AuxiliaryTrafficArea, CityObject::CityObjectsType::COT_TransportationObject));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, TrafficSpace));
typeIDTypeMap.insert(HANDLE_TYPE(TRANS, AuxiliaryTrafficSpace));
typeIDTypeMap.insert(HANDLE_TYPE(VEG, PlantCover));
typeIDTypeMap.insert(HANDLE_TYPE(VEG, SolitaryVegetationObject));
typeIDTypeMap.insert(HANDLE_TYPE(WTR, WaterBody));
Expand Down Expand Up @@ -143,13 +154,17 @@ namespace citygml {
attributesSet.insert(HANDLE_ATTR(GEN, Class));
attributesSet.insert(HANDLE_ATTR(GEN, Function));
attributesSet.insert(HANDLE_ATTR(GEN, Usage));
attributesSet.insert(HANDLE_ATTR(GEN, Area));
attributesSet.insert(HANDLE_ATTR(GEN, SpaceType));
attributesSet.insert(HANDLE_ATTR(GEN, Volume));
attributesSet.insert(HANDLE_ATTR(LUSE, Class));
attributesSet.insert(HANDLE_ATTR(LUSE, Function));
attributesSet.insert(HANDLE_ATTR(LUSE, Usage));
attributesSet.insert(HANDLE_ATTR(DEM, Lod));
attributesSet.insert(HANDLE_ATTR(TRANS, Usage));
attributesSet.insert(HANDLE_ATTR(TRANS, Function));
attributesSet.insert(HANDLE_ATTR(TRANS, SurfaceMaterial));
attributesSet.insert(HANDLE_ATTR(TRANS, Granularity));
attributesSet.insert(HANDLE_ATTR(WTR, Class));
attributesSet.insert(HANDLE_ATTR(WTR, Function));
attributesSet.insert(HANDLE_ATTR(WTR, Usage));
Expand Down Expand Up @@ -185,13 +200,17 @@ namespace citygml {
attributeTypeMap[HANDLE_ATTR(GEN, Class)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(GEN, Function)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(GEN, Usage)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(GEN, Area)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(GEN, SpaceType)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(GEN, Volume)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(LUSE, Class)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(LUSE, Function)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(LUSE, Usage)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(DEM, Lod)] = AttributeType::Integer;
attributeTypeMap[HANDLE_ATTR(TRANS, Usage)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(TRANS, Function)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(TRANS, SurfaceMaterial)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(TRANS, Granularity)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(WTR, Class)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(WTR, Function)] = AttributeType::String;
attributeTypeMap[HANDLE_ATTR(WTR, Usage)] = AttributeType::String;
Expand Down Expand Up @@ -288,18 +307,31 @@ namespace citygml {
|| node == NodeType::BLDG_InteriorRoomNode
|| node == NodeType::BLDG_OpeningNode
|| node == NodeType::BLDG_ConsistsOfBuildingPartNode
|| node == NodeType::BLDG_BuildingPartNode
|| node == NodeType::BLDG_BuildingConstructiveElementNode
|| node == NodeType::BLDG_BuildingRoomNode
|| node == NodeType::GRP_GroupMemberNode
|| node == NodeType::GRP_ParentNode
|| node == NodeType::TRANS_TrafficAreaNode
|| node == NodeType::TRANS_AuxiliaryTrafficAreaNode
|| node == NodeType::TRANS_TrafficSpaceNode
|| node == NodeType::TRANS_AuxiliaryTrafficSpaceNode
|| node == NodeType::TRANS_IntersectionNode
|| node == NodeType::TRANS_SectionNode
|| node == NodeType::TRANS_WaterwayNode
|| node == NodeType::WTR_BoundedByNode
|| node == NodeType::DEM_ReliefComponentNode
|| node == NodeType::DEM_TINReliefNode
|| node == NodeType::DEM_MassPointReliefNode
|| node == NodeType::DEM_BreaklineReliefNode
|| node == NodeType::DEM_RasterReliefNode
|| node == NodeType::DEM_GridNode
|| node == NodeType::CORE_GeneralizesToNode) {
|| node == NodeType::CORE_GeneralizesToNode
|| node == NodeType::GEN_GenericOccupiedSpaceNode
|| node == NodeType::GEN_GenericUnoccupiedSpaceNode
|| node == NodeType::GEN_GenericLogicalSpaceNode
|| node == NodeType::GEN_GenericThematicSurfaceNode
|| node == NodeType::CORE_BoundaryNode) {
setParserForNextElement(new CityObjectElementParser(m_documentParser, m_factory, m_logger, [this](CityObject* obj) {
m_model->addChildCityObject(obj);
}));
Expand All @@ -313,7 +345,12 @@ namespace citygml {
|| node == NodeType::DEM_RidgeOrValleyLinesNode
|| node == NodeType::DEM_BreaklinesNode) {

parseGeometryForLODLevel(std::stoi(m_model->getAttribute("dem:lod")));
std::string lod = m_model->getAttribute("dem:lod");
if (!lod.empty()) {
parseGeometryForLODLevel(std::stoi(lod));
} else {
parseGeometryForLODLevel(0);
}
} else if (node == NodeType::GEN_Lod0TerrainIntersectionNode
|| node == NodeType::WTR_Lod0MultiCurveNode
|| node == NodeType::WTR_Lod0MultiSurfaceNode) {
Expand Down Expand Up @@ -347,7 +384,13 @@ namespace citygml {
|| node == NodeType::LUSE_Lod2MultiSurfaceNode
|| node == NodeType::TRANS_Lod2MultiSurfaceNode
|| node == NodeType::WTR_Lod2SolidNode
|| node == NodeType::WTR_Lod2SurfaceNode) {
|| node == NodeType::WTR_Lod2SurfaceNode
|| node == NodeType::GEN_Lod0MultiCurveNode
|| node == NodeType::GEN_Lod2MultiCurveNode
|| node == NodeType::GEN_Lod3MultiCurveNode
|| node == NodeType::GEN_Lod0MultiSurfaceNode
|| node == NodeType::GEN_Lod2MultiSurfaceNode
|| node == NodeType::GEN_Lod3MultiSurfaceNode) {

parseGeometryForLODLevel(2);
} else if (node == NodeType::BLDG_Lod3MultiCurveNode
Expand Down Expand Up @@ -507,6 +550,9 @@ namespace citygml {
|| node == NodeType::BLDG_Lod4MultiSurfaceNode
|| node == NodeType::BLDG_Lod4SolidNode
|| node == NodeType::BLDG_Lod4TerrainIntersectionNode
|| node == NodeType::BLDG_BuildingPartNode
|| node == NodeType::BLDG_BuildingConstructiveElementNode
|| node == NodeType::BLDG_BuildingRoomNode
|| node == NodeType::GEN_Lod1GeometryNode
|| node == NodeType::GEN_Lod2GeometryNode
|| node == NodeType::GEN_Lod3GeometryNode
Expand Down Expand Up @@ -561,6 +607,11 @@ namespace citygml {
|| node == NodeType::TRANS_Lod0NetworkNode
|| node == NodeType::TRANS_TrafficAreaNode
|| node == NodeType::TRANS_AuxiliaryTrafficAreaNode
|| node == NodeType::TRANS_TrafficSpaceNode
|| node == NodeType::TRANS_AuxiliaryTrafficSpaceNode
|| node == NodeType::TRANS_IntersectionNode
|| node == NodeType::TRANS_SectionNode
|| node == NodeType::TRANS_WaterwayNode
|| node == NodeType::TRANS_Lod1MultiSurfaceNode
|| node == NodeType::TRANS_Lod2MultiSurfaceNode
|| node == NodeType::TRANS_Lod3MultiSurfaceNode
Expand All @@ -579,7 +630,18 @@ namespace citygml {
|| node == NodeType::WTR_BoundedByNode
|| node == NodeType::BLDG_AddressNode
|| node == NodeType::CORE_AddressNode
|| node == NodeType::CORE_XalAddressNode) {
|| node == NodeType::CORE_XalAddressNode
|| node == NodeType::GEN_GenericOccupiedSpaceNode
|| node == NodeType::GEN_GenericUnoccupiedSpaceNode
|| node == NodeType::GEN_GenericLogicalSpaceNode
|| node == NodeType::GEN_GenericThematicSurfaceNode
|| node == NodeType::GEN_Lod0MultiCurveNode
|| node == NodeType::GEN_Lod2MultiCurveNode
|| node == NodeType::GEN_Lod3MultiCurveNode
|| node == NodeType::GEN_Lod0MultiSurfaceNode
|| node == NodeType::GEN_Lod2MultiSurfaceNode
|| node == NodeType::GEN_Lod3MultiSurfaceNode
|| node == NodeType::CORE_BoundaryNode) {

return true;
}
Expand Down
Loading
Loading