Skip to main content
Question

XML Templater Grouping

  • September 10, 2019
  • 2 replies
  • 41 views

deanhowell
Influencer
Forum|alt.badge.img+24

Hello all,

I am trying to create an XML file that has a structure where there is a single plan, non-spatial, that has one or more polygon features(parcels). Each polygon feature is made up of multiple line which in turn is made up of multiple points.

 

The plan is a database table without any geometry so I have done a feature merge using the bounding box of the parcels. I then chop the parcels into points and lines and feed the three outputs into the XML templater, using the plan as the root feature.

What I am trying to acheive is the following

 

Plan

Parcel 1

Line 1

Line 2

Line 3

Line 4

Parcel 2

Line 5

Line 6

Line 7

Line 8

 

Point 1

Point 2

...

Point n

 

but what is coming out is a list of all lines rather than just the lines for the individual parcel.

 

Plan

Parcel 1

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

Parcel 2

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

Line 5

Line 6

Line 7

Line 8

 

Point 1

Point 2

...

Point n

 

I have tried grouping but that then seems to have affects on other features.

Attached is my XML workspace.

Any tips would be greatly appreciated.

 

Regards

 

Dean

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.

2 replies

takashi
Celebrity
  • 7843 replies
  • September 10, 2019

Hi @deanhowell, if "parcelid" is unique ID for each parcel and lines derived from a parcel have the same "parcelid", this expression groups lines by "parcelid".

...
    <lines>
    {fme:process-features("LINES", "parcelid", fme:get-attribute("parcelid"))}
    </lines>
...

See here to learn more how to use the "fme:process-features": XQuery Functions


deanhowell
Influencer
Forum|alt.badge.img+24
  • Author
  • Influencer
  • 315 replies
  • September 10, 2019

Hi @deanhowell, if "parcelid" is unique ID for each parcel and lines derived from a parcel have the same "parcelid", this expression groups lines by "parcelid".

...
    <lines>
    {fme:process-features("LINES", "parcelid", fme:get-attribute("parcelid"))}
    </lines>
...

See here to learn more how to use the "fme:process-features": XQuery Functions

Thanks @takashi, that worked a treat. I must have tried a hundred variations yesterday :) thanks again.