Skip to main content
Solved

Writing danish Plansystem.dk GML

  • October 4, 2017
  • 3 replies
  • 28 views

Forum|alt.badge.img

Hi all

Im trying to set up a gml writer to write to a gml file that matches the attached gml.

Im new to GML writing a have been trying to get FME to use this xsd schema: http://soap.plansystem.dk/pdk_schemas/PLANDK2_KommunePlanRammeType.xsd

as a base

I anyone has an idea where to start making a working writer i would be very happy :)

Best answer by deanatsafe

Hi @oaralb,

I tried to read the supplied 1054_KommunePlanRamme.gml with the application schema provided and FME didn't find any matching features. I then took a look at the GML in an XML editor and noticed that the xsi:schemaLocation is set to: http://soap.plansystem.dk/PdkWs/schemas3/pdk3/PLANDK3.xsd . When I used this application schema and path instead I was able to read the KommunePlanRamme features.

The next challenge was writing these same features back out. When I set up a default translation, I was able to write out KommunePlanRamme_out.xml ok, but when I tried to read this output dataset with FME Inspector, the geometries appeared to be missing. I took a look at the output in Notepad++ and noticed that the geometries were all there. On closer inspection I noticed that the vertices written by FME were all within a <gml:posList> object, whereas the source vertices were contained in <gml:coordinates> . This explains why I couldn't read the output.

The reason that FME writes out 3.1.1 geometries instead of 2.1.2 is that GML uses the same namespaces for both so there is no way that FME can tell from the application schema which one is required. What we could add is an advanced writer setting so users can specify the geometry version they want to write.

In the meantime I found a workaround. To force FME to generate GML 2.1.2, I added a GeometryExtractor, set it to extract GML2.1.2 and store the geometry xml in a field called multiPolygonProperty. I also checked the option that removes the FME geometry from the feature. Then I usedplandkgml2gml-geomxml.zip the new capability in FME 2017.1.1 that allows you to feed xml to xml_geometry fields. The GML writer will now use this XML geometry instead of the feature geometry when no feature geometry of that name exists. The attached example shows how to round trip this dataset and I confirmed that this output is in fact viewable in Data Inspector.

 

 

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.

3 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • October 4, 2017

Hi @oaralb,

I did make the download your xsd file and tried to import this Schame into Writer GML, but the log file appears a message error to import XSD:

Did you have same error message?

Thanks,

Danilo


Forum|alt.badge.img
  • Author
  • October 27, 2017

Sorry for the slow reply, I have also been getting errors trying to use the xsd and I have now resorted to build the entire gml manually from attributes and outputting it with a text writer.


deanatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • November 3, 2017

Hi @oaralb,

I tried to read the supplied 1054_KommunePlanRamme.gml with the application schema provided and FME didn't find any matching features. I then took a look at the GML in an XML editor and noticed that the xsi:schemaLocation is set to: http://soap.plansystem.dk/PdkWs/schemas3/pdk3/PLANDK3.xsd . When I used this application schema and path instead I was able to read the KommunePlanRamme features.

The next challenge was writing these same features back out. When I set up a default translation, I was able to write out KommunePlanRamme_out.xml ok, but when I tried to read this output dataset with FME Inspector, the geometries appeared to be missing. I took a look at the output in Notepad++ and noticed that the geometries were all there. On closer inspection I noticed that the vertices written by FME were all within a <gml:posList> object, whereas the source vertices were contained in <gml:coordinates> . This explains why I couldn't read the output.

The reason that FME writes out 3.1.1 geometries instead of 2.1.2 is that GML uses the same namespaces for both so there is no way that FME can tell from the application schema which one is required. What we could add is an advanced writer setting so users can specify the geometry version they want to write.

In the meantime I found a workaround. To force FME to generate GML 2.1.2, I added a GeometryExtractor, set it to extract GML2.1.2 and store the geometry xml in a field called multiPolygonProperty. I also checked the option that removes the FME geometry from the feature. Then I usedplandkgml2gml-geomxml.zip the new capability in FME 2017.1.1 that allows you to feed xml to xml_geometry fields. The GML writer will now use this XML geometry instead of the feature geometry when no feature geometry of that name exists. The attached example shows how to round trip this dataset and I confirmed that this output is in fact viewable in Data Inspector.