Skip to main content
Solved

Understanding how to handle multiple geometries in a single table ?

  • June 17, 2022
  • 2 replies
  • 191 views

lifalin2016
Supporter
Forum|alt.badge.img+38

Hi.

When reading multiple geometries from a single table, they're joined together in a single aggregate geometry collection.

The individual geometries can be extracted by using a Deaggregator, with each separate geometry having its original field name as its "name".

Writing multiple geometries back to the table requires the geometries to be aggregated, and a MultipleGeometrySetter set to Yes.

If updating such multiple geometries, I assume that FME extracts each geometry from the aggregate, and updates the (geometry) field values designated by the individual "geometry name" as field name ?

So, if I have a table with 3 geometry fields (A, B, and C), and want to use geometry A to update field C with a new geometry, should I create an aggregate with all 3 (original A and B + new C), or can I just include the new C value in the aggregate when updating ?

Cheers.

Best answer by lifalin2016

Me again :-)

Actually, if you're just updating a single geometry column (in a multi-geometry-column table), one can forego the aggregate and multiple geometries handling in the writer altogether. Just remember to specify the targeted geometry column name specifically in the writer.

This also corrects the wrong projection problem.

If you need to update more than one geometry column, each with a different projection, you may need to do multiple single-geometry-column updates, but that's luckily rather simple by just branching out.

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

lifalin2016
Supporter
Forum|alt.badge.img+38
  • Author
  • Supporter
  • 592 replies
  • June 17, 2022

I did a little testing myself, and it seems, that only the geometry to be updated is needed in the aggregate for writing.

And you have to remember to set the "Handle Multiple Spatial Columns" to Yes on the writer/featurewriter too. And maybe also "Geometry Columns Have Exactly One SRID" has to be set to No.

I also attempted an update with a different projection, but it seems that FME dosn't support this. The value of "Geometry traits"/"Coordsys" cannot be changed, so even if the geometry is in another projection, FME updates doesn't reflect that (green is correct = 25833, red is wrong = 25832):

billede


lifalin2016
Supporter
Forum|alt.badge.img+38
  • Author
  • Supporter
  • 592 replies
  • Best Answer
  • June 21, 2022

Me again :-)

Actually, if you're just updating a single geometry column (in a multi-geometry-column table), one can forego the aggregate and multiple geometries handling in the writer altogether. Just remember to specify the targeted geometry column name specifically in the writer.

This also corrects the wrong projection problem.

If you need to update more than one geometry column, each with a different projection, you may need to do multiple single-geometry-column updates, but that's luckily rather simple by just branching out.