<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div>Yes Arnold, I fully agree.<div class=""><br class=""></div><div class="">SELECT AREA(INTERSECTION(region1, region2)) </div><div class=""><br class=""></div><div class="">is indeed what we want. Much more flexible.</div><div class="">Let me then rephrase my request:</div><div class=""><br class=""></div><div class="">Can we add in ADQL an INTERSECTION function</div><div class="">which returns the polygon intersection of two regions?</div><div class=""><br class=""></div><div class="">Alberto</div><div class="">PS: We did try the INTERSECTION way, but a problem with the underlying library stopped us.</div><div class="">Our user-defined function returned a value whose type was interpreted as UNKNOWN</div><div class="">instead of REGION by that library, and that is why we went for a function</div><div class="">that computed the area of the intersection of the two input regions instead.</div><div class="">Much more inflexible indeed, though that solved our immediate problem.</div><div class="">Sorry to have been sidetracked by what is only a library issue!</div><div class="">Thanks Arnold!</div><div class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 07 Jun 2017, at 19:29, Arnold Rots <<a href="mailto:arots@cfa.harvard.edu" class="">arots@cfa.harvard.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">I was going to ask: doesn't it make more sense to define two functions:<br class=""></div>1. return the intersection of two regions<br class=""></div>2. return the area of a region<br class=""></div>The combination of the two provides Alberto's area of the intersection<br class=""></div>and separately they provide more functionality.<br class=""></div>One might of course want to add:<br class=""></div>3. return the union of two regions<br class=""><br class=""></div>Cheers,<br class=""><br class=""></div> - Arnold<br class=""></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">-------------------------------------------------------------------------------------------------------------<br class="">Arnold H. Rots Chandra X-ray Science Center<br class="">Smithsonian Astrophysical Observatory tel: +1 617 496 7701<br class="">60 Garden Street, MS 67 fax: +1 617 495 7356<br class="">Cambridge, MA 02138 <a href="mailto:arots@cfa.harvard.edu" target="_blank" class="">arots@cfa.harvard.edu</a><br class="">USA <a href="http://hea-www.harvard.edu/~arots/" target="_blank" class="">http://hea-www.harvard.edu/~arots/</a><br class="">--------------------------------------------------------------------------------------------------------------<br class=""><br class=""></div></div></div>
<br class=""><div class="gmail_quote">On Wed, Jun 7, 2017 at 1:15 PM, Walter Landry <span dir="ltr" class=""><<a href="mailto:wlandry@caltech.edu" target="_blank" class="">wlandry@caltech.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">alberto micol <<a href="mailto:amicol.ivoa@googlemail.com" class="">amicol.ivoa@googlemail.com</a>> wrote:<br class="">
> Dear All,<br class="">
</span>> cc: Bruno, for the Standing Committee on Science Priorities <<a href="http://wiki.ivoa.net/twiki/bin/view/IVOA/IvoaSciencePriorities" rel="noreferrer" target="_blank" class="">http://wiki.ivoa.net/twiki/<wbr class="">bin/view/IVOA/<wbr class="">IvoaSciencePriorities</a>><br class="">
<span class="">><br class="">
> The following science use case cannot be accomplished without a new ADQL function:<br class="">
><br class="">
> I want to find images of the Galactic Centre in two bands (J and H) provided that the images<br class="">
> in the 2 bands overlap, in order to get the colours (J-H) of the sources imaged by both.<br class="">
> The overlapping region must be big enough so that I can detect sources<br class="">
> in both images: an overlap of, say, 0.001 square degrees would be irrelevant for my science case.<br class="">
><br class="">
> I’ll show in the PS how this can be achieved using ObsCore with a user-defined function.<br class="">
><br class="">
> The issue is that, to avoid images just “touching” each other, we had to create a user-defined function<br class="">
> that computes the area of the intersection of the two regions.<br class="">
><br class="">
> Issues: (1) only those users that read the documentation or the TAPRegExt will know<br class="">
> that such functionality exists, and (2) this function cannot be used when querying other data centres.<br class="">
><br class="">
> Can I suggest to introduced a new function in ADQL 2.1 which can be used to compute<br class="">
> the area of the intersections between two regions?<br class="">
<br class="">
</span>It sounds like what you actually want is the distance to the edge, not<br class="">
the overlap area. I needed something like that. We wanted the "most<br class="">
centered" image, so we sort results by the distance to the edge. It<br class="">
required a bit of hacking on our end.<br class="">
<br class="">
With that said, I am not a fan of new functions that can not be<br class="">
implemented via simple rewriting on GIS backends.<br class="">
<br class="">
Cheers,<br class="">
Walter Landry<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></body></html>