comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Area intersection of two trapezoids with given coordinates
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Area intersection of two trapezoids with given coordinates [message #56787] Fri, 16 November 2007 18:44 Go to next message
mrosimmel is currently offline  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 Go to previous messageGo to next message
Bringfried Stecklum is currently offline  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 #56855 is a reply to message #56787] Sun, 18 November 2007 19:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> 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

Read "indices" for "vertices". Too much hiking combined
with painting today. :-(

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 #56856 is a reply to message #56787] Sun, 18 November 2007 19:27 Go to previous messageGo to next message
David Fanning is currently offline  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 Go to previous messageGo to next message
Vince Hradil is currently offline  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 Go to previous message
mrosimmel is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: machine learning
Next Topic: logarithmic axis lables

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:09:43 PDT 2025

Total time taken to generate the page: 1.28066 seconds