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