Skip to main content
Solved

How to add gml:id to a CityGML Polygon element


Forum|alt.badge.img

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

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

5 replies

mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • August 31, 2017

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.


Forum|alt.badge.img
  • Author
  • August 31, 2017

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


Forum|alt.badge.img
  • Author
  • August 31, 2017
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

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • September 1, 2017

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.


Forum|alt.badge.img
  • Author
  • September 1, 2017
takashi wrote:

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!

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings