Select to view content in your preferred language

Is there a way to stretch a polygon?

7659
11
10-06-2011 01:02 AM
RyanSchuermann
Emerging Contributor
As the title says, I wish to stretch an insanely huge and complex polygon a certain distance X and Y along a constant slope.

One solution would be to move the polygon every 0.001 distance increment, and then perform a merge, but I would rather like to avoid this method... due to distance involved and, I can't just select 2 vertices on one side and move them a set X Y distance due to the millions of vertices involved.

A visual example, The US Great Lakes, as one polygon. I want to stretch that polygon from it's current location, to the south and west (225* azimuth), by a distance of 500 miles. I can move it, but that just gives me 2 polygons, I need all the space in between the orig polygon and the moved polygon to be included.

Another..
_
(_) is my polygon...
I want to stretch it 5 spaces east...
______
(______)
and get something that looks like that as a result

How do I accomplish this?

Thanks
Tags (2)
0 Kudos
11 Replies
RyanSchuermann
Emerging Contributor

Maybe you don't really mean stretched at all? Perhaps "swept area" might be a better term?
Why do you need 3000 steps if the movement is linear?


yes, swept! That's the term!  3000 sweeps per object was a low ball number, calculated from a sweep once an hour. Better results would be at 20min intervals resulting in 7,655 sweeps per polygon. Take the sun's angle and azimuth every 20 minutes from 10am to 5pm, every day, for a year. 21x365 = 7,665. Convert all 7,665 to raster, classify it to nominal data, and use raster calc, and you now have a shade index value for every point surrounding a polygon. I just happen to need this for 1M+ polygons.


If it is a linear swept area, all you have to do is convert the vertices to points, copy a set to the final position, join the from-dots to the to-dots at the sides and build a new polygon.
The swept area will have the shape of the front and back preserved with straight sides.


join them at the sides.. is there a way to calculate the 'side point'? Like, take the azimuth, find the point farthest from the slope (pos and negative)?

I'm a little worried about loosing the orig polygon shape when going from polygon to point to line back to polygon. I just hope that the step of building new polygons is smart enough to rebuild them properly.

As long as the vertices turned to points all have a unique value to associate them with the specific polygon they were generated from... the rebuilding should be correct....right? I know X-Tools uses a unique field value to build polylines from points, I would assume the same is true for polygons, but you wouldn't need an order to the points in addition to the unique field? so it knows which vertex connected to which?

..wonder if anyone has already written a sweep tool...to me it seems like a basic concept. I just couldn't figure out how to visualize the steps.

I'll run with it, thanks!
0 Kudos
KimOllivier
Honored Contributor
Finally we have got a good description of the problem!

The method  only needs 2 vertices from the millions. That simplifies creating the path from the sun angles considerably.

I only used the points to find the outer pairs and generate the swept area. I then unioned the original polygon and a moved copy. There would be better ways of finding them instead of by inspection as I did for the proof of concept. That is a red-herring in the end, no need for points.

To find the max and min sides there are a number of coordinate geometry solutions.

One easy non-algebraic way would be to rotate the polygon(s) by the final angle and find the bounding box to find the two points/vertices, or just the min and max y. These are the only two points that need to be extended by the path to create the swept area.

Creating the paths is just a matter of using the table of azimith, dx values to accumulate x,y pairs.

This whole solution works because there is no rotation of the polygon.

But if you want to calculate a sun shadow from 3D features there is already a tool in 3D Analyst
"Feature Shadow Volume" that will take a range of times, for a whole year in necessary.
0 Kudos