00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_ALGORITHM_POINTLOCATOR_H
00021 #define GEOS_ALGORITHM_POINTLOCATOR_H
00022
00023 #include <geos/export.h>
00024 #include <geos/geom/Location.h>
00025
00026
00027 namespace geos {
00028 namespace geom {
00029 class Coordinate;
00030 class Geometry;
00031 class LinearRing;
00032 class LineString;
00033 class Polygon;
00034 class Point;
00035 }
00036 }
00037
00038 namespace geos {
00039 namespace algorithm {
00040
00058 class GEOS_DLL PointLocator {
00059 public:
00060 PointLocator() {}
00061 ~PointLocator() {}
00062
00073 int locate(const geom::Coordinate& p, const geom::Geometry *geom);
00074
00083 bool intersects(const geom::Coordinate& p, const geom::Geometry *geom) {
00084 return locate(p, geom) != geom::Location::EXTERIOR;
00085 }
00086
00087 private:
00088
00089 bool isIn;
00090
00091 int numBoundaries;
00092
00093 void computeLocation(const geom::Coordinate& p, const geom::Geometry *geom);
00094
00095 void updateLocationInfo(int loc);
00096
00097 int locate(const geom::Coordinate& p, const geom::Point *pt);
00098
00099 int locate(const geom::Coordinate& p, const geom::LineString *l);
00100
00101 int locateInPolygonRing(const geom::Coordinate& p, const geom::LinearRing *ring);
00102
00103 int locate(const geom::Coordinate& p, const geom::Polygon *poly);
00104
00105 };
00106
00107 }
00108 }
00109
00110
00111 #endif // GEOS_ALGORITHM_POINTLOCATOR_H
00112