Comments and answers for "Create Random Points with based Attributes values" https://knowledge.safe.com/questions/55164/create-random-points-with-based-attributes-values.html The latest comments and answers for the question "Create Random Points with based Attributes values" Answer by gio https://knowledge.safe.com/answers/55274/view.html

refined the workbench to cope with more complex forms.

At resolution of 50 all 100 points are inside in 1 go!

random-point-in-polygons.fmw

星期二, 10 Oct 2017 20:15:04 GMT gio
Comment by gio on gio's answer https://knowledge.safe.com/comments/55266/view.html
for instance


星期二, 10 Oct 2017 19:22:50 GMT gio
Answer by gio https://knowledge.safe.com/answers/55262/view.html

@venu

this will prevent you having to do lots of iterations when using complex shapes:random-point-in-polygons.fmw

No iteration, just setting high enough resolution in grid builder...

星期二, 10 Oct 2017 18:37:56 GMT gio
发表评论david_r david_r的回答 https://knowledge.safe.com/comments/55200/view.html Great find! 星期二, 10 Oct 2017 13:15:49 GMT david_r Answer by sander https://knowledge.safe.com/answers/55199/view.html

There already seems to be a custom transformer on FME Hub (by @takashi, unsurprisingly) that might be helpful here.

星期二, 10 Oct 2017 13:14:30 GMT sander
Answer by david_r https://knowledge.safe.com/answers/55170/view.html

A possible solution could include

  • Cloner to create multiple features, e.g. 121 Sand features for block A.
  • BoundsExtractor to get min/max X/Y values for the polygon
  • Two RandomNumberGenerators to generate min/max X/Y values inside the bounds and a VertexCreator to create a point based on those values
  • SpatialFilter to check if random point is inside (if not, loop) if the blocks aren't perfectly rectangular and oriented north/south

星期二, 10 Oct 2017 07:31:54 GMT david_r