• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

LengthLocationMap.h

00001 /**********************************************************************
00002  * $Id: LengthLocationMap.h 2809 2009-12-06 01:05:24Z mloskot $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2005-2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation.
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************
00016  *
00017  * Last port: linearref/LengthLocationMap.java rev. 1.10
00018  *
00019  **********************************************************************/
00020 
00021 #ifndef GEOS_LINEARREF_LENGTHLOCATIONMAP_H
00022 #define GEOS_LINEARREF_LENGTHLOCATIONMAP_H
00023 
00024 #include <geos/geom/Coordinate.h>
00025 #include <geos/geom/Geometry.h>
00026 #include <geos/linearref/LinearLocation.h>
00027 
00028 namespace geos
00029 {
00030 namespace linearref   // geos::linearref
00031 {
00032 
00039 class LengthLocationMap
00040 {
00041 
00042 
00043 private:
00044         const geom::Geometry *linearGeom;
00045 
00046         LinearLocation getLocationForward(double length) const;
00047 
00048 public:
00049 
00050         // TODO: cache computed cumulative length for each vertex
00051         // TODO: support user-defined measures
00052         // TODO: support measure index for fast mapping to a location
00053 
00062         static LinearLocation getLocation(const geom::Geometry *linearGeom, double length);
00063 
00072         static double getLength(const geom::Geometry *linearGeom, const LinearLocation& loc);
00073 
00074         LengthLocationMap(const geom::Geometry *linearGeom);
00075 
00084         LinearLocation getLocation(double length) const;
00085 
00086         double getLength(const LinearLocation& loc) const;
00087 
00088 };
00089 }
00090 }
00091 #endif

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1