Skip to main content
Question

Creating various geometry types dynamically

  • December 13, 2017
  • 3 replies
  • 14 views

Forum|alt.badge.img

Hello

I have 123 CSV files as input with geometries written in WKT format. However, the names of the geometry fields vary as well as the geometry types. E.g. most of the geometries have name 'D_Position' (can be point or line), but there are also some called 'Location' (point), 'Boundary' (polygon) etc.

I tried to solve this with several GeometryReplacer (one for each geometry type) as shown on picture below. I thought that it will be like an 'if else' statement. Try create geometry for D_Position, if not possible (rejected) try Location, if not possible next one etc. But this doesn't seem to work. I get 121 tables going through the 'D_Position' geom replacer, even tables that don't have D_Position field. The remaining two are going to the second replacer because the value of D_position was null.

Any tips please?

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

Forum|alt.badge.img
  • 173 replies
  • December 13, 2017

You may use a StringSearcher to look for POINT, LINESTRING or POLYGON in your various WKT attributes and then route the feature to the correct GeometryReplacer.


Forum|alt.badge.img
  • Author
  • 7 replies
  • December 14, 2017
I added a tester with "Attribute is Missing" (negated) in front of each geometry replacer. That did the trick (though I was hoping that GeometryReplacer will do that automatically)

Forum|alt.badge.img
  • Author
  • 7 replies
  • December 14, 2017

I added a tester with "Attribute is Missing" (negated) in front of each geometry replacer. That did the trick (though I was hoping that GeometryReplacer will do that automatically)