LengthIndexOfPoint.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation.
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: linearref/LengthIndexOfPoint.java rev. 1.10
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00021 #define GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00022 
00023 #include <string>
00024 
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/geom/Geometry.h>
00027 #include <geos/geom/LineSegment.h>
00028 #include <geos/linearref/LinearLocation.h>
00029 
00030 
00031 namespace geos
00032 {
00033 namespace linearref   // geos::linearref
00034 {
00035 
00045 class LengthIndexOfPoint
00046 {
00047 
00048 private:
00049         const geom::Geometry *linearGeom;
00050 
00051         double indexOfFromStart(const geom::Coordinate& inputPt, const double minIndex) const;
00052 
00053         double segmentNearestMeasure(const geom::LineSegment *seg, 
00054                                const geom::Coordinate& inputPt,
00055                                double segmentStartMeasure) const;
00056 public:
00057         static double indexOf(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt);
00058 
00059         static double indexOfAfter(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt, double minIndex);
00060 
00061         LengthIndexOfPoint(const geom::Geometry *linearGeom);
00062 
00069         double indexOf(const geom::Coordinate& inputPt) const;
00070 
00086         double indexOfAfter(const geom::Coordinate& inputPt, double minIndex) const;
00087 
00088 };
00089 }
00090 }
00091 #endif

Generated on 30 Dec 2015 for GEOS by  doxygen 1.4.7