Question

Creating various geometry types dynamically

  • 13 December 2017
  • 3 replies
  • 1 view

Badge

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?


3 replies

Badge

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.

Badge
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)
Badge

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)

Reply