Package org.h2gis.utilities.jts_utils
Class CoordinateSequenceDimensionFilter
- java.lang.Object
-
- org.h2gis.utilities.jts_utils.CoordinateSequenceDimensionFilter
-
- All Implemented Interfaces:
org.locationtech.jts.geom.CoordinateSequenceFilter
public class CoordinateSequenceDimensionFilter extends Object implements org.locationtech.jts.geom.CoordinateSequenceFilter
Filter on the dimension of each coordinate of the CoordinateSequence to determine the maximum coordinate dimension as well as whether the CoordinateSequence contains only 2D coordinates or mixed 2D and > 2D coordinates.- Author:
- Erwan Bocher, Adam Gouge
-
-
Constructor Summary
Constructors Constructor Description CoordinateSequenceDimensionFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CoordinateSequenceDimensionFilterapply(org.locationtech.jts.geom.Geometry geometry)Init CoordinateSequenceDimensionFilter object.voidfilter(org.locationtech.jts.geom.CoordinateSequence seq, int i)intgetDimension()Gets the dimension of the coordinate sequence.booleanis2D()booleanisDone()booleanisGeometryChanged()booleanisMixed()voidsetMAXDim(int maxDim)Sets the maximum allowed dimension for the filter.
-
-
-
Field Detail
-
XY
public static final int XY
- See Also:
- Constant Field Values
-
XYZ
public static final int XYZ
- See Also:
- Constant Field Values
-
XYZM
public static final int XYZM
- See Also:
- Constant Field Values
-
-
Method Detail
-
filter
public void filter(org.locationtech.jts.geom.CoordinateSequence seq, int i)- Specified by:
filterin interfaceorg.locationtech.jts.geom.CoordinateSequenceFilter
-
apply
public static CoordinateSequenceDimensionFilter apply(org.locationtech.jts.geom.Geometry geometry)
Init CoordinateSequenceDimensionFilter object.- Parameters:
geometry- Geometry instance- Returns:
- CoordinateSequenceDimensionFilter instance
-
getDimension
public int getDimension()
Gets the dimension of the coordinate sequence.- Returns:
- a integer between 2 and 4.
-
isMixed
public boolean isMixed()
-
is2D
public boolean is2D()
-
setMAXDim
public void setMAXDim(int maxDim)
Sets the maximum allowed dimension for the filter. The filter will stop after this dimension has been reached. Possible values are:CoordinateSequenceDimensionFilter.XYCoordinateSequenceDimensionFilter.XYZCoordinateSequenceDimensionFilter.XYZMDefault value is:CoordinateSequenceDimensionFilter.XYZM.- Parameters:
maxDim- a integer dimension
-
isDone
public boolean isDone()
- Specified by:
isDonein interfaceorg.locationtech.jts.geom.CoordinateSequenceFilter
-
isGeometryChanged
public boolean isGeometryChanged()
- Specified by:
isGeometryChangedin interfaceorg.locationtech.jts.geom.CoordinateSequenceFilter
-
-