Skip to content

Lack of precision when creating a TGeomPointInst with from_base_time #76

@SophiedeVirieu

Description

@SophiedeVirieu

Description
A TGeomPointInst created with from_base_time truncates the microseconds of the timestamps. As a consequence, when creating a TGeomPointSeq, some timestamps may become equal and make MEOS throw an error.

Example

via string :

traj_test1 = pymeos.TGeomPointSeq(
    "SRID=3857;[POINT(0 0)@2019-01-01T08:00:00+00, POINT(1 1)@2019-01-01T08:00:00.500000+00]"
)

no error

via instant_list :

t1 = datetime.datetime(2019, 1, 1, 8, 0, 0)
t2 = datetime.datetime(2019, 1, 1, 8, 0, 0, 500000)

inst1 = pymeos.TGeomPointInst.from_base_time(shapely.geometry.Point(0, 0), t1)
inst2 = pymeos.TGeomPointInst.from_base_time(shapely.geometry.Point(1, 1), t2)

traj_test2 = pymeos.TGeomPointSeq(
    instant_list=[inst1, inst2], lower_inc=True, upper_inc=True
)

MEOS ERROR:
pymeos_cffi.errors.MeosInvalidArgValueError: MeosInvalidArgValueError (12): Timestamps for temporal value must be increasing: 2019-01-01 08:00:00+00, 2019-01-01 08:00:00+00

Desktop:

  • OS: Ubuntu 24.04.1
  • Architecture: x86_64
  • Environment: Conda
  • Version of pymeos : 1.2.0
  • Version of shapely : 2.0.6
  • Version of python : 3.9.21

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions