Skip to main content

I have multiple site template polygons, with various dimensions. Let's say I have 2 polygons that are 100' x 100' and 200' x 200'. I then have multiple parcels that I need to see if any of the site templates fit inside the parcel polygons, no matter the orientation of the site.

 

What would be the best method to determine this? The outcome would be finding which site template, if any, would fit and the orientation within the parcel polygon.

This may be possible in FME, following an algorithm like this:

  1. Create a point grid inside the parcels
  2. Move a copy of each site template to every grid point (put the center of the site template on the grid point)
  3. Create copies of these copies, and rotate each copy with a different rotation angle around its center point
  4. Determine the site templates from step 3 that are completely within the parcels

Note that this algorithm creates many many temporary objects in step 3.

Some thoughts on optimalization:

  • You probably can reduce the number of grid points, as some grid points are too close to the edge of the parcels for a possible fit of the site templates. So it may be possible to inwardly buffer the parcels before creating the point grid. This is certainly the case with your site templates, as they are squares.
  • The accuracy of this algorithm depends on the distance between the points in the point grid and the step size of rotating the site templates. Smaller values increase the possibility of finding fits, but also create many more temporary objects.
  • Your example site templates are squares, so you can suffice with fewer copies in step 3 (after applying a rotation of 90 degrees around the center point you get the original site template).

 


This may be possible in FME, following an algorithm like this:

  1. Create a point grid inside the parcels
  2. Move a copy of each site template to every grid point (put the center of the site template on the grid point)
  3. Create copies of these copies, and rotate each copy with a different rotation angle around its center point
  4. Determine the site templates from step 3 that are completely within the parcels

Note that this algorithm creates many many temporary objects in step 3.

Some thoughts on optimalization:

  • You probably can reduce the number of grid points, as some grid points are too close to the edge of the parcels for a possible fit of the site templates. So it may be possible to inwardly buffer the parcels before creating the point grid. This is certainly the case with your site templates, as they are squares.
  • The accuracy of this algorithm depends on the distance between the points in the point grid and the step size of rotating the site templates. Smaller values increase the possibility of finding fits, but also create many more temporary objects.
  • Your example site templates are squares, so you can suffice with fewer copies in step 3 (after applying a rotation of 90 degrees around the center point you get the original site template).

 

Why the gridpoints instead of the vectordata? You also could move and rotate an area in a area, clip it, check if clipped.


This may be possible in FME, following an algorithm like this:

  1. Create a point grid inside the parcels
  2. Move a copy of each site template to every grid point (put the center of the site template on the grid point)
  3. Create copies of these copies, and rotate each copy with a different rotation angle around its center point
  4. Determine the site templates from step 3 that are completely within the parcels

Note that this algorithm creates many many temporary objects in step 3.

Some thoughts on optimalization:

  • You probably can reduce the number of grid points, as some grid points are too close to the edge of the parcels for a possible fit of the site templates. So it may be possible to inwardly buffer the parcels before creating the point grid. This is certainly the case with your site templates, as they are squares.
  • The accuracy of this algorithm depends on the distance between the points in the point grid and the step size of rotating the site templates. Smaller values increase the possibility of finding fits, but also create many more temporary objects.
  • Your example site templates are squares, so you can suffice with fewer copies in step 3 (after applying a rotation of 90 degrees around the center point you get the original site template).

 

The points of the grid serve as destinations for moving (copies of) the site templates.

I thought I would give it a try, as there were no reactions to this question after almost a week.

I am certain there are other, better solutions.


Thanks @nielsgerrits​ and @geomancer​ ! What I ended up doing first was by creating a point grid and then rotating it 360 with different angle increments, etc. I will try the other solution as well. There are so many ways to accomplish this, so it will just take some trial and error to optimize it as much as possible. I appreciate the help.


Thanks for the feedback.

When I tried to implement the ideas I mentioned above, I was surprised at the enormous amount of candidate boxes (which is how I called the site template polygons).

Fit_to_ParcelsThis workspace can certainly be improved. Good luck!


Reply