Question

How to transform AIXM 4.5 to AIXM 5.1 -XML geometry - GeometryPropertySetter


Badge

Hello

I reopen a new question about a big problem

I have an AIXM 4.5 file and i have to translate that file in the AIXM 5.1 schema. I have already made some good translations but i have a problem with the FME type XML_Geometry

Here are some pictures to explain my problem

I have first a sample file found on the web in the AIXM5.1 format. It concern the RunwayCentreLinePoint feature and it contains a XML structure beginning by "associatedDeclaredDistance":

This structure "associatedDeclaredDistance" can be repeated in the same element "RunwayCentreLinePointTimeSlice" as many time you have an information about a characteristics associated with a runway, called a distance. This structure is defined in the AIXM 5.1 schema (FME) as a list containing a XML_Geometry structure (FME type):

The third file .png shows how a feature looks like when you have the inspector:

For the XML Structure "associatedDeclaredDistance" i see it's made with an aggregate of multi parts (declaredValue and timeInterval)

I give you the initial sample file i found on the web

So, now .... i give you the problem i have ...

I have to translate an AIXM 4.5 file in the AIXM 5.1 structure. I give you my file (a part )

In that file you have all the necessary stuff to make a good translation between the initial schema to the final schema. I give you also the file "fmw" i have made and my first attempt to complete the goal i explain here.

Now ... the problem : I try without any success to add a bookmark to map the "associatedDeclaredDistance" in the workspace. When i launch the FME script, the good structure appears at the beginning but when i try to add the nested elements inside (declaredValue and timeInterval) all is going wrong .... the structure XML disappear, and some XML structure defined before (Elevated Point) disappear too ...Try to launch without the assocatedDeclaredDistance bookmark and the XML structure "ElevatedPoint" appears again ...

I try many many times ...When i look with the inspector, i don't succeed in mapping the attributes in a way it has a good aggregate structure as in the example i show you at first ...

I need a good help on that subject and specifically about the XML_Geometry type used by FME and how to succeed to match a nested structure. I have read and follow many samples on the FME website... it doesn't work with the XML_Templater because the output schema should be in the form of XML_fragments and in my case the output element "associatedDeclaredDistance" is an XML_Geometry. It seems i have to use the "GeometryPropertySetter" transformer with some details about the xquery details but it's hard for me without any samples and good documentation

A element "annotation" inside the output schema is of XML_fragment type and i used XML_templater with success ...


5 replies

Userlevel 2
Badge +17

Hi @philippe33, I'm not familiar with the AIXM format, but noticed the geometry type is marked as "Multiple Geometry" with Data Inspector / Feature Information in your screenshot. As an internal data structure, Multiple Geometry is almost same as Aggregate, but some formats distinguish them.

You can convert an Aggregate to Multiple Geometry with the MultipleGeometrySetter transformer. I think it's worth to try, although I'm not sure if it could resolve your problem.

Badge

Hi @philippe33, I'm not familiar with the AIXM format, but noticed the geometry type is marked as "Multiple Geometry" with Data Inspector / Feature Information in your screenshot. As an internal data structure, Multiple Geometry is almost same as Aggregate, but some formats distinguish them.

You can convert an Aggregate to Multiple Geometry with the MultipleGeometrySetter transformer. I think it's worth to try, although I'm not sure if it could resolve your problem.

I have some difficulties to understand how all these things work together ... I tried MultipleGeometrySetter transformer and i lost the "location" XML structure in the output file. One problem is that i have an IFME Point with coordinates inside which is always attached as a leaf (child) of all the others structures. It's such like a big tree with many nodes inside but at the end, the output is just for the first level... I probably have to use the options in GeometryPropertySetter transformer and say to the mechanism which part preceed or suceed the others parts but i don't have samples with xquery

 

Look at my fmw script.

 

The screenshot i give is for the sample file i found on a website, and when i use an AIXM5 reader to look at. But i don't suceed to have the same structure when i try with the AIXM5 writer and look at with the data inspector....

 

 

 

Badge +9

Hi @philippe33,

One suggestion is to look at a smaller example on our KnowledgeBase that discusses AIXM 4.5 to 5.1. See: https://knowledge.safe.com/articles/1312/aixm-xml-and-gml-formats-eu-airports-demo.html

 

It isn't going to completely give you all the answers but it should provide some nice direction. I hope that it helps.

 

Brian

Userlevel 4
Badge +13
I'm having trouble writing objects in AIXM 5 format with sub_objects such as associatedDeclaredDistance{} gml_geometry.

 

Can anyone help?

 

 

Badge +6

The typical approach in FME to write complex geometries to GML is to use a series of AttrbuteCreators, GeometryPropertySetters and Aggregators to embed the appropriate gml_ids, properties and geometry names in the geometry structure before writing to the corresponding xml_geometry field. As Brian mentioned, this process is described in some of our AIXM and INSPIRE examples in our Knowledge Centre. However, for the more complex geometries such as the ones described here, it may be a lot easier to simply use an XMLTemplater with a template of the desired output geometry, and then feed the required feature values or GML geometries into that. To support this, as of the latest release, you can now write xml fragments to any xml_geometry field. In the past, you could only do this for xml_xml fields. The 2017.1.1 whatsNew.txt has:

"FME 2017.1.1.0 b17647 20170926 --- GML writer: application schema mode - allow xml_geometry attributes representing embedded objects in the FME multi geometry to be written from xml fragments when the corresponding geometry is missing from the FME feature, PR78824."

For complex GML geometry cases like this, if you have tried this and still are stuck, please send your workspace and data to safe.com/support and we can give you some pointers.

Reply