GEOS  3.4.2
ExtractLineByLocation.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/ExtractLineByLocation.java rev. 1.10
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_LINEARREF_EXTRACTLINEBYLOCATION_H
00021 #define GEOS_LINEARREF_EXTRACTLINEBYLOCATION_H
00022 
00023 #include <geos/geom/Coordinate.h>
00024 #include <geos/geom/Geometry.h>
00025 #include <geos/linearref/LinearLocation.h>
00026 
00027 namespace geos
00028 {
00029 namespace linearref   // geos::linearref
00030 {
00031 
00036 class ExtractLineByLocation
00037 {
00038 
00039 private:
00040         const geom::Geometry *line;
00041         geom::Geometry *reverse(const geom::Geometry *linear);
00042 
00050         geom::LineString* computeLine(const LinearLocation& start, const LinearLocation& end);
00051 
00059         geom::Geometry *computeLinear(const LinearLocation& start, const LinearLocation& end);
00060 
00061 public:
00073         static geom::Geometry *extract(const geom::Geometry *line, const LinearLocation& start, const LinearLocation& end);
00074 
00075         ExtractLineByLocation(const geom::Geometry *line);
00076 
00085         geom::Geometry *extract(const LinearLocation& start, const LinearLocation& end);
00086 
00087 };
00088 }
00089 }
00090 #endif