Area intersection of two trapezoids with given coordinates [message #56787] |
Fri, 16 November 2007 18:44  |
mrosimmel
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
Hello all,
I was wondering if there is a function in IDL that I can find the
intersection area of two trapezoids with given corner coordinates.
Briefly I have two trapezoids where the first one has corners of
(x1,y1), (x2,y2), (x3,y3), (x4,y4) and the second one has corners of
(a1,b1), (a2,b2), (a3,b3), (a4,b4)...I know ARCGIS has such functions
(like union/intersection).. If not could anyone have an idea how can I
do it in IDL?
Thanks all,
Mario
|
|
|
Re: Area intersection of two trapezoids with given coordinates [message #56842 is a reply to message #56787] |
Tue, 20 November 2007 03:22   |
Bringfried Stecklum
Messages: 75 Registered: January 1996
|
Member |
|
|
mrosimmel@gmail.com wrote:
> Hello all,
>
> I was wondering if there is a function in IDL that I can find the
> intersection area of two trapezoids with given corner coordinates.
> Briefly I have two trapezoids where the first one has corners of
> (x1,y1), (x2,y2), (x3,y3), (x4,y4) and the second one has corners of
> (a1,b1), (a2,b2), (a3,b3), (a4,b4)...I know ARCGIS has such functions
> (like union/intersection).. If not could anyone have an idea how can I
> do it in IDL?
> Thanks all,
>
> Mario
Dear Mario,
by accident I came across this page
http://www.mporzio.astro.it/~licausi/IDL_Library/lib_index.h tml
which seems to offer what you are looking for (OVERLAP.PRO).
regards,
Bringfried Stecklum
|
|
|
|
Re: Area intersection of two trapezoids with given coordinates [message #56856 is a reply to message #56787] |
Sun, 18 November 2007 19:27   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
mrosimmel@gmail.com writes:
> I was wondering if there is a function in IDL that I can find the
> intersection area of two trapezoids with given corner coordinates.
> Briefly I have two trapezoids where the first one has corners of
> (x1,y1), (x2,y2), (x3,y3), (x4,y4) and the second one has corners of
> (a1,b1), (a2,b2), (a3,b3), (a4,b4)...I know ARCGIS has such functions
> (like union/intersection).. If not could anyone have an idea how can I
> do it in IDL?
If these trapezoids have to do, for example, with
images, you can use POLYFILLV to get a list of
all the vertices inside them. Then you can perform
set operations on the vertices:
http://www.dfanning.com/tips/set_operations.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Area intersection of two trapezoids with given coordinates [message #56857 is a reply to message #56787] |
Sun, 18 November 2007 19:22   |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
Can't this be solved analytically using trigonometry? If you want to
do it numerically you could just make two masks using WHERE() then do
AND to the get the intersection.
mrosim...@gmail.com wrote:
> Hello all,
>
> I was wondering if there is a function in IDL that I can find the
> intersection area of two trapezoids with given corner coordinates.
> Briefly I have two trapezoids where the first one has corners of
> (x1,y1), (x2,y2), (x3,y3), (x4,y4) and the second one has corners of
> (a1,b1), (a2,b2), (a3,b3), (a4,b4)...I know ARCGIS has such functions
> (like union/intersection).. If not could anyone have an idea how can I
> do it in IDL?
> Thanks all,
>
> Mario
|
|
|
Re: Area intersection of two trapezoids with given coordinates [message #56954 is a reply to message #56842] |
Tue, 27 November 2007 09:21  |
mrosimmel
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
On Nov 20, 6:22 am, Bringfried Stecklum <steck...@tls-tautenburg.de>
wrote:
> mrosim...@gmail.com wrote:
>> Hello all,
>
>> I was wondering if there is a function in IDL that I can find the
>> intersection area of two trapezoids with given corner coordinates.
>> Briefly I have two trapezoids where the first one has corners of
>> (x1,y1), (x2,y2), (x3,y3), (x4,y4) and the second one has corners of
>> (a1,b1), (a2,b2), (a3,b3), (a4,b4)...I know ARCGIS has such functions
>> (like union/intersection).. If not could anyone have an idea how can I
>> do it in IDL?
>> Thanks all,
>
>> Mario
>
> Dear Mario,
>
> by accident I came across this page
>
> http://www.mporzio.astro.it/~licausi/IDL_Library/lib_index.h tml
>
> which seems to offer what you are looking for (OVERLAP.PRO).
>
> regards,
>
> Bringfried Stecklum
Hi Bringfried,
Thank you very much for the web site.
I have been trying to write that script myself for almost two weeks.
The overlap.pro does exactly what I wanted with much better precision
than my own script.
Once again thanks everybody for your help.
Regards,
Mario
|
|
|