Class ShapeParser
java.lang.Object
org.apache.sedona.core.formatMapper.shapefileParser.parseUtils.shp.ShapeParser
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MultiPointParser,PointParser,PolygonParser,PolyLineParser
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.locationtech.jts.geom.GeometryFactoryThe geometry factory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedShapeParser(org.locationtech.jts.geom.GeometryFactory geometryFactory) Instantiates a new shape parser. -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanisNoData(double value) According to the shapefile specification, any floating point number smaller than -10^38 is considered a "no data" value.abstract org.locationtech.jts.geom.GeometryparseShape(ShapeReader reader) parse the shape to a geometry.protected org.locationtech.jts.geom.Coordinate[]readCoordinates(ShapeReader reader, int numPoints) read numPoints of coordinates from input source.protected org.locationtech.jts.geom.Coordinate[]readCoordinatesWithM(ShapeReader reader, int numPoints) Read coordinates with M values from input source.protected org.locationtech.jts.geom.Coordinate[]readCoordinatesWithZM(ShapeReader reader, int numPoints) Read coordinates with Z and M values from input source.protected int[]readOffsets(ShapeReader reader, int numParts, int maxOffset)
-
Field Details
-
geometryFactory
protected final org.locationtech.jts.geom.GeometryFactory geometryFactoryThe geometry factory.
-
-
Constructor Details
-
ShapeParser
protected ShapeParser(org.locationtech.jts.geom.GeometryFactory geometryFactory) Instantiates a new shape parser.- Parameters:
geometryFactory- the geometry factory
-
-
Method Details
-
parseShape
parse the shape to a geometry.- Parameters:
reader- the reader- Returns:
- the geometry
-
isNoData
protected static boolean isNoData(double value) According to the shapefile specification, any floating point number smaller than -10^38 is considered a "no data" value. In practice, we also observe that ogrinfo considers 0 as a "no data" value.- Parameters:
value- The coordinate value to check- Returns:
- true if the value is a "no data" value
-
readCoordinates
read numPoints of coordinates from input source.- Parameters:
reader- the readernumPoints- the num points- Returns:
- the coordinate array
-
readCoordinatesWithZM
protected org.locationtech.jts.geom.Coordinate[] readCoordinatesWithZM(ShapeReader reader, int numPoints) Read coordinates with Z and M values from input source.- Parameters:
reader- the readernumPoints- the number of points- Returns:
- the coordinate array with Z and M values
-
readCoordinatesWithM
protected org.locationtech.jts.geom.Coordinate[] readCoordinatesWithM(ShapeReader reader, int numPoints) Read coordinates with M values from input source.- Parameters:
reader- the readernumPoints- the number of points- Returns:
- the coordinate array with M values
-
readOffsets
-