Class PolylineGeography

java.lang.Object
org.apache.sedona.common.S2Geography.Geography
org.apache.sedona.common.S2Geography.PolylineGeography
Direct Known Subclasses:
SinglePolylineGeography

public class PolylineGeography extends Geography
A Geography representing zero or more polylines using S2Polyline.
  • Field Details

    • polylines

      public final List<com.google.common.geometry.S2Polyline> polylines
  • Constructor Details

    • PolylineGeography

      public PolylineGeography()
    • PolylineGeography

      public PolylineGeography(com.google.common.geometry.S2Polyline polyline)
    • PolylineGeography

      public PolylineGeography(List<com.google.common.geometry.S2Polyline> polylines)
    • PolylineGeography

      public PolylineGeography(Geography.GeographyKind kind, com.google.common.geometry.S2Polyline polyline)
  • Method Details

    • dimension

      public int dimension()
      Specified by:
      dimension in class Geography
      Returns:
      0, 1, or 2 if all Shape()s that are returned will have the same dimension (i.e., they are all points, all lines, or all polygons).
    • numShapes

      public int numShapes()
      Specified by:
      numShapes in class Geography
      Returns:
      The number of S2Shape objects needed to represent this Geography
    • shape

      public com.google.common.geometry.S2Shape shape(int id)
      Description copied from class: Geography
      Returns 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.
      Specified by:
      shape in class Geography
      Parameters:
      id - (where 0 <= id < num_shapes())
      Returns:
      the given S2Shape
    • region

      public com.google.common.geometry.S2Region region()
      Description copied from class: Geography
      Returns 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.
      Specified by:
      region in class Geography
      Returns:
      S2Region
    • getCellUnionBound

      public void getCellUnionBound(List<com.google.common.geometry.S2CellId> cellIds)
      Description copied from class: Geography
      Adds 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:
      getCellUnionBound in class Geography
    • getPolylines

      public List<com.google.common.geometry.S2Polyline> getPolylines()
    • encode

      public void encode(com.esotericsoftware.kryo.io.UnsafeOutput out, EncodeOptions opts) throws IOException
      Specified by:
      encode in class Geography
      Throws:
      IOException
    • decode

      public static PolylineGeography decode(com.esotericsoftware.kryo.io.Input in, EncodeTag tag) throws IOException
      This is what decodeTagged() actually calls
      Throws:
      IOException
    • decode

      public static PolylineGeography decode(com.esotericsoftware.kryo.io.UnsafeInput in, EncodeTag tag) throws IOException
      Throws:
      IOException
    • getCoordinateSequence

      public org.locationtech.jts.geom.CoordinateSequence getCoordinateSequence()