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
suggestions would be helpful.
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
|