Class S2Utils

java.lang.Object
org.apache.sedona.common.utils.S2Utils

public class S2Utils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.common.geometry.S2CellId
    coordinateToCellID(org.locationtech.jts.geom.Coordinate coordinate, int level)
     
    static List<com.google.common.geometry.S2CellId>
    roundCellsToSameLevel(List<com.google.common.geometry.S2CellId> cellIDs, int level)
     
    static List<com.google.common.geometry.S2CellId>
    s2RegionToCellIDs(com.google.common.geometry.S2Region region, int minLevel, int maxLevel, int maxNum)
     
    static org.locationtech.jts.geom.Polygon
    toJTSPolygon(com.google.common.geometry.S2CellId cellId)
     
    static com.google.common.geometry.S2Loop
    toS2Loop(org.locationtech.jts.geom.LinearRing ring)
     
    static com.google.common.geometry.S2Point
    toS2Point(org.locationtech.jts.geom.Coordinate coord)
     
    static List<com.google.common.geometry.S2Point>
    toS2Points(org.locationtech.jts.geom.Coordinate[] coords)
     
    static com.google.common.geometry.S2Polygon
    toS2Polygon(org.locationtech.jts.geom.Polygon polygon)
     
    static com.google.common.geometry.S2Polyline
    toS2PolyLine(org.locationtech.jts.geom.LineString line)
     
    static com.google.common.geometry.S2Region
    toS2Region(org.locationtech.jts.geom.Geometry geom)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • S2Utils

      public S2Utils()
  • Method Details

    • toS2Point

      public static com.google.common.geometry.S2Point toS2Point(org.locationtech.jts.geom.Coordinate coord)
      Parameters:
      coord - Coordinate: convert a jts coordinate to a S2Point
      Returns:
    • toS2Points

      public static List<com.google.common.geometry.S2Point> toS2Points(org.locationtech.jts.geom.Coordinate[] coords)
    • toS2PolyLine

      public static com.google.common.geometry.S2Polyline toS2PolyLine(org.locationtech.jts.geom.LineString line)
      Parameters:
      line -
      Returns:
    • toS2Loop

      public static com.google.common.geometry.S2Loop toS2Loop(org.locationtech.jts.geom.LinearRing ring)
    • toS2Polygon

      public static com.google.common.geometry.S2Polygon toS2Polygon(org.locationtech.jts.geom.Polygon polygon)
    • s2RegionToCellIDs

      public static List<com.google.common.geometry.S2CellId> s2RegionToCellIDs(com.google.common.geometry.S2Region region, int minLevel, int maxLevel, int maxNum)
    • coordinateToCellID

      public static com.google.common.geometry.S2CellId coordinateToCellID(org.locationtech.jts.geom.Coordinate coordinate, int level)
    • roundCellsToSameLevel

      public static List<com.google.common.geometry.S2CellId> roundCellsToSameLevel(List<com.google.common.geometry.S2CellId> cellIDs, int level)
    • toJTSPolygon

      public static org.locationtech.jts.geom.Polygon toJTSPolygon(com.google.common.geometry.S2CellId cellId)
    • toS2Region

      public static com.google.common.geometry.S2Region toS2Region(org.locationtech.jts.geom.Geometry geom) throws IllegalArgumentException
      Throws:
      IllegalArgumentException