Class PolygonHandler
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.io.shapefile.PolygonHandler
-
- All Implemented Interfaces:
ShapeHandler
public class PolygonHandler extends java.lang.Object implements ShapeHandler
Wrapper for a Shapefile polygon.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intmyShapeType
-
Constructor Summary
Constructors Constructor Description PolygonHandler()PolygonHandler(int type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.ArrayListassignHolesToShells(java.util.ArrayList shells, java.util.ArrayList holes)private static intfindIndex(java.util.ArrayList list, java.lang.Object o)Finds a object in a list.intgetLength(Geometry geometry)intgetShapeType()(package private) booleanpointInList(Coordinate testPoint, Coordinate[] pointList)Geometryread(EndianDataInputStream file, GeometryFactory geometryFactory, int contentLength)(package private) double[]zMinMax(Geometry g)
-
-
-
Constructor Detail
-
PolygonHandler
public PolygonHandler()
-
PolygonHandler
public PolygonHandler(int type) throws InvalidShapefileException- Throws:
InvalidShapefileException
-
-
Method Detail
-
pointInList
boolean pointInList(Coordinate testPoint, Coordinate[] pointList)
-
read
public Geometry read(EndianDataInputStream file, GeometryFactory geometryFactory, int contentLength) throws java.io.IOException, InvalidShapefileException
- Specified by:
readin interfaceShapeHandler- Throws:
java.io.IOExceptionInvalidShapefileException
-
assignHolesToShells
private java.util.ArrayList assignHolesToShells(java.util.ArrayList shells, java.util.ArrayList holes)
-
findIndex
private static int findIndex(java.util.ArrayList list, java.lang.Object o)Finds a object in a list. Should be much faster than indexof- Parameters:
list-o-- Returns:
-
getShapeType
public int getShapeType()
- Specified by:
getShapeTypein interfaceShapeHandler
-
getLength
public int getLength(Geometry geometry)
- Specified by:
getLengthin interfaceShapeHandler
-
zMinMax
double[] zMinMax(Geometry g)
-
-