Skip to main content
Question

Writing CityGML with custom ADE... I just cannot get it to work.. :(

  • February 4, 2013
  • 0 replies
  • 23 views

So.. someone in my team wrote this custom ADE (see all the way below). I also have an example CityGML of how my output should look like. It shouldn't be so hard now to write a proper CityGML, right? Well, I'm getting quite desperate here...

 

 

An example: for each building it should add this XML code to the feature:

 

 

<bldg:Building gml:id="building_39">

 

<pan:project name="Test Project"> <pan:scenario name="Scenario 1"> <pan:doubleAttribute name="TestAttribute1"> <gen:value>43.5</gen:value> </pan:doubleAttribute> <pan:intAttribute name="TestAttribute2"> <gen:value>5</gen:value> </pan:intAttribute> </pan:scenario> </pan:project> ... etc. (geometry stuff)

 

So, a feature can take part in 1~n projects and each project can consist of 1~n scenarios (bold). Each scenario contains 0~n generic attributes (double, string, integer), as shown in italics.

 

If I add a writer to my workbench for the example CityGML that I have and I specify the custom ADE, I end up with the following attributes:

 

  • citygml_project{}_name [xml_buffer]
  • citygml_project{}.citygml_scenario{}_name [xml_buffer]
  • TestAttribute1 [xml_buffer]
  • TestAttribute2 [xml_buffer]

It seems to me, that the reader doesn't know that the TestAttributes are children of the project->scenario node. Furthermore, I have never seen a list like "citygml_project{}_name" before and I do not know how to create it with the standard transformers. Creating a "citygml_project{}.name" (mind the dot!) is easy, but this? I tried Python, which works for the project name, but how to write (there's a good example of how to read them) a nested list like citygml_project{}.citygml_scenario{}_name? 

 

As long as I cannot solve these problems, I cannot use a dynamic writer, it seems to me. And then still I don't even know if the reader has it right...

 

 

If no one has a solution for the problem above, there's a plan B, but again.. I'm new to this, so I need a little hint to get me going.

 

Let's say I just want to write these custom ADE attributes and properties as XML code that I generated myself (by means of Python or a XMLTemplater/Formatter for instance). How should I configure the CityGML writer so I can simply insert my own code directly after the <bldg:Building ...> tag?

 

 

 

 

Btw, if it is helpful, the relevant code in the ADE XSD looks like this:

 

 

<xsd:complexType name="ProjectType"> <xsd:sequence> <xsd:element name="scenario"    type="ScenarioType" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="_GenericProjectProperty" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string"/> </xsd:complexType>   <xsd:element name="project" type="ProjectType" substitutionGroup="core:_GenericApplicationPropertyOfCityObject"/>   <xsd:complexType name="ScenarioType"> <xsd:sequence> <xsd:element ref="_GenericScenarioProperty" minOccurs="0" maxOccurs="unbounded"></xsd:element> </xsd:sequence> <xsd:attribute name="name" type="xsd:string"/> </xsd:complexType>   <xsd:element name="_GenericProjectProperty" abstract="true" type="xsd:anyType"/> <xsd:element name="_GenericScenarioProperty" abstract="true" type="xsd:anyType"/> <xsd:element name="_GenericScenarioAttribute" type="gen:AbstractGenericAttributeType" abstract="true" substitutionGroup="_GenericScenarioProperty"/> <xsd:element name="stringAttribute" type="gen:StringAttributeType" substitutionGroup="_GenericScenarioAttribute"/> <xsd:element name="intAttribute"    type="gen:IntAttributeType"    substitutionGroup="_GenericScenarioAttribute"/> <xsd:element name="doubleAttribute" type="gen:DoubleAttributeType" substitutionGroup="_GenericScenarioAttribute"/> <xsd:element name="dateAttribute"   type="gen:DateAttributeType"   substitutionGroup="_GenericScenarioAttribute"/>

0 replies

Be the first to reply!

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