Class PointGeography
java.lang.Object
org.apache.sedona.common.S2Geography.Geography
org.apache.sedona.common.S2Geography.PointGeography
- Direct Known Subclasses:
SinglePointGeography
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sedona.common.S2Geography.Geography
Geography.GeographyKind -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty PointGeography.PointGeography(com.google.common.geometry.S2Point point) Constructs a single-point geography.PointGeography(List<com.google.common.geometry.S2Point> pts) Constructs from a list of points. -
Method Summary
Modifier and TypeMethodDescriptionstatic PointGeographyThis is what decodeTagged() actually callsstatic PointGeographyintvoidencode(com.esotericsoftware.kryo.io.UnsafeOutput out, EncodeOptions opts) voidencodeTagged(OutputStream os, EncodeOptions opts) Serialize this geography to an encoder.voidgetCellUnionBound(List<com.google.common.geometry.S2CellId> cellIds) Adds an unnormalized set of S2CellIDs to `cell_ids`.org.locationtech.jts.geom.CoordinateSequenceList<com.google.common.geometry.S2Point>Returns an immutable view of the points.intcom.google.common.geometry.S2Regionregion()Returns an S2Region that represents the object.com.google.common.geometry.S2Shapeshape(int id) Returns the given S2Shape (where 0 <= id < num_shapes()).
-
Field Details
-
points
-
-
Constructor Details
-
PointGeography
public PointGeography()Constructs an empty PointGeography. -
PointGeography
public PointGeography(com.google.common.geometry.S2Point point) Constructs a single-point geography. -
PointGeography
Constructs from a list of points.
-
-
Method Details
-
dimension
public int dimension() -
numShapes
public int numShapes() -
shape
public com.google.common.geometry.S2Shape shape(int id) Description copied from class:GeographyReturns the given S2Shape (where 0 <= id < num_shapes()). The caller retains ownership of the S2Shape but the data pointed to by the object requires that the underlying Geography outlives the returned object. -
region
public com.google.common.geometry.S2Region region()Description copied from class:GeographyReturns an S2Region that represents the object. The caller retains ownership of the S2Region but the data pointed to by the object requires that the underlying Geography outlives the returned object. -
getCellUnionBound
Description copied from class:GeographyAdds an unnormalized set of S2CellIDs to `cell_ids`. This is intended to be faster than using Region().GetCovering() directly and to return a small number of cells that can be used to compute a possible intersection quickly.- Overrides:
getCellUnionBoundin classGeography
-
getPoints
Returns an immutable view of the points. -
encodeTagged
Description copied from class:GeographySerialize this geography to an encoder. This does not include any encapsulating information (e.g., which geography type or flags). Encode this geography into a stream as: 1) a 5-byte EncodeTag header (see EncodeTag encode / decode) 2) coveringSize × 8-byte cell-ids 3) the raw shape payload (point/polyline/polygon) via the built-in coder- Overrides:
encodeTaggedin classGeographyopts- CodingHint.FAST / CodingHint.COMPACT / Include or omit the cell‐union covering prefix- Throws:
IOException
-
encode
public void encode(com.esotericsoftware.kryo.io.UnsafeOutput out, EncodeOptions opts) throws IOException - Specified by:
encodein classGeography- Throws:
IOException
-
decode
public static PointGeography decode(com.esotericsoftware.kryo.io.Input in, EncodeTag tag) throws IOException This is what decodeTagged() actually calls- Throws:
IOException
-
decode
public static PointGeography decode(com.esotericsoftware.kryo.io.UnsafeInput in, EncodeTag tag) throws IOException - Throws:
IOException
-
getCoordinateSequence
public org.locationtech.jts.geom.CoordinateSequence getCoordinateSequence()
-