com.vividsolutions.jts.geomgraph

Class TopologyLocation


public class TopologyLocation
extends java.lang.Object

A TopologyLocation is the labelling of a GraphComponent's topological relationship to a single Geometry.

If the parent component is an area edge, each side and the edge itself have a topological location. These locations are named

If the parent component is a line edge or node, there is a single topological relationship attribute, ON.

The possible values of a topological location are {Location.NULL, Location.EXTERIOR, Location.BOUNDARY, Location.INTERIOR}

The labelling is stored in an array location[j] where where j has the values ON, LEFT, RIGHT

Version:
1.6

Constructor Summary

TopologyLocation(TopologyLocation gl)
TopologyLocation(int on)
TopologyLocation(int on, int left, int right)
Constructs a TopologyLocation specifying how points on, to the left of, and to the right of some GraphComponent relate to some Geometry.
TopologyLocation(int[] location)

Method Summary

boolean
allPositionsEqual(int loc)
void
flip()
int
get(int posIndex)
int[]
getLocations()
boolean
isAnyNull()
boolean
isArea()
boolean
isEqualOnSide(TopologyLocation le, int locIndex)
boolean
isLine()
boolean
isNull()
void
merge(TopologyLocation gl)
merge updates only the NULL attributes of this object with the attributes of another.
void
setAllLocations(int locValue)
void
setAllLocationsIfNull(int locValue)
void
setLocation(int locValue)
void
setLocation(int locIndex, int locValue)
void
setLocations(TopologyLocation gl)
void
setLocations(int on, int left, int right)
String
toString()

Constructor Details

TopologyLocation

public TopologyLocation(TopologyLocation gl)

TopologyLocation

public TopologyLocation(int on)

TopologyLocation

public TopologyLocation(int on,
                        int left,
                        int right)
Constructs a TopologyLocation specifying how points on, to the left of, and to the right of some GraphComponent relate to some Geometry. Possible values for the parameters are Location.NULL, Location.EXTERIOR, Location.BOUNDARY, and Location.INTERIOR.

TopologyLocation

public TopologyLocation(int[] location)

Method Details

allPositionsEqual

public boolean allPositionsEqual(int loc)

flip

public void flip()

get

public int get(int posIndex)

getLocations

public int[] getLocations()

isAnyNull

public boolean isAnyNull()
Returns:
true if any locations are NULL

isArea

public boolean isArea()

isEqualOnSide

public boolean isEqualOnSide(TopologyLocation le,
                             int locIndex)

isLine

public boolean isLine()

isNull

public boolean isNull()
Returns:
true if all locations are NULL

merge

public void merge(TopologyLocation gl)
merge updates only the NULL attributes of this object with the attributes of another.

setAllLocations

public void setAllLocations(int locValue)

setAllLocationsIfNull

public void setAllLocationsIfNull(int locValue)

setLocation

public void setLocation(int locValue)

setLocation

public void setLocation(int locIndex,
                        int locValue)

setLocations

public void setLocations(TopologyLocation gl)

setLocations

public void setLocations(int on,
                         int left,
                         int right)

toString

public String toString()