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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetDateTimeTake aLocalDateTimeand convert it to anOffsetDateTime.static jnr.ffi.Pointerfloatrange_to_floatspan(com.google.common.collect.Range<Float> floatrange) static com.google.common.collect.Rangefloatspan_to_floatrange(jnr.ffi.Pointer span) static jnr.ffi.Pointergeo_to_gserialized(org.locationtech.jts.geom.Geometry geom, boolean geodetic) static jnr.ffi.Pointergeography_to_gserialized(org.locationtech.jts.geom.Geometry geom) static jnr.ffi.Pointergeometry_to_gserialized(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.Geometrygserialized_to_shapely_geometry(jnr.ffi.Pointer geom, int precision) static org.locationtech.jts.geom.Pointgserialized_to_shapely_point(jnr.ffi.Pointer geom, int precision) static StringhexWKBToWKB(String hexWKB) static Durationinterval_to_timedelta(jnr.ffi.Pointer p) static jnr.ffi.Pointerintrange_to_intspan(com.google.common.collect.Range<Integer> intrange) static com.google.common.collect.Rangeintspan_to_intrange(jnr.ffi.Pointer span) static LocalDateTimestring_to_LocalDateTime(String value) static jnr.ffi.Pointerstatic LocalDateTimeTake aOffsetDateTimeand convert it to anLocalDateTime.
-
Constructor Details
-
ConversionUtils
public ConversionUtils()
-
-
Method Details
-
datetimeToTimestampTz
Take aLocalDateTimeand convert it to anOffsetDateTime.- Parameters:
dt- localDateTime- Returns:
- offsetDateTime
-
timestamptz_to_datetime
Take aOffsetDateTimeand 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
-