Skip to main content

Hi,

When writing CityGML, gml:ID is added to the surface feature (WallSurface, RoofSurface, GroundSurface) however, there is no ID written to the polygon of the surface. How can i create an attribute to set the gml:id of the polygon of the surface feature?

Thanks,

Steve

Hi @steveway

I think you'd need to use an AttributeCreator to create an ID attribute called gml_id. Follow up with a GeometryPropertySetter to set these as traits using the attribute you just created as the source.

I'm not a 3D expert but I'm fairly certain that is the right way to go about this. If not, let us know and I'll investigate some more.


Hi Mark, I am doing that to create the cityGML surface feature, but that feature will have a multi surface element which then has a polygon element. It is this polygon element to which I want to assign a Gml:id. I believe what I am looking for is very similar to this post: https://knowledge.safe.com/questions/3695/setting-gmlid-attribute-to-geometry-in-citygml.html

 

Kind regards,

Steve


Hi Takeshi,

 

 

Here is a screengrab to illustrate the geometry class, and structure (which is valid CityGML):

 

0684Q00000ArJaLQAV.png

Here is an example of what I am getting:

 

<bldg:RoofSurface gml:id="id_19_205">
<bldg:lod2MultiSurface>
 <gml:MultiSurface srsName="EPSG:27700" srsDimension="3">
  <gml:surfaceMember>
   <gml:Polygon>
    ...
   </gml:Polygon>
  </gml:surfaceMember>
 </gml:MultiSurface>
</bldg:lod2MultiSurface>
</bldg:RoofSurface>

 

And Here is an example of what i require:

 

 

<bldg:RoofSurface gml:id="id_19_205">
<bldg:lod2MultiSurface>
 <gml:MultiSurface srsName="EPSG:27700" srsDimension="3">
  <gml:surfaceMember>
   <gml:Polygon gml:id="id_19_205_polygon">
    ...
   </gml:Polygon>
  </gml:surfaceMember>
 </gml:MultiSurface>
</bldg:lod2MultiSurface>
</bldg:RoofSurface>

 

Thanks,

 

Steve

OK. In your case, you can just use the GeometryPropertySetter with an appropriate Geometry XQuery in order to add the "gml_id" trait to the Polygon part.

GeometryPropertySetter: Geometry XQuery | Test Clauses

Part to TestLeft ValueOperatorRight ValueThis partGeometry Type=IFMEPolygon

Assuming that the input surface feature has an attribute called "gml_id" that stores the Polygon ID value (e.g. "id_19_205_polygon"), the parameters setting looks like this.

If the Polygon part always has the geometry name "exterior" (and other parts don't have the same name), this test clause would also be available.

Part to TestLeft ValueOperatorRight ValueThis partGeometry Name=exterior

The most suitable Geometry XQuery setting could be vary depending on the conditions and the requirements.

Hope this helps.


OK. In your case, you can just use the GeometryPropertySetter with an appropriate Geometry XQuery in order to add the "gml_id" trait to the Polygon part.

GeometryPropertySetter: Geometry XQuery | Test Clauses

Part to TestLeft ValueOperatorRight ValueThis partGeometry Type=IFMEPolygon

Assuming that the input surface feature has an attribute called "gml_id" that stores the Polygon ID value (e.g. "id_19_205_polygon"), the parameters setting looks like this.

If the Polygon part always has the geometry name "exterior" (and other parts don't have the same name), this test clause would also be available.

Part to TestLeft ValueOperatorRight ValueThis partGeometry Name=exterior

The most suitable Geometry XQuery setting could be vary depending on the conditions and the requirements.

Hope this helps.

Thank you Takashi, worked a treat!

 

 


Reply