[geos-commits] r2052 - in trunk/source/headers/geos/algorithm: .
locate
svn_geos at osgeo.org
svn_geos at osgeo.org
Fri Dec 21 14:55:26 EST 2007
Author: benjubb
Date: 2007-12-21 14:55:26 -0500 (Fri, 21 Dec 2007)
New Revision: 2052
Added:
trunk/source/headers/geos/algorithm/locate/
trunk/source/headers/geos/algorithm/locate/IndexedPointInAreaLocator.h
trunk/source/headers/geos/algorithm/locate/PointOnGeometryLocator.h
Log:
New namaspace geos::algorithm::locate, as in JTS 1.9..
Added: trunk/source/headers/geos/algorithm/locate/IndexedPointInAreaLocator.h
===================================================================
--- trunk/source/headers/geos/algorithm/locate/IndexedPointInAreaLocator.h (rev 0)
+++ trunk/source/headers/geos/algorithm/locate/IndexedPointInAreaLocator.h 2007-12-21 19:55:26 UTC (rev 2052)
@@ -0,0 +1,113 @@
+/**********************************************************************
+ * $Id
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2006 Refractions Research Inc.
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ *
+ **********************************************************************/
+
+#ifndef GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
+#define GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
+
+#include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
+#include <geos/index/ItemVisitor.h> // inherited
+
+namespace geos {
+ namespace algorithm {
+ class RayCrossingCounter;
+ }
+ namespace geom {
+ class Geometry;
+ class Coordinate;
+ class CoordinateSequence;
+ }
+ namespace index {
+ namespace intervalrtree {
+ class SortedPackedIntervalRTree;
+ }
+ }
+}
+
+namespace geos {
+namespace algorithm { // geos::algorithm
+namespace locate { // geos::algorithm::locate
+
+class IndexedPointInAreaLocator : public PointOnGeometryLocator
+{
+private:
+ class IntervalIndexedGeometry
+ {
+ private:
+ index::intervalrtree::SortedPackedIntervalRTree * index;
+
+ void init( const geom::Geometry & g);
+ void addLine( geom::CoordinateSequence * pts);
+
+ public:
+ IntervalIndexedGeometry( const geom::Geometry & g);
+ ~IntervalIndexedGeometry();
+
+ void query(double min, double max, index::ItemVisitor * visitor);
+ };
+
+
+ class SegmentVisitor : public index::ItemVisitor
+ {
+ private:
+ algorithm::RayCrossingCounter * counter;
+
+ public:
+ SegmentVisitor( algorithm::RayCrossingCounter * counter)
+ : counter( counter)
+ { }
+
+ ~SegmentVisitor()
+ { }
+
+ void visitItem( void * item);
+ };
+
+
+ const geom::Geometry & areaGeom;
+ IntervalIndexedGeometry * index;
+
+ void buildIndex( const geom::Geometry & g);
+
+
+protected:
+public:
+ /**
+ * Creates a new locator for a given {@link Geometry}
+ * @param g the Geometry to locate in
+ */
+ IndexedPointInAreaLocator( const geom::Geometry & g);
+
+ ~IndexedPointInAreaLocator();
+
+ /**
+ * Determines the {@link Location} of a point in an areal {@link Geometry}.
+ *
+ * @param p the point to test
+ * @return the location of the point in the geometry
+ */
+ int locate( const geom::Coordinate * /*const*/ p);
+
+};
+
+} // geos::algorithm::locate
+} // geos::algorithm
+} // geos
+
+#endif // GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
+/**********************************************************************
+ * $Log$
+ **********************************************************************/
+
Property changes on: trunk/source/headers/geos/algorithm/locate/IndexedPointInAreaLocator.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/source/headers/geos/algorithm/locate/PointOnGeometryLocator.h
===================================================================
--- trunk/source/headers/geos/algorithm/locate/PointOnGeometryLocator.h (rev 0)
+++ trunk/source/headers/geos/algorithm/locate/PointOnGeometryLocator.h 2007-12-21 19:55:26 UTC (rev 2052)
@@ -0,0 +1,55 @@
+/**********************************************************************
+ * $Id
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2006 Refractions Research Inc.
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ *
+ **********************************************************************/
+
+#ifndef GEOS_ALGORITHM_LOCATE_POINTONGEOMETRYLOCATOR_H
+#define GEOS_ALGORITHM_LOCATE_POINTONGEOMETRYLOCATOR_H
+
+namespace geos {
+ namespace geom {
+ class Coordinate;
+ }
+}
+
+namespace geos {
+namespace algorithm { // geos::algorithm
+namespace locate { // geos::algorithm::locate
+
+class PointOnGeometryLocator
+{
+private:
+protected:
+public:
+ virtual ~PointOnGeometryLocator()
+ { }
+
+ /**
+ * Determines the {@link Location} of a point in an areal {@link Geometry}.
+ *
+ * @param p the point to test
+ * @return the location of the point in the geometry
+ */
+ virtual int locate( const geom::Coordinate * /*const*/ p) =0;
+};
+
+} // geos::algorithm::locate
+} // geos::algorithm
+} // geos
+
+#endif // GEOS_ALGORITHM_LOCATE_POINTONGEOMETRYLOCATOR_H
+/**********************************************************************
+ * $Log$
+ **********************************************************************/
+
Property changes on: trunk/source/headers/geos/algorithm/locate/PointOnGeometryLocator.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the geos-commits
mailing list