com.vividsolutions.jts.operation.valid

Class TopologyValidationError


public class TopologyValidationError
extends java.lang.Object

Contains information about the nature and location of a Geometry validation error
Version:
1.7

Field Summary

static int
DISCONNECTED_INTERIOR
Indicates that the interior of a polygon is disjoint (often caused by set of contiguous holes splitting the polygon into two parts)
static int
DUPLICATE_RINGS
Indicates that a polygonal geometry contains two rings which are identical
static int
ERROR
Deprecated.
static int
HOLE_OUTSIDE_SHELL
Indicates that a hole of a polygon lies partially or completely in the exterior of the shell
static int
INVALID_COORDINATE
Indicates that the X or Y ordinate of a Coordinate is not a valid numeric value (e.g.
static int
NESTED_HOLES
Indicates that a hole lies in the interior of another hole in the same polygon
static int
NESTED_SHELLS
Indicates that a polygon component of a MultiPolygon lies inside another polygonal component
static int
REPEATED_POINT
Deprecated.
static int
RING_NOT_CLOSED
Indicates that a ring is not correctly closed (the first and the last coordinate are different)
static int
RING_SELF_INTERSECTION
Indicates that a ring self-intersects
static int
SELF_INTERSECTION
Indicates that two rings of a polygonal geometry intersect
static int
TOO_FEW_POINTS
Indicates that either
  • a LineString contains a single point
  • a LinearRing contains 2 or 3 points

Constructor Summary

TopologyValidationError(int errorType)
Creates a validation error of the given type with a null location
TopologyValidationError(int errorType, Coordinate pt)
Creates a validation error with the given type and location

Method Summary

Coordinate
getCoordinate()
Returns the location of this error (on the Geometry containing the error).
int
getErrorType()
Gets the type of this error.
String
getMessage()
Gets an error message describing this error.
String
toString()
Gets a message describing the type and location of this error.

Field Details

DISCONNECTED_INTERIOR

public static final int DISCONNECTED_INTERIOR
Indicates that the interior of a polygon is disjoint (often caused by set of contiguous holes splitting the polygon into two parts)
Field Value:
4

DUPLICATE_RINGS

public static final int DUPLICATE_RINGS
Indicates that a polygonal geometry contains two rings which are identical
Field Value:
8

ERROR

public static final int ERROR

Deprecated.

Not used
Field Value:
0

HOLE_OUTSIDE_SHELL

public static final int HOLE_OUTSIDE_SHELL
Indicates that a hole of a polygon lies partially or completely in the exterior of the shell
Field Value:
2

INVALID_COORDINATE

public static final int INVALID_COORDINATE
Indicates that the X or Y ordinate of a Coordinate is not a valid numeric value (e.g. Double.Nan )
Field Value:
10

NESTED_HOLES

public static final int NESTED_HOLES
Indicates that a hole lies in the interior of another hole in the same polygon
Field Value:
3

NESTED_SHELLS

public static final int NESTED_SHELLS
Indicates that a polygon component of a MultiPolygon lies inside another polygonal component
Field Value:
7

REPEATED_POINT

public static final int REPEATED_POINT

Deprecated.

No longer used - repeated points are considered valid as per the SFS
Field Value:
1

RING_NOT_CLOSED

public static final int RING_NOT_CLOSED
Indicates that a ring is not correctly closed (the first and the last coordinate are different)
Field Value:
11

RING_SELF_INTERSECTION

public static final int RING_SELF_INTERSECTION
Indicates that a ring self-intersects
Field Value:
6

SELF_INTERSECTION

public static final int SELF_INTERSECTION
Indicates that two rings of a polygonal geometry intersect
Field Value:
5

TOO_FEW_POINTS

public static final int TOO_FEW_POINTS
Indicates that either
  • a LineString contains a single point
  • a LinearRing contains 2 or 3 points
Field Value:
9

Constructor Details

TopologyValidationError

public TopologyValidationError(int errorType)
Creates a validation error of the given type with a null location
Parameters:
errorType - the type of the error

TopologyValidationError

public TopologyValidationError(int errorType,
                               Coordinate pt)
Creates a validation error with the given type and location
Parameters:
errorType - the type of the error
pt - the location of the error

Method Details

getCoordinate

public Coordinate getCoordinate()
Returns the location of this error (on the Geometry containing the error).
Returns:
a Coordinate on the input geometry

getErrorType

public int getErrorType()
Gets the type of this error.
Returns:
the error type

getMessage

public String getMessage()
Gets an error message describing this error. The error message does not describe the location of the error.
Returns:

toString

public String toString()
Gets a message describing the type and location of this error.
Returns: