Question

Create a custom gml spesification

  • 10 April 2019
  • 1 reply
  • 9 views

Badge +4

Hi,

This is a bit hard to explain so I hope this drawing shows what I want.

 

 

I am trying to create a gml spesification where different geometry segments in a polygon feature is split into curvemembers only containing one geometry type.

Basically when you have a boundary of line segments and arc segments, the gml will wrap a curvmember around every geometry type segment. as illustrated.

I am using a GMLFeatureComposer so I have the ability to update each gml feature before writing it out with a text file writer.

 

Should I use xmlupdator, or is it possible to do anything with the native geometry structure of IFMEPOLYGON to contain multiple IFMEPATH segments?


1 reply

Badge +6

Thanks for this interesting question. There are several approaches you could take for this, all of which will require some in depth understanding of both GML and XML schema design.

1. Perhaps the most efficient way to modify your gml geometries is to use XMLUpdater, although this is also likely one of the more challenging approaches to figure out, given the involved nature of building XQuery expressions. The attached XMLUpdater workspace should do the trick: CustomGML_XMLUpdate.zip

 

2. You can use FME to build the feature's geometry and attributes you want using FME's various geometry and attribute transformations, and then use the GML writer's app schema generation to create the associated XSD. In the attached gmlmulticurve.fmw I use a Chopper to break up a polygon into line segments, one per feature, and then an Aggregator to assemble the geometries into one multicurve with component curveMembers. The app schema generated multicurve.zip contains:

<element ref="gml:curveProperty" minOccurs="0"/>

<element ref="gml:multiCurveProperty" minOccurs="0"/>

For more on FME's GML writer configuration controls driven by FME feature schema rather than external application schema see: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/gml/user_attributes_w.htm

3. You can use XMLTemplater to structure the GML exactly the way you want it, and then use a curveMember subtemplate to feed in the point lists for each of the curveMembers. Note that if you have an app schema that defines a geometry element that accepts geometry, it will accept either an FME feature geometry with that same name or an XML fragment defining that geometry. So if your schema defines a a geometry called 'MyPolygon', this will show up on your workspace's destination schema as a 'MyPolygon' attribute with datatype = xml_geometry. It will accept geometries with name = 'MyPolygon' or an attribute that contains GML which defines a MyPolygon geometry. Once you have created a complete GML dataset, you could read it back into FME with the GML reader in ignore schema mode, and it will construct a feature type schema based on the data which you could then write out in 3.1.1 mode to generate an XSD.

See: https://knowledge.safe.com/articles/30940/xml-writing-with-xmltemplater.html

My general recommendation depends on how often you need to do this. If you plan on working with and revising GML schemas from time to time, it may be worth learning how to design and work with an XML editor like XMLSpy or Oxygen. If you only need to do this once or twice, you could try the XMLUpdater or XMLTemplater approaches above. If you get stuck, send your data, schema design and workspace to support and we can give you some more detailed feedback.

For more on application schema based GML writing see the EU INSPIRE tutorial at: https://knowledge.safe.com/articles/775/inspire-gml-basic-writing-example.html

 

Reply