Package utils
Class ConversionUtils
java.lang.Object
utils.ConversionUtils
Class based on the manually-defined functions from PyMeos.
This class contains conversions functions for MEOS/JMEOS types.
- Since:
- 09/08/2023
- Author:
- Killian Monnier and Nidhal Mareghni
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetDateTime
Take aLocalDateTime
and convert it to anOffsetDateTime
.static jnr.ffi.Pointer
floatrange_to_floatspan
(com.google.common.collect.Range<Float> floatrange) static com.google.common.collect.Range
floatspan_to_floatrange
(jnr.ffi.Pointer span) static jnr.ffi.Pointer
geo_to_gserialized
(org.locationtech.jts.geom.Geometry geom, boolean geodetic) static jnr.ffi.Pointer
geography_to_gserialized
(org.locationtech.jts.geom.Geometry geom) static jnr.ffi.Pointer
geometry_to_gserialized
(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.Geometry
gserialized_to_shapely_geometry
(jnr.ffi.Pointer geom, int precision) static org.locationtech.jts.geom.Point
gserialized_to_shapely_point
(jnr.ffi.Pointer geom, int precision) static String
hexWKBToWKB
(String hexWKB) static Duration
interval_to_timedelta
(jnr.ffi.Pointer p) static jnr.ffi.Pointer
intrange_to_intspan
(com.google.common.collect.Range<Integer> intrange) static com.google.common.collect.Range
intspan_to_intrange
(jnr.ffi.Pointer span) static LocalDateTime
string_to_LocalDateTime
(String value) static jnr.ffi.Pointer
static LocalDateTime
Take aOffsetDateTime
and convert it to anLocalDateTime
.
-
Constructor Details
-
ConversionUtils
public ConversionUtils()
-
-
Method Details
-
datetimeToTimestampTz
Take aLocalDateTime
and convert it to anOffsetDateTime
.- Parameters:
dt
- localDateTime- Returns:
- offsetDateTime
-
timestamptz_to_datetime
Take aOffsetDateTime
and convert it to anLocalDateTime
.- Parameters:
ts
- offsetDateTime- Returns:
- localDateTime
-
timedelta_to_interval
-
interval_to_timedelta
-
intrange_to_intspan
public static jnr.ffi.Pointer intrange_to_intspan(com.google.common.collect.Range<Integer> intrange) throws SQLException - Throws:
SQLException
-
intspan_to_intrange
public static com.google.common.collect.Range intspan_to_intrange(jnr.ffi.Pointer span) -
floatrange_to_floatspan
public static jnr.ffi.Pointer floatrange_to_floatspan(com.google.common.collect.Range<Float> floatrange) -
floatspan_to_floatrange
public static com.google.common.collect.Range floatspan_to_floatrange(jnr.ffi.Pointer span) -
geo_to_gserialized
public static jnr.ffi.Pointer geo_to_gserialized(org.locationtech.jts.geom.Geometry geom, boolean geodetic) -
geometry_to_gserialized
public static jnr.ffi.Pointer geometry_to_gserialized(org.locationtech.jts.geom.Geometry geom) -
geography_to_gserialized
public static jnr.ffi.Pointer geography_to_gserialized(org.locationtech.jts.geom.Geometry geom) -
gserialized_to_shapely_point
public static org.locationtech.jts.geom.Point gserialized_to_shapely_point(jnr.ffi.Pointer geom, int precision) throws org.locationtech.jts.io.ParseException, org.locationtech.jts.io.ParseException - Throws:
org.locationtech.jts.io.ParseException
-
gserialized_to_shapely_geometry
public static org.locationtech.jts.geom.Geometry gserialized_to_shapely_geometry(jnr.ffi.Pointer geom, int precision) throws org.locationtech.jts.io.ParseException, org.locationtech.jts.io.ParseException - Throws:
org.locationtech.jts.io.ParseException
-
hexWKBToWKB
-
string_to_LocalDateTime
-