MongoDB Reader creates Geometry Collections if the mongo collection contains more than one geometry field. Is there a way to choose which one of these fields should be treated as a geometry?
Page 1 / 1
I am not sure if there is a way to solve this within the Reader itself, but I have come up with a couple potential solutions that may help you.
- You could use a Deaggregator after the Reader followed by your choice of filter. Examples:
- If the input feature has geometry fields with different geometry types, a GeometryFilter after the Deaggregator worked well in my test.
- If the input feature has two or more geometry fields which are the same geometry type, but are named differently, an AttributeFilter could be used. In this case I filtered on the “_geometry_name” attribute created by the Deaggregator.
- You could use a GeometryPartExtractor after the Reader to select which geometry you want. In my tests I successfully utilized the GeometryPartExtractor to perform the same functions as the Deaggregator + Filter of choice.