GEOS  3.14.0dev
PointLocation.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2018 Paul Ramsey <pramsey@cleverlephant.ca>
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: algorithm/PointLocation.java @ 2017-09-04
16  *
17  **********************************************************************/
18 
19 #pragma once
20 
21 #include <geos/export.h>
22 #include <geos/geom/Location.h>
23 #include <vector>
24 
25 namespace geos {
26 
27 namespace geom {
28 class Coordinate;
29 class CoordinateXY;
30 class CoordinateSequence;
31 class Curve;
32 }
33 
34 namespace algorithm { // geos::algorithm
35 
43 class GEOS_DLL PointLocation {
44 public:
45 
54  static bool isOnSegment(const geom::CoordinateXY& p, const geom::CoordinateXY& p0, const geom::CoordinateXY& p1);
55 
65  static bool isOnLine(const geom::CoordinateXY& p, const geom::CoordinateSequence* line);
66 
83  static bool isInRing(const geom::CoordinateXY& p, const std::vector<const geom::Coordinate*>& ring);
84  static bool isInRing(const geom::CoordinateXY& p, const geom::CoordinateSequence* ring);
85 
98  static geom::Location locateInRing(const geom::CoordinateXY& p, const std::vector<const geom::Coordinate*>& ring);
99  static geom::Location locateInRing(const geom::CoordinateXY& p, const geom::CoordinateSequence& ring);
100  static geom::Location locateInRing(const geom::CoordinateXY& p, const geom::Curve& ring);
101 
102 };
103 
104 
105 } // namespace geos::algorithm
106 } // namespace geos
107 
Functions for locating points within basic geometric structures such as lines and rings.
Definition: PointLocation.h:43
static bool isOnSegment(const geom::CoordinateXY &p, const geom::CoordinateXY &p0, const geom::CoordinateXY &p1)
Tests whether a point lies on a line segment.
static bool isOnLine(const geom::CoordinateXY &p, const geom::CoordinateSequence *line)
Tests whether a point lies on the line defined by a CoordinateSequence.
static bool isInRing(const geom::CoordinateXY &p, const std::vector< const geom::Coordinate * > &ring)
Tests whether a point lies inside or on a ring.
static geom::Location locateInRing(const geom::CoordinateXY &p, const std::vector< const geom::Coordinate * > &ring)
Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring....
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25