Skip to main content

Is there a way to extract a specific part of an aggregate by it's index other than deaggregating and testing the resulting features to find the one where _part_number = index.

I'm thinking there might be a way to use XQuery/GeometryPartExtractor

Not really an answer as its just a different way of doing it, but what about using the GeometryExtractor to record the geometry as an attribute,before the aggregation (assuming you are doing this in a step prior) and then just using a ListIndexer and a GeometryReplacer to get the specific geometry you want.


Not really an answer as its just a different way of doing it, but what about using the GeometryExtractor to record the geometry as an attribute,before the aggregation (assuming you are doing this in a step prior) and then just using a ListIndexer and a GeometryReplacer to get the specific geometry you want.

I have done that in the past, when I was creating the aggregate at a prior stage in the workflow.

 

 

In this particular case, the data input is already aggregated.

 

 


Hi @jdh, yes, you can use the GeometryPartExtractor (Advanced Editor). This is a possible syntax if the input geometry is a one level aggregate or a Multi geometry. Just be aware that a part of the aggregate has to be specified with 1-based index.

(: extract the 2nd part from a one level aggregate or a multi :)
number(/geometry/geometryg2]/@fme_id)

Hi @jdh, yes, you can use the GeometryPartExtractor (Advanced Editor). This is a possible syntax if the input geometry is a one level aggregate or a Multi geometry. Just be aware that a part of the aggregate has to be specified with 1-based index.

(: extract the 2nd part from a one level aggregate or a multi :)
number(/geometry/geometryg2]/@fme_id)
Thank you.   That's exactly what I needed.

Hi @jdh, yes, you can use the GeometryPartExtractor (Advanced Editor). This is a possible syntax if the input geometry is a one level aggregate or a Multi geometry. Just be aware that a part of the aggregate has to be specified with 1-based index.

(: extract the 2nd part from a one level aggregate or a multi :)
number(/geometry/geometryg2]/@fme_id)
Minor issue with the advanced editor, when you reference a feature attribute using the left panel it does not wrap the attribute name in quotes as required.  

 

{fme:get-attribute(x)}  instead of {fme:get-attribute("x")}

 


Minor issue with the advanced editor, when you reference a feature attribute using the left panel it does not wrap the attribute name in quotes as required.

 

{fme:get-attribute(x)} instead of {fme:get-attribute("x")}

 

yeah, have to say it's a kind of bug. @daleatsafe, please fix it.
yeah, have to say it's a kind of bug. @daleatsafe, please fix it.

 

Seems like a quick fix...thanks for pointing it out.

 

Seems like a quick fix...thanks for pointing it out.
There should be a case for it, as I pointed it out to support this morning.

 

 


There should be a case for it, as I pointed it out to support this morning.

 

 

And the fix is going in as I type this. Wish everything was that easy.... Thanks for pointing it out.

 

 


And the fix is going in as I type this. Wish everything was that easy.... Thanks for pointing it out.

 

 

Quick update, the fix is available in the latest FME 2017 beta (b17212+).

 

 


Reply