Package utils

Class ConversionUtils

java.lang.Object
utils.ConversionUtils

public class ConversionUtils extends Object
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 Details

    • ConversionUtils

      public ConversionUtils()
  • Method Details

    • datetimeToTimestampTz

      public static OffsetDateTime datetimeToTimestampTz(LocalDateTime dt)
      Take a LocalDateTime and convert it to an OffsetDateTime.
      Parameters:
      dt - localDateTime
      Returns:
      offsetDateTime
    • timestamptz_to_datetime

      public static LocalDateTime timestamptz_to_datetime(OffsetDateTime ts)
      Take a OffsetDateTime and convert it to an LocalDateTime.
      Parameters:
      ts - offsetDateTime
      Returns:
      localDateTime
    • timedelta_to_interval

      public static jnr.ffi.Pointer timedelta_to_interval(Duration td)
    • interval_to_timedelta

      public static Duration interval_to_timedelta(jnr.ffi.Pointer p)
    • 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

      public static String hexWKBToWKB(String hexWKB)
    • string_to_LocalDateTime

      public static LocalDateTime string_to_LocalDateTime(String value)