Skip to main content
Solved

How to add gml:id to a CityGML Polygon element

  • August 31, 2017
  • 5 replies
  • 135 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • 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
  • 11 replies
  • 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
  • 11 replies
  • 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
Celebrity
  • 7843 replies
  • 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
  • 11 replies
  • 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.

Thank you Takashi, worked a treat!