Solved

Writing danish Plansystem.dk GML

  • 4 October 2017
  • 3 replies
  • 1 view

Badge

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 :)

icon

Best answer by deanatsafe 3 November 2017, 22:23

View original

3 replies

Userlevel 4
Badge +30

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

Badge

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.

Badge +6

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.

 

 

Reply