Skip to main content
Solved

Hi everyone , i need to write a gml . i have a set of xsd files and an example file (wkpb_voorbeeld.gml) how do i write a gml file like the example (the only thing i need to write in the gml is the poslist (geometry)

  • October 23, 2020
  • 3 replies
  • 117 views

robert_punt
Contributor
Forum|alt.badge.img+7
Hi everyone , i need to write a gml . i have a set of xsd files and an example file (wkpb_voorbeeld.gml) how do i write a gml file like the example (the only thing i need to write in the gml is the poslist (geometry)

Best answer by redgeographics

It seems like everybody is trying to do that 😂 I've already helped 3 of my clients with it.

What I ended up doing was taking a look at the sample document provided by Kadaster, extracted the geometry of the areas to an attribute as GML, using a GeometryExtractor, then used a series of StringReplacers to tweak that output until it matched the sample. Write to a txt file with the extension .gml and that did the trick.

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

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • Best Answer
  • October 24, 2020

It seems like everybody is trying to do that 😂 I've already helped 3 of my clients with it.

What I ended up doing was taking a look at the sample document provided by Kadaster, extracted the geometry of the areas to an attribute as GML, using a GeometryExtractor, then used a series of StringReplacers to tweak that output until it matched the sample. Write to a txt file with the extension .gml and that did the trick.


robert_punt
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 23 replies
  • October 24, 2020

It seems like everybody is trying to do that 😂 I've already helped 3 of my clients with it.

What I ended up doing was taking a look at the sample document provided by Kadaster, extracted the geometry of the areas to an attribute as GML, using a GeometryExtractor, then used a series of StringReplacers to tweak that output until it matched the sample. Write to a txt file with the extension .gml and that did the trick.

Thanks for the answer I think the best option is the xxmltemplater the only thing that change is the geometry.

I hoped that fme could create the right header . Why does the kadaster create their own file formats?


robert_punt
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 23 replies
  • October 26, 2020

xmltemplaterHere is my solution.

I extract the geometry and remove unnecessary strings from the geometry. (POLYGON(( )) )

Then ik insert the xmltemplater with the root template:

<gml:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nen3610="http://www.ravi.nl/nen3610" xmlns:kad="urn:schemas-kadaster-nl:/imkad" xsi:schemaLocation="urn:schemas-kadaster-nl:/imkad PBGebied.xsd">

<gml:featureMember>

<kad:PBGebied>

<nen3610:identificatie/>

        {fme:process-features("SUB")}

</kad:PBGebied>

</gml:featureMember>

</gml:FeatureCollection>

 

And the sub template:

 

      <gml:multiSurfaceProperty>

<gml:MultiSurface>

          <gml:surfaceMember>

            <gml:Surface>

              <gml:patches>

                <gml:PolygonPatch>

                  <gml:exterior>

                    <gml:LinearRing>

                      <gml:posList>

                        {fme:get-attribute("_geometry")}

                      </gml:posList>

                    </gml:LinearRing>

                  </gml:exterior>

                </gml:PolygonPatch>

              </gml:patches>

            </gml:Surface>

          </gml:surfaceMember>

</gml:MultiSurface>

</gml:multiSurfaceProperty>

 

Then i write the xml_fragment to a textfile (after i renamed it as text_line_data)