## jts-topo-suite-user

 [Jts-topo-suite-user] Question about GeometryFactory.toGeometry From: Felix Obermaier - 2012-10-23 12:08:12 ```Hello, up to version 1.9 GeometryFactory's toGeometry(Envelope envelope) function used to return a counterclockwise polygon for areal geometries. Starting with version 1.10, JTS returns clockwise polygons for these (excerpt form the JTS Version History.html): - Fixed GeometryFactory.toGeometry(Envelope) to return a CW polygon As I cannot find the relevant discussion on this mailing list (if there was one), what was the motivation behind this. The OGC Simple Feature - Access spec. (1.2.1) defines it the other way around. Chapter 6.1.2.2 ... Envelope ( ): Geometry - The minimum bounding box for this Geometry, returned as a Geometry. The polygon is defined by the corner points of the bounding box [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)]. Minimums for Z and M may be added. The simplest representation of an Envelope is as two direct positions, one containing all the minimums, and another all the maximums. In some cases, this coordinate will be outside the range of validity for the Spatial Reference System. ... Chapter 6.1.11.1 ... The exterior boundary LinearRing defines the "top" of the surface which is the side of the surface from which the exterior boundary appears to traverse the boundary in a counter clockwise direction. The interior LinearRings will have the opposite orientation, and appear as clockwise when viewed from the "top", Thanks for you attention Felix Obermaier ------------------------------------------ Ingenieurgruppe IVV GmbH & Co. KG Dipl.-Ing. Felix Obermaier Oppenhoffallee 171 52066 Aachen Telefon: +49 (241) 94691-36 Telefax: +49 (241) 531622 eMail: obe@... Internet: http://www.ivv-aachen.de Sitz der Gesellschaft: Aachen Amtsgericht Aachen HRA 6212 GF: Bauassessor Dr.-Ing. Dieter Hölsken IVV-Management GmbH Amtsgericht Aachen HRB 12453 ```
 Re: [Jts-topo-suite-user] Question about GeometryFactory.toGeometry From: Martin Davis - 2012-10-23 16:58:33 ```The original version of the Simple Features for SQL specification did not define a canonical orientation for polygon rings. When JTS was originally designed the choice was made to have the canonical orientations be CW for exterior rings and CCW for interior rings. (This was not arbitrary - it followed the convention used in the ESRI SDE). It seems like subsequent versions of the OGC specs have chosen to specify an orientation convention, and unfortunately they chose the opposite one to JTS. The change to GeometryFactory's toGeometry(Envelope envelope) was made to be consistent with the rest of JTS. It has occurred to me that it might be useful to make the canonical orientation selectable by the user (on a library-wide basis). JTS never assumes any particular orientation for input, so this is mostly a matter of reversing output rings where required. Of course, the user can do this themselves if necessary. On Tue, Oct 23, 2012 at 5:07 AM, Felix Obermaier wrote: > Hello, > up to version 1.9 GeometryFactory's toGeometry(Envelope envelope) function used to return a counterclockwise polygon for areal geometries. > Starting with version 1.10, JTS returns clockwise polygons for these (excerpt form the JTS Version History.html): > - Fixed GeometryFactory.toGeometry(Envelope) to return a CW polygon > > As I cannot find the relevant discussion on this mailing list (if there was one), what was the motivation behind this. > The OGC Simple Feature - Access spec. (1.2.1) defines it the other way around. > Chapter 6.1.2.2 > ... > Envelope ( ): Geometry - The minimum bounding box for this Geometry, returned as a Geometry. The polygon is defined by the corner points of the bounding box [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)]. Minimums for Z and M may be added. The simplest representation of an Envelope is as two direct positions, one containing all the minimums, and another all the maximums. In some cases, this coordinate will be outside the range of validity for the Spatial Reference System. > ... > > Chapter 6.1.11.1 > ... > The exterior boundary LinearRing defines the "top" of the surface which is the side of the surface from which the exterior boundary appears to traverse the boundary in a counter clockwise direction. The interior LinearRings will have the opposite orientation, and appear as clockwise when viewed from the "top", > > > Thanks for you attention > Felix Obermaier > > ------------------------------------------ > Ingenieurgruppe IVV GmbH & Co. KG > Dipl.-Ing. Felix Obermaier > Oppenhoffallee 171 > 52066 Aachen > > Telefon: +49 (241) 94691-36 > Telefax: +49 (241) 531622 > eMail: obe@... > Internet: http://www.ivv-aachen.de > > Sitz der Gesellschaft: Aachen > Amtsgericht Aachen HRA 6212 > GF: Bauassessor Dr.-Ing. Dieter Hölsken > IVV-Management GmbH > Amtsgericht Aachen HRB 12453 > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Jts-topo-suite-user mailing list > Jts-topo-suite-user@... > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user ```