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 }
00035 }
00036
00037 namespace geos {
00038 namespace algorithm {
00039
00057 class GEOS_DLL PointLocator {
00058 public:
00059 PointLocator() {}
00060 ~PointLocator() {}
00061
00072 int locate(const geom::Coordinate& p, const geom::Geometry *geom);
00073
00082 bool intersects(const geom::Coordinate& p, const geom::Geometry *geom) {
00083 return locate(p, geom) != geom::Location::EXTERIOR;
00084 }
00085
00086 private:
00087
00088 bool isIn;
00089
00090 int numBoundaries;
00091
00092 void computeLocation(const geom::Coordinate& p, const geom::Geometry *geom);
00093
00094 void updateLocationInfo(int loc);
00095
00096 int locate(const geom::Coordinate& p, const geom::LineString *l);
00097
00098 int locateInPolygonRing(const geom::Coordinate& p, const geom::LinearRing *ring);
00099
00100 int locate(const geom::Coordinate& p, const geom::Polygon *poly);
00101
00102 };
00103
00104 }
00105 }
00106
00107
00108 #endif // GEOS_ALGORITHM_POINTLOCATOR_H
00109