Package org.geotools.graph.build.line
Class LineStringGraphGenerator
- Object
-
- BasicLineGraphGenerator
-
- LineStringGraphGenerator
-
- All Implemented Interfaces:
GraphGenerator,LineGraphGenerator
- Direct Known Subclasses:
DirectedLineStringGraphGenerator
public class LineStringGraphGenerator extends BasicLineGraphGenerator
Builds a graph representing a line network in which edges in the network are represented by LineString geometries. This implementation is a wrapper around a LineGraphGenerator which sets underlying edge objects to be LineString objects, and underlying Node objects to be Point objects. While generating the graph, the generator uses the visited flag of created components to determine when to create underlying objects. For this reason it is not recommended to modify the visited flag of any graph components.- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net, Anders Bakkevold, Bouvet AS, bakkedev@gmail.com
- See Also:
LineString,Point
-
-
Constructor Summary
Constructors Constructor Description LineStringGraphGenerator()LineStringGraphGenerator(double tolerance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Graphableadd(Object obj)Adds a line to the graph.protected LineSegmentalterLine(LineSegment line, Node n1, Node n2)Graphableget(Object obj)Returns the edge which represents a line.Graphableremove(Object obj)Removes the edge from the graph that represents a line.protected voidsetObject(Node n, Object obj)-
Methods inherited from class BasicLineGraphGenerator
getEdge, getGraph, getGraphBuilder, getNode, getNodeMap, setGraphBuilder, setObject, useTolerance
-
-
-
-
Method Detail
-
add
public Graphable add(Object obj)
Description copied from class:BasicLineGraphGeneratorAdds a line to the graph.- Specified by:
addin interfaceGraphGenerator- Overrides:
addin classBasicLineGraphGenerator- Parameters:
obj- An instance of LineSegment.- Returns:
- A BasicEdge.
- See Also:
LineSegment,GraphGenerator.add(Object)
-
alterLine
protected LineSegment alterLine(LineSegment line, Node n1, Node n2)
- Overrides:
alterLinein classBasicLineGraphGenerator
-
remove
public Graphable remove(Object obj)
Description copied from class:BasicLineGraphGeneratorRemoves the edge from the graph that represents a line.- Specified by:
removein interfaceGraphGenerator- Overrides:
removein classBasicLineGraphGenerator- Parameters:
obj- The object modelled by the component.- Returns:
- Edge that represents the line.
- See Also:
GraphGenerator.remove(Object)
-
get
public Graphable get(Object obj)
Description copied from class:BasicLineGraphGeneratorReturns the edge which represents a line. Note that if the exact same line has been added to the graph multiple times, then only one of the edges that represents it will be returned. It is undefined which edge will be returned.- Specified by:
getin interfaceGraphGenerator- Overrides:
getin classBasicLineGraphGenerator- Parameters:
obj- An instance of LineSegment.- Returns:
- Edge that represents the line.
- See Also:
GraphGenerator.get(Object)
-
setObject
protected void setObject(Node n, Object obj)
- Overrides:
setObjectin classBasicLineGraphGenerator
-
-