本文整理汇总了Java中com.vividsolutions.jts.geom.Location.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java Location.NONE属性的具体用法?Java Location.NONE怎么用?Java Location.NONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.vividsolutions.jts.geom.Location
的用法示例。
在下文中一共展示了Location.NONE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeLabel
/**
* This computes the overall edge label for the set of
* edges in this EdgeStubBundle. It essentially merges
* the ON and side labels for each edge. These labels must be compatible
*/
@Override
public void computeLabel(BoundaryNodeRule boundaryNodeRule) {
// create the label. If any of the edges belong to areas,
// the label must be an area label
boolean isArea = false;
for (Iterator it = this.iterator(); it.hasNext(); ) {
EdgeEnd e = (EdgeEnd) it.next();
if (e.getLabel().isArea()) {
isArea = true;
}
}
if (isArea) {
this.label = new Label(Location.NONE, Location.NONE, Location.NONE);
} else {
this.label = new Label(Location.NONE);
}
// compute the On label, and the side labels if present
for (int i = 0; i < 2; i++) {
this.computeLabelOn(i, boundaryNodeRule);
if (isArea) {
this.computeLabelSides(i);
}
}
}
示例2: computeLabelling
/**
* Compute the labelling for all dirEdges in this star, as well
* as the overall labelling
*/
@Override
public void computeLabelling(GeometryGraph[] geom) {
//Debug.print(this);
super.computeLabelling(geom);
// determine the overall labelling for this DirectedEdgeStar
// (i.e. for the node it is based at)
this.label = new Label(Location.NONE);
for (Iterator it = this.iterator(); it.hasNext(); ) {
EdgeEnd ee = (EdgeEnd) it.next();
Edge e = ee.getEdge();
Label eLabel = e.getLabel();
for (int i = 0; i < 2; i++) {
int eLoc = eLabel.getLocation(i);
if (eLoc == Location.INTERIOR || eLoc == Location.BOUNDARY) {
this.label.setLocation(i, Location.INTERIOR);
}
}
}
//Debug.print(this);
}
示例3: setLabelBoundary
/**
* Updates the label of a node to BOUNDARY,
* obeying the mod-2 boundaryDetermination rule.
*/
public void setLabelBoundary(int argIndex) {
if (this.label == null) {
return;
}
// determine the current location for the point (if any)
int loc = Location.NONE;
if (this.label != null) {
loc = this.label.getLocation(argIndex);
}
// flip the loc
int newLoc;
switch (loc) {
case Location.BOUNDARY:
newLoc = Location.INTERIOR;
break;
case Location.INTERIOR:
newLoc = Location.BOUNDARY;
break;
default:
newLoc = Location.BOUNDARY;
break;
}
this.label.setLocation(argIndex, newLoc);
}
示例4: insertBoundaryPoint
/**
* Adds candidate boundary points using the current {@link BoundaryNodeRule}.
* This is used to add the boundary
* points of dim-1 geometries (Curves/MultiCurves).
*/
private void insertBoundaryPoint(int argIndex, Coordinate coord) {
Node n = this.nodes.addNode(coord);
// nodes always have labels
Label lbl = n.getLabel();
// the new point to insert is on a boundary
int boundaryCount = 1;
// determine the current location for the point (if any)
int loc = Location.NONE;
loc = lbl.getLocation(argIndex, Position.ON);
if (loc == Location.BOUNDARY) {
boundaryCount++;
}
// determine the boundary status of the point according to the Boundary Determination Rule
int newLoc = determineBoundary(this.boundaryNodeRule, boundaryCount);
lbl.setLocation(argIndex, newLoc);
}
示例5: merge
/**
* merge updates only the NULL attributes of this object
* with the attributes of another.
*/
public void merge(TopologyLocation gl) {
// if the src is an Area label & and the dest is not, increase the dest to be an Area
if (gl.location.length > this.location.length) {
int[] newLoc = new int[3];
newLoc[Position.ON] = this.location[Position.ON];
newLoc[Position.LEFT] = Location.NONE;
newLoc[Position.RIGHT] = Location.NONE;
this.location = newLoc;
}
for (int i = 0; i < this.location.length; i++) {
if (this.location[i] == Location.NONE && i < gl.location.length) {
this.location[i] = gl.location[i];
}
}
}
示例6: computeLabel
/**
* This computes the overall edge label for the set of
* edges in this EdgeStubBundle. It essentially merges
* the ON and side labels for each edge. These labels must be compatible
*/
public void computeLabel(BoundaryNodeRule boundaryNodeRule) {
// create the label. If any of the edges belong to areas,
// the label must be an area label
boolean isArea = false;
for (Iterator it = iterator(); it.hasNext(); ) {
EdgeEnd e = (EdgeEnd) it.next();
if (e.getLabel().isArea()) isArea = true;
}
if (isArea)
label = new Label(Location.NONE, Location.NONE, Location.NONE);
else
label = new Label(Location.NONE);
// compute the On label, and the side labels if present
for (int i = 0; i < 2; i++) {
computeLabelOn(i, boundaryNodeRule);
if (isArea)
computeLabelSides(i);
}
}
示例7: computeLabelling
/**
* Compute the labelling for all dirEdges in this star, as well
* as the overall labelling
*/
public void computeLabelling(GeometryGraph[] geom) {
//Debug.print(this);
super.computeLabelling(geom);
// determine the overall labelling for this DirectedEdgeStar
// (i.e. for the node it is based at)
label = new Label(Location.NONE);
for (Iterator it = iterator(); it.hasNext(); ) {
EdgeEnd ee = (EdgeEnd) it.next();
Edge e = ee.getEdge();
Label eLabel = e.getLabel();
for (int i = 0; i < 2; i++) {
int eLoc = eLabel.getLocation(i);
if (eLoc == Location.INTERIOR || eLoc == Location.BOUNDARY)
label.setLocation(i, Location.INTERIOR);
}
}
//Debug.print(this);
}
示例8: setLabelBoundary
/**
* Updates the label of a node to BOUNDARY,
* obeying the mod-2 boundaryDetermination rule.
*/
public void setLabelBoundary(int argIndex) {
if (label == null) return;
// determine the current location for the point (if any)
int loc = Location.NONE;
if (label != null)
loc = label.getLocation(argIndex);
// flip the loc
int newLoc;
switch (loc) {
case Location.BOUNDARY:
newLoc = Location.INTERIOR;
break;
case Location.INTERIOR:
newLoc = Location.BOUNDARY;
break;
default:
newLoc = Location.BOUNDARY;
break;
}
label.setLocation(argIndex, newLoc);
}
示例9: setLabelBoundary
/**
* Updates the label of a node to BOUNDARY,
* obeying the mod-2 boundaryDetermination rule.
*/
public void setLabelBoundary(int argIndex)
{
if (label == null) return;
// determine the current location for the point (if any)
int loc = Location.NONE;
if (label != null)
loc = label.getLocation(argIndex);
// flip the loc
int newLoc;
switch (loc) {
case Location.BOUNDARY: newLoc = Location.INTERIOR; break;
case Location.INTERIOR: newLoc = Location.BOUNDARY; break;
default: newLoc = Location.BOUNDARY; break;
}
label.setLocation(argIndex, newLoc);
}
示例10: merge
/**
* merge updates only the NULL attributes of this object
* with the attributes of another.
*/
public void merge(TopologyLocation gl)
{
// if the src is an Area label & and the dest is not, increase the dest to be an Area
if (gl.location.length > location.length) {
int [] newLoc = new int[3];
newLoc[Position.ON] = location[Position.ON];
newLoc[Position.LEFT] = Location.NONE;
newLoc[Position.RIGHT] = Location.NONE;
location = newLoc;
}
for (int i = 0; i < location.length; i++) {
if (location[i] == Location.NONE && i < gl.location.length)
location[i] = gl.location[i];
}
}
示例11: mergeLabel
/**
* Merge the RHS label from a DirectedEdge into the label for this EdgeRing.
* The DirectedEdge label may be null. This is acceptable - it results
* from a node which is NOT an intersection node between the Geometries
* (e.g. the end node of a LinearRing). In this case the DirectedEdge label
* does not contribute any information to the overall labelling, and is simply skipped.
*/
protected void mergeLabel(Label deLabel, int geomIndex) {
int loc = deLabel.getLocation(geomIndex, Position.RIGHT);
// no information to be had from this label
if (loc == Location.NONE) {
return;
}
// if there is no current RHS value, set it
if (this.label.getLocation(geomIndex) == Location.NONE) {
this.label.setLocation(geomIndex, loc);
}
}
示例12: mergeLabel
/**
* To merge labels for two nodes,
* the merged location for each LabelElement is computed.
* The location for the corresponding node LabelElement is set to the result,
* as long as the location is non-null.
*/
public void mergeLabel(Label label2) {
for (int i = 0; i < 2; i++) {
int loc = this.computeMergedLocation(label2, i);
int thisLoc = this.label.getLocation(i);
if (thisLoc == Location.NONE) {
this.label.setLocation(i, loc);
}
}
}
示例13: computeMergedLocation
/**
* The location for a given eltIndex for a node will be one
* of { null, INTERIOR, BOUNDARY }.
* A node may be on both the boundary and the interior of a geometry;
* in this case, the rule is that the node is considered to be in the boundary.
* The merged location is the maximum of the two input values.
*/
int computeMergedLocation(Label label2, int eltIndex) {
int loc = Location.NONE;
loc = this.label.getLocation(eltIndex);
if (!label2.isNull(eltIndex)) {
int nLoc = label2.getLocation(eltIndex);
if (loc != Location.BOUNDARY) {
loc = nLoc;
}
}
return loc;
}
示例14: getLocation
private int getLocation(int geomIndex, Coordinate p, GeometryGraph[] geom) {
// compute location only on demand
if (this.ptInAreaLocation[geomIndex] == Location.NONE) {
this.ptInAreaLocation[geomIndex] = SimplePointInAreaLocator.locate(p, geom[geomIndex].getGeometry());
}
return this.ptInAreaLocation[geomIndex];
}
示例15: isNull
/**
* @return true if all locations are NULL
*/
public boolean isNull() {
for (int aLocation : location) {
if (aLocation != Location.NONE) {
return false;
}
}
return true;
}