LengthIndexedLine.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions 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.
*
**********************************************************************
*
* Last port: linearref/LengthIndexedLine.java r463
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/Geometry.h>
#include <geos/linearref/LinearLocation.h>
namespace geos {
namespace linearref { // geos::linearref
class GEOS_DLL LengthIndexedLine {
private:
const geom::Geometry* linearGeom;
LinearLocation locationOf(double index) const;
LinearLocation locationOf(double index, bool resolveLower) const;
double positiveIndex(double index) const;
public:
LengthIndexedLine(const geom::Geometry* linearGeom);
geom::Coordinate extractPoint(double index) const;
geom::Coordinate extractPoint(double index, double offsetDistance) const;
std::unique_ptr<geom::Geometry> extractLine(double startIndex, double endIndex) const;
double indexOf(const geom::Coordinate& pt) const;
double indexOfAfter(const geom::Coordinate& pt, double minIndex) const;
double* indicesOf(const geom::Geometry* subLine) const;
double project(const geom::Coordinate& pt) const;
double getStartIndex() const;
double getEndIndex() const;
bool isValidIndex(double index) const;
double clampIndex(double index) const;
};
}
}
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::linearref::LengthIndexedLine::indexOfAfter
double indexOfAfter(const geom::Coordinate &pt, double minIndex) const
Finds the index for a point on the line which is greater than the given index.
geos::linearref::LengthIndexedLine::extractPoint
geom::Coordinate extractPoint(double index, double offsetDistance) const
Computes the Coordinate for the point on the line at the given index, offset by the given distance.
geos::linearref::LengthIndexedLine::project
double project(const geom::Coordinate &pt) const
Computes the index for the closest point on the line to the given point.
geos::linearref::LengthIndexedLine::LengthIndexedLine
LengthIndexedLine(const geom::Geometry *linearGeom)
Constructs an object which allows a linear Geometry to be linearly referenced using length as an inde...
geos::linearref::LengthIndexedLine::isValidIndex
bool isValidIndex(double index) const
Tests whether an index is in the valid index range for the line.
geos::linearref::LengthIndexedLine::indicesOf
double * indicesOf(const geom::Geometry *subLine) const
Computes the indices for a subline of the line.
geos::linearref::LengthIndexedLine::getEndIndex
double getEndIndex() const
Returns the index of the end of the line.
geos::linearref::LengthIndexedLine::getStartIndex
double getStartIndex() const
Returns the index of the start of the line.
geos::linearref::LengthIndexedLine::extractLine
std::unique_ptr< geom::Geometry > extractLine(double startIndex, double endIndex) const
Computes the LineString for the interval on the line between the given indices.
geos::linearref::LengthIndexedLine::indexOf
double indexOf(const geom::Coordinate &pt) const
Computes the minimum index for a point on the line.
geos::linearref::LengthIndexedLine::extractPoint
geom::Coordinate extractPoint(double index) const
Computes the Coordinate for the point on the line at the given index.
geos::linearref::LengthIndexedLine::clampIndex
double clampIndex(double index) const
Computes a valid index for this line by clamping the given index to the valid range of index values.
geos::linearref::LinearLocation
Represents a location along a LineString or MultiLineString.
Definition LinearLocation.h:43
geos::index
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
geos::linearref
Contains classes and interfaces implementing linear referencing on linear geometries.
Definition ExtractLineByLocation.h:27
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38