f

Intersecting Polygons and results

```I would like to be able to create a polygon from the interesect
between two polygons, as well as save the remaining area of polygons
that do not fall into the intersections. There is some code below
attempting to perform the intersection between the two polygons.

I am having a programmer block trying to solve this. Any thoughts or

Kelly Dean
Milliken, CO

Sample code using IDLanROI ...

PRO ROIclip

shape1 = FLTarr(2,17)
shape1 [*,0]  = [116.44991,41.441910]
shape1 [*,1]  = [116.57357,41.374821]
shape1 [*,2]  = [116.64723,41.312994]
shape1 [*,3]  = [116.57488,41.002544]
shape1 [*,4]  = [116.36967,40.928878]
shape1 [*,5]  = [116.16840,40.984128]
shape1 [*,6]  = [116.21576,41.053847]
shape1 [*,7]  = [116.06185,41.099889]
shape1 [*,8]  = [116.10263,41.168293]
shape1 [*,9]  = [116.13683,41.214334]
shape1 [*,10] = [116.16577,41.264322]
shape1 [*,11] = [116.18156,41.319572]
shape1 [*,12] = [116.22891,41.344565]
shape1 [*,13] = [116.31442,41.357720]
shape1 [*,14] = [116.29337,41.387976]
shape1 [*,15] = [116.34468,41.422178]
shape1 [*,16] = [116.44991,41.441910]
shape2 = FLTarr(2,6)
shape2 [*,0] = [116.21839,41.528731]
shape2 [*,1] = [116.61698,41.524784]
shape2 [*,2] = [116.72748,41.141984]
shape2 [*,3] = [116.30916,41.203810]
shape2 [*,4] = [116.13552,41.289316]
shape2 [*,5] = [116.21839,41.528731]
xrange = [116.06185 ,116.72748]
yrange = [40.928879 ,41.528732]
PLOT, shape1[0,*], shape1[1,*], \$
xrange = xrange , yrange = yrange, \$
linestyle=3OPLOT, shape2[0,*], shape2[1,*], linestyle = 2
oROI = OBJ_NEW('IDLanROI', shape2 )
pttest = oROI -> ContainsPoints( shape1 )
oROI -> GetProperty, DATA = data
OBJ_DESTROY, oROI
indx = WHERE( pttest GT 0 )
x = shape1[0,indx]
y = shape1[1,indx]
OPLOT, x, y, linestyle = 0

END
```
 0
krdean (60)
2/1/2011 4:47:35 PM
comp.lang.idl-pvwave 12260 articles. 4 followers.

0 Replies
699 Views

Similar Articles

[PageSpeed] 49

Similar Artilces:

polygon intersection routine in IDL
hi, all, I need a routine to get the exact intersection, to be returned as a polygon, of 2 polygons (could be convex or concave) . I did some search and found similar routines from the libs of motley and Dr. D.Faning. but seems not the exact one i am looking for. Is there anybody knows such a routine in IDL? thanks a lot. Weihua In article <1171422915.745198.302630@m58g2000cwm.googlegroups.com>, "Weihua FANG" <weihua.fang@gmail.com> writes: >hi, all, > >I need a routine to get the exact intersection, to be returned as a >polygon, of 2 polygons (could be ...

IDL and IDL-PVWAVE disambiguation
Hi I've noticed that a few open source IDL projects are finding themselves on sourceforge. However, the IDL category seems to have a mixture of both "Interface Definition Language" and "Interactive Data Language". Would it make more sense to have an IDL-PVWAVE category, or perhaps an IDL-ENVI category? https://sourceforge.net/tracker/?func=detail&atid=350001&aid=1821007&group_id=1 Robbie ...

Polygon-Polygon Intersection Test
After an extensive search and going through alot of material I've had very little success. I have a set of verticies of two simple polygons (which can be convex) and I wish to do a test to see whether the two polygons intersect (i.e return a boolean value). I've looked at the Shamos-Hoey Algorithm and had no luck understanding it. Could someone point me in the direction of a easy to understand algorithm which I can implement. Many Thanks p.s I've looked at algorithm 9 on geometryalgorithms.com and I can't seem to follow it (computational geometry is very new to me). okay...

Polygon-Polygon Intersection Test
After an extensive search and going through alot of material I've had very little success. I have a set of verticies of two simple polygons (which can be convex) and I wish to do a test to see whether the two polygons intersect (i.e return a boolean value). I've looked at the Shamos-Hoey Algorithm and had no luck understanding it. Could someone point me in the direction of a easy to understand algorithm which I can implement. Many Thanks p.s I've looked at algorithm 9 on geometryalgorithms.com and I can't seem to follow it (computational geometry is very new to me). Assu...

polygon intersection
hello, i desperately need an algorithm for polygon intersection.. i mean not just knowing whether two polygons intersect, i also need to know the resulting polygons which make up the intersection. i don't care about cases where the intersection is just a point or line. it is to be used in a sample GIS application. i've found this to be rather complex problem, and surprisingly i didn't find ANYTHING on the net, just references to books which i cannot get. could anyone point me to the right direction, provide some links, clues etc. thanks in advance petr krebs "petr kre...

self-intersecting polygons
How do I determine if a set of (x,y) data points creates a non self-intersecting polygon, i.e., a simple polygon? I've looked high and low, and can't find any way to calculate this. In other words, I specify a set of data points, 4, say, and then want the program to determine if those points create a simple or complex polygon. mpalmer <mpalmer@lmi.net> wrote in message <751660637.13876.1295777734003.JavaMail.root@gallium.mathforum.org>... > How do I determine if a set of (x,y) data points creates a non self-intersecting polygon, i.e., a simple polygon? I've look...

intersection polygon cylinder
Hello, i need to verify the intersection of a cylinder and a polygon. what i need as output is just a matrix with 1 (intersect) o 0 (not intersect) For the cylinder i have: Xc Yc Zc; c: center of the cylinder. r: radius delta h: lenght of the cylinder. About polygon, I have: the position in the space vertices. I have an idea, but i would like to know yours, because probably is more efficient than mine ;) thank you Alessandra "Alessandra" wrote in message <jmpchb\$sou\$1@newscl01ah.mathworks.com>... > Hello, > i need to verify the intersection of a cylinder an...

Polygon rectangle intersection
Hello, I am looking for a good algorithm to do polygon/rectangle intersection tests in 2D. So far everything I have found using Google has some feature that doesn't fit my needs. I don't want to do clipping, and I don't need the intersection points; I only need a boolean to tell me whether the rectange and polygon actually intersect. My polygon is not necessarily convex, but it will not have any self-intersections. It may have holes though. Most of the stuff I have found involves convex polygons. Essentially what I am looking for is the algorithm used in the RectInRegion()...

polygon with no edges intersecting
Hi, Suppose, that I have set of random points (x & y). How can the points be connected with no polygon edges intersecting? Is there prepared matlab function to do this? I solve this problem sorting through the angles: ====================== x = rand(10,1); y = rand(10,1); xc = x - mean(x); yc = y - mean(y); [idx, idx] = sort(atan2(xc, yc)); plot(x,y,'.') hold on plot(x([idx;idx(1)]),y([idx;idx(1)])) ====================== Is there better way? best regards Grzegorz I found on the Internet curious site: http://www.geometrylab.de/RandomPolygon/index.html.en...

intersection of line and polygon
I am using the command 'polyxpoly' to find the intersection of a polygon and a line on a map. I want to know how I can generate this line on the map without using cartesian coordinate system i.e., I want to draw a line from one lon,lat to another and find its intersection with a polygon in terms of lat,lon. How can I draw this line. Pls help.Thanx in advance. ...

polygon intersection #2
Hello everybody, I am searching for some implementation of polygon intersection. I have two polygon defined by its vertices and I need function which would returns their intersection. Is there anything available? The C or C++ would be fine. But compiled dll for windows would be ok, too. thanks, Michal http://www.cs.man.ac.uk/~toby/alan/software/ "mike" <kostal.michal@gmail.com> wrote in message news:1130239871.853637.145870@g44g2000cwa.googlegroups.com... > Hello everybody, > I am searching for some implementation of polygon intersection. I > have two polyg...

Intersecting planar polygons
Hi Guys Imagine having two planar polygons in 3D Space. For simplicity's sake, we'll use two rectangles. One given by the following vertices: [0 0 0;1 0 0;1 0 2;0 0 2], and the other given by [0.5 -1 1;1.5 -1 1;1.5 1 1;0.5 1 1]. As you can see, they have an intersection line, in the x/z plane, of length 0.5, from [0.5 0 1] to [1 0 1]. What I'm trying to do, in a first step is to create an algorithm that calculates the endpoints of the intersection between two planar polygons in 3D space automatically. As a second step, I'll try and use the result two split both polygons int...

merging polygons in IDL
Hi guys, Could you please help me with merging 2D polygons in IDL? The target polygons might overlap. Thanks! Bo ...

intersecting multiple polygons
I have a polygon layer (shapefile) with multiple polygons within each polygon. Think of it as pockets of islands spread in a ocean. Few islands together are lumped as one polygon. Now I have a another polygon (say, one island) and I would like to intersect it with those polygons, that have a island below it. I can have the polybool function intersect with each of those multi-poylgons but its too time consuming. I am looking for ways for identifying only those that have some land mass below. I tried to use the bounding-box attribute and many "if", less-than and greater-thans, lo...

Web resources about - Intersecting Polygons and results - comp.lang.idl-pvwave

Intersecting Storage Rings - Wikipedia, the free encyclopedia
The ISR (standing for " Intersecting Storage Rings ") was a particle accelerator at CERN . It was the world's first hadron collider , and ran ...

The Basketball Tournament Finds Success By Intersecting Social Interaction With Athletic Prowess
While many of us have dreamed about sinking the winning shot in the Final Four, it's fantasy for 99.9% of us. However, thanks to one of the more ...

Argo : Intersecting Washington, Hollywood and Tehran
Argo, the gripping new Ben Affleck film, packs a 1-3 punch. The film dramatically connects the dots between people, power and intrigue running ...

Michael Fassbender Joins Terrence Malick's Untitled Intersecting Love Triangles Drama
Having recently wrapped "Knights Of Cups" in L.A., a story about a man's temptations, celebrity and excess that stars Christian Bale, Natalie ...

Photographer Snaps Rare Shot Of Rainbow And Lightning Intersecting Over Arizona Desert
Rainbows and lightning are two very different, but equally beautiful natural phenomena. Real estate agent, storm chaser, and hobby photographer ...

The Definitive Graph of All of Primer's Intersecting Timelines
Still confused by the twists and turns inside Shane Carruth's time traveling indie Primer? Never fear, someone has finally made the ultimate ...

14 photos of beautifully intersecting paths
Last week, we asked you to find and photograph intersecting lines and shapes . The submissions we reviewed showed busy city streets, quiet neighborhood ...

Public and Private Lives, Intersecting
What do you do when a journalistâ€™s spouse or lover is also a newsmaker?

The president's new radio spot targets Virginia traffic and Romney-Ryan plans.

Resources last updated: 2/5/2016 5:14:36 PM