GEOS  3.8.0dev
Public Types | Static Public Member Functions | List of all members
geos::algorithm::Orientation Class Reference

#include <Orientation.h>

Public Types

enum  {
  LEFT = 1, STRAIGHT = 0

Static Public Member Functions

static int index (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q)
static bool isCCW (const geom::CoordinateSequence *ring)

Detailed Description

Functions to compute the orientation of basic geometric structures including point triplets (triangles) and rings. Orientation is a fundamental property of planar geometries (and more generally geometry on two-dimensional manifolds).

Orientation is notoriously subject to numerical precision errors in the case of collinear or nearly collinear points. JTS uses extended-precision arithmetic to increase the robustness of the computation.

Martin Davis

Member Function Documentation

static bool geos::algorithm::Orientation::isCCW ( const geom::CoordinateSequence ring)

Computes whether a ring defined by an array of Coordinates is oriented counter-clockwise.

  • The list of points is assumed to have the first and last points equal.
  • This will handle coordinate lists which contain repeated points.

This algorithm is *only<* guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct.

ringan array of Coordinates forming a ring
true if the ring is oriented counter-clockwise.
IllegalArgumentExceptionif there are too few points to determine orientation (< 4)

The documentation for this class was generated from the following file: