Skip to main content
Solved

Create Random Points with based Attributes values

  • October 10, 2017
  • 6 replies
  • 154 views

venu
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 44 replies

Dear All,

I have 6 Polygons in one shapefile with Name Block A to Block F.

Also, I have one excel file for materials location like shown below screenshot.

my aim needs to create a random point within the polygon as per the values mentioned in the table.

For Example:

121 Sand Random points for Block A polygon

6182 Sand Random points for Block B polygon

1 Cement Random points for Block A polygon

210 Cement Random points for Block B polygon

all points if possible one single shp file.

Thanks in Advance

Venu

Best answer by geosander

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

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.

6 replies

david_r
Celebrity
  • 8394 replies
  • October 10, 2017

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


geosander
Forum|alt.badge.img+7
  • 327 replies
  • Best Answer
  • October 10, 2017

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


david_r
Celebrity
  • 8394 replies
  • October 10, 2017

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

Great find!

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 10, 2017

@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...


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 10, 2017

@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...

 

for instance

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 10, 2017

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