Package org.apache.sedona.common.utils
Class S2Utils
java.lang.Object
org.apache.sedona.common.utils.S2Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.geometry.S2CellIdcoordinateToCellID(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.PolygontoJTSPolygon(com.google.common.geometry.S2CellId cellId) static com.google.common.geometry.S2LooptoS2Loop(org.locationtech.jts.geom.LinearRing ring) static com.google.common.geometry.S2PointtoS2Point(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.S2PolygontoS2Polygon(org.locationtech.jts.geom.Polygon polygon) static com.google.common.geometry.S2PolylinetoS2PolyLine(org.locationtech.jts.geom.LineString line) static com.google.common.geometry.S2RegiontoS2Region(org.locationtech.jts.geom.Geometry geom)
-
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
-
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
-