00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_ALGORITHM_POINTLOCATOR_H
00022 #define GEOS_ALGORITHM_POINTLOCATOR_H
00023
00024 #include <geos/export.h>
00025 #include <geos/geom/Location.h>
00026
00027
00028 namespace geos {
00029 namespace geom {
00030 class Coordinate;
00031 class Geometry;
00032 class LinearRing;
00033 class LineString;
00034 class Polygon;
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::LineString *l);
00098
00099 int locateInPolygonRing(const geom::Coordinate& p, const geom::LinearRing *ring);
00100
00101 int locate(const geom::Coordinate& p, const geom::Polygon *poly);
00102
00103 };
00104
00105 }
00106 }
00107
00108
00109 #endif // GEOS_ALGORITHM_POINTLOCATOR_H
00110
00111
00112
00113
00114
00115
00116
00117