Skip to main content
Solved

Create Random Points with based Attributes values

  • October 10, 2017
  • 6 replies
  • 116 views

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

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.

View original
Did this help you find an answer to your question?

6 replies

david_r
Evangelist
  • 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
  • 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
Evangelist
  • October 10, 2017
geosander wrote:

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
  • 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
  • October 10, 2017
gio wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings