Polygon CCW winding check request

Arnold Rots arots at cfa.harvard.edu
Wed Jun 13 20:34:47 CEST 2018


So, what do you do when you have exactly half a sphere?

-------------------------------------------------------------------------------------------------------------
Arnold H. Rots                                          Chandra X-ray
Science Center
Smithsonian Astrophysical Observatory                   tel:  +1 617 496
7701
60 Garden Street, MS 67                                      fax:  +1 617
495 7356
Cambridge, MA 02138
arots at cfa.harvard.edu
USA
http://hea-www.harvard.edu/~arots/
--------------------------------------------------------------------------------------------------------------


On Wed, Jun 13, 2018 at 2:19 PM, Patrick Dowler <pdowler.cadc at gmail.com>
wrote:

> The intent of DALI was that the butterfly polygon is not valid. We didn't
> say it explicitly and maybe should have.
>
> More generally, the DALI xtype="polygon" is a simple polygon (convex or
> concave) with no crossing segments. We had to decide between picking a
> winding direction or for the polygon to be limited to less that half the
> sphere. At the Capetown interop the decision was to pick CCW winding
> direction and that definition went into DALI-1.1.
>
> Pat
>
> PS-In my experience, that construct was always a bug in the polygon
> generation s/w
>
> PPS-Anyone using postgresql+pgsphere should note that winding direction
> doesn't matter for spoly because that library chose the "less than half the
> sphere" definition
>
> On 13 June 2018 at 01:05, Francois-Xavier PINEAU <
> francois-xavier.pineau at astro.unistra.fr> wrote:
>
>> Dear Marco, DAL,
>>
>> I may be wrong, but I think that the STC definition of the inside of a
>> polygon is not compatible with "complex" shapes.
>>
>> Example: if we take the case of a simple 4 vertices's polygon having a
>> butterfly shape (i.e. having two crossing great-circle arcs), then the
>> inside of one "wing" is in the counter-clockwise sense while the inside of
>> the other "wing" is in the clockwise sense.
>>
>> How to deal easily with such a case while remaining compatible with the
>> STC definition?
>>
>>
>> A polygon is just a sequence of vertices with great-circle arcs
>> connecting the consecutive vertices (plus the last vertex connection the
>> first one).
>>
>> The great-circle arc connecting two vertices's is the smallest of the two
>> complementary great-arcs (and hence is always <= pi (we have a degeneracy
>> with vertices having an angular separation of pi)).
>>
>> There is no ambiguity on the inside and we have fast implementations for
>> polygons having possibly very complex shapes (ray-tracing method).
>>
>> It is true that then the definition does not allow to describe the
>> "exterior" (the complement on the sphere) of a polygon as being itself a
>> polygon. Is it a problem in practice?
>>
>> From my (biased) point-of-view, it is more important to support complex
>> polygons (with a simple and fast algorithm), and to possibly ask for an
>> extra boolean parameter in use cases requiring the complement of a polygon.
>>
>> Do you agree / disagree?
>>
>>
>> Kind regards,
>>
>>
>> François-Xavier
>>
>>
>>
>> Le 12/06/2018 à 17:45, Marco Molinaro a écrit :
>>
>> Dear DAL members,
>> at the recent IVOA Interop in Victoria it was pointed out
>> by Alberto
>>
>> http://wiki.ivoa.net/internal/IVOA/InterOpMayy2018DAL/ivoa_2
>> 01805_micol_polygons.pdf
>>
>> that not all the data providers follow the STC specification
>> about the winding direction of polygons stored in their
>> archives.
>>
>> STC states that "The inside of the region is defined as
>> that part of coordinate space that is encircled by the
>> polygon in a counter-clockwise sense".
>> And this is to be considered when looking at the
>> celestial sphere from the inside.
>>
>> The different behaviour of the polygons stored at
>> different sites creates an interoperability issue.
>>
>> This email is a request on data providers to check
>> on their data and implementations (when dealing
>> with polygons) to solve the presented issue.
>>
>> James also put together a python code snippet
>> implementing a simple test, it is available here:
>>
>> https://gist.github.com/jd-au/45d1cdc0c6e2a7bc848a4be8f46c8958
>>
>> Thank you in advance!
>> Cheers,
>>        Marco & James
>>       (your DAL chair & vice)
>>
>>
>>
>
>
> --
> Patrick Dowler
> Canadian Astronomy Data Centre
> Victoria, BC, Canada
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ivoa.net/pipermail/dal/attachments/20180613/7cdce514/attachment-0001.html>


More information about the dal mailing list