diff options
Diffstat (limited to 'src/mbgl/util/geometry_within.hpp')
-rw-r--r-- | src/mbgl/util/geometry_within.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mbgl/util/geometry_within.hpp b/src/mbgl/util/geometry_within.hpp new file mode 100644 index 0000000000..fe9312cd4a --- /dev/null +++ b/src/mbgl/util/geometry_within.hpp @@ -0,0 +1,19 @@ +#pragma once +#include <mbgl/util/geometry.hpp> + +namespace mbgl { + +void printPolygon(const Polygon<double>& polygon); + +void printLine(const LineString<double>& lineString); + +// ray casting algorithm for detecting if point is in polygon +bool pointWithinPolygon(const Point<double>& point, const Polygon<double>& polygon); + +bool pointWithinPolygons(const Point<double>& point, const MultiPolygon<double>& polygons); + +bool lineStringWithinPolygon(const LineString<double>& lineString, + const Polygon<double>& polygon); + +bool lineStringWithinPolygons(const LineString<double>& line, const MultiPolygon<double>& polygons); +} |