Solved

Create Randomized Points within a Polygon based Attributes values

  • 12 January 2022
  • 6 replies
  • 46 views

Hi,

I have 100 polygons that state the population within each polygon, I'm essentially trying to break it down 1 stage below where I have that population essentially scattered across the polygon boundary in the form of points to then get a rough estimation of the population in small selections (and not for the entire polygon)

 

I saw a question asked very similar to what I need where I have the population value in a field and I would like to add that as an input into the RandomPointGenerator (however this transformer does not accept inputs (aside from the fixed value you state), and this does not seem to have been changed in the 5 years since raising this question).

 

Someone had mentioned the use of workspace runner, but I am not sure how to incorporate that into what I'm trying to do.

icon

Best answer by takashi 12 January 2022, 22:34

View original

6 replies

Userlevel 2
Badge +17

Hi @richard_che​ , if the input attribute value was 100, for instance, you need to generate 100 (exactly or approximately?) points inside the polygon?

Hi @richard_che​ , if the input attribute value was 100, for instance, you need to generate 100 (exactly or approximately?) points inside the polygon?

I guess if it was a close approximation that would work too if it means an easier setup for this kind of process, the exact amount would be preferred

Userlevel 2
Badge +17

A possible approach I can think of is: generate grid points which covers the input area, clip the points by the area, then select required number of points randomly with the Sampler. Spacing of the grid should be enough small so that the required number of points will be within the area.

See the attached workspace example to learn more.

Hope this helps.random-points-within-polygon 

A possible approach I can think of is: generate grid points which covers the input area, clip the points by the area, then select required number of points randomly with the Sampler. Spacing of the grid should be enough small so that the required number of points will be within the area.

See the attached workspace example to learn more.

Hope this helps.random-points-within-polygon 

Hi Takashi,

 

Thank you so much for taking the time to help me out with this. I'm sorry I should have communicated better, I meant to say I'm look to use the attribute field population (of each polygon) as the value to auto generate the points based on the population value.

 

So Although the population for 1 polygon may be 100 where I would want 100 points generated spaced out in that polygon, another polygon may have a population of 263 where I would want 263 points generated spaced out in that polygon.

 

In total there is 100 polygons each with a different population value that I would like to use as the input to determine how many points need to be generated for each polygon.

 

I attempted to do this with the file you kindly provided, however its centered around a fixed input $(NUM_POINTS) which cannot be modified to a field value from my understanding.

Userlevel 2
Badge +17

Hi Takashi,

 

Thank you so much for taking the time to help me out with this. I'm sorry I should have communicated better, I meant to say I'm look to use the attribute field population (of each polygon) as the value to auto generate the points based on the population value.

 

So Although the population for 1 polygon may be 100 where I would want 100 points generated spaced out in that polygon, another polygon may have a population of 263 where I would want 263 points generated spaced out in that polygon.

 

In total there is 100 polygons each with a different population value that I would like to use as the input to determine how many points need to be generated for each polygon.

 

I attempted to do this with the file you kindly provided, however its centered around a fixed input $(NUM_POINTS) which cannot be modified to a field value from my understanding.

OK. I updated the workspace example so that you can specify the number of points with a feature attribute.

See the attachment.

Hi Takashi,

 

Thank you so much for taking the time to help me out with this. I'm sorry I should have communicated better, I meant to say I'm look to use the attribute field population (of each polygon) as the value to auto generate the points based on the population value.

 

So Although the population for 1 polygon may be 100 where I would want 100 points generated spaced out in that polygon, another polygon may have a population of 263 where I would want 263 points generated spaced out in that polygon.

 

In total there is 100 polygons each with a different population value that I would like to use as the input to determine how many points need to be generated for each polygon.

 

I attempted to do this with the file you kindly provided, however its centered around a fixed input $(NUM_POINTS) which cannot be modified to a field value from my understanding.

This is so perfect!!

 

Thank you very much Takashi, I really appreciate you doing this for me.

Reply