From 4201871b329143a4f9e0ddab3d985d2f6c93c1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Sun, 1 Nov 2026 23:50:22 +0100 Subject: [PATCH] Take the hexadecimal WKB of every class as the string PyMEOS-CFFI returns PyMEOS-CFFI's hexadecimal WKB and EWKB writers return the string alone, the length being the string's own, so as_hexwkb and as_hexewkb return what they call: the twenty writers of the sets, spans, span sets, boxes, network points and segments, poses, circular buffers, temporal values and spatial values each return the string the call answers. Witness: on the PyMEOS-CFFI branch of the same name, set_as_hexwkb of the set {1, 2, 3} answers '0112000103000000010000000200000003000000', and the [0] PyMEOS master reads of it answers '0'. Measured: on the wheel of the PyMEOS-CFFI branch of the same name, built against the libmeos of MobilityDB aabe426a2e, the suite passes 4855 tests with 1 skipped, where PyMEOS master on the same wheel fails 159. --- pymeos/boxes/stbox.py | 4 ++-- pymeos/boxes/tbox.py | 2 +- pymeos/collections/base/set.py | 2 +- pymeos/collections/base/span.py | 2 +- pymeos/collections/base/spanset.py | 2 +- pymeos/collections/cbuffer/cbuffer.py | 4 ++-- pymeos/collections/cbuffer/cbufferset.py | 2 +- pymeos/collections/geo/geoset.py | 2 +- pymeos/collections/npoint/npoint.py | 4 ++-- pymeos/collections/npoint/npointset.py | 2 +- pymeos/collections/npoint/nsegment.py | 4 ++-- pymeos/collections/pose/pose.py | 4 ++-- pymeos/collections/pose/poseset.py | 2 +- pymeos/mixins/spatial_io.py | 2 +- pymeos/temporal/temporal.py | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pymeos/boxes/stbox.py b/pymeos/boxes/stbox.py index 334d5dd4..a2f523f6 100644 --- a/pymeos/boxes/stbox.py +++ b/pymeos/boxes/stbox.py @@ -366,7 +366,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: stbox_as_hexewkb, wkb_variant_from_endian """ - return stbox_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return stbox_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Output ---------------------------------------- def __str__(self) -> str: @@ -430,7 +430,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: stbox_as_hexwkb, wkb_variant_from_endian """ - return stbox_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return stbox_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ---------------------------------- def to_geometry(self, precision: int = 15) -> shp.BaseGeometry: diff --git a/pymeos/boxes/tbox.py b/pymeos/boxes/tbox.py index d10d971e..8a955616 100644 --- a/pymeos/boxes/tbox.py +++ b/pymeos/boxes/tbox.py @@ -315,7 +315,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: tbox_as_hexwkb, wkb_variant_from_endian """ - return tbox_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return tbox_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ---------------------------------- def to_floatspan(self) -> FloatSpan: diff --git a/pymeos/collections/base/set.py b/pymeos/collections/base/set.py index 5568f536..7b06b359 100644 --- a/pymeos/collections/base/set.py +++ b/pymeos/collections/base/set.py @@ -163,7 +163,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: set_as_hexwkb, wkb_variant_from_endian """ - return set_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return set_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- @overload diff --git a/pymeos/collections/base/span.py b/pymeos/collections/base/span.py index 55ffdc00..a8de6083 100644 --- a/pymeos/collections/base/span.py +++ b/pymeos/collections/base/span.py @@ -163,7 +163,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: span_as_hexwkb, wkb_variant_from_endian """ - return span_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return span_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- @abstractmethod diff --git a/pymeos/collections/base/spanset.py b/pymeos/collections/base/spanset.py index 39dcb096..eaa62d7d 100644 --- a/pymeos/collections/base/spanset.py +++ b/pymeos/collections/base/spanset.py @@ -160,7 +160,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: spanset_as_hexwkb, wkb_variant_from_endian """ - return spanset_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return spanset_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- @abstractmethod diff --git a/pymeos/collections/cbuffer/cbuffer.py b/pymeos/collections/cbuffer/cbuffer.py index 3d549e25..80fa3f9f 100644 --- a/pymeos/collections/cbuffer/cbuffer.py +++ b/pymeos/collections/cbuffer/cbuffer.py @@ -201,7 +201,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: cbuffer_as_hexwkb, wkb_variant_from_endian """ - return cbuffer_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return cbuffer_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) @staticmethod def from_text(string: str) -> Cbuffer: @@ -297,7 +297,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: cbuffer_as_hexewkb, wkb_variant_from_endian """ - return cbuffer_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return cbuffer_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- def to_geometry(self, precision: int = 15) -> shp.BaseGeometry: diff --git a/pymeos/collections/cbuffer/cbufferset.py b/pymeos/collections/cbuffer/cbufferset.py index c5577d70..a90936b3 100644 --- a/pymeos/collections/cbuffer/cbufferset.py +++ b/pymeos/collections/cbuffer/cbufferset.py @@ -116,7 +116,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: spatialset_as_hexewkb, wkb_variant_from_endian """ - return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Output ---------------------------------------- diff --git a/pymeos/collections/geo/geoset.py b/pymeos/collections/geo/geoset.py index a44b6c9c..878677ae 100644 --- a/pymeos/collections/geo/geoset.py +++ b/pymeos/collections/geo/geoset.py @@ -129,7 +129,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: spatialset_as_hexewkb, wkb_variant_from_endian """ - return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Output ---------------------------------------- diff --git a/pymeos/collections/npoint/npoint.py b/pymeos/collections/npoint/npoint.py index 67f9ab11..7d52539d 100644 --- a/pymeos/collections/npoint/npoint.py +++ b/pymeos/collections/npoint/npoint.py @@ -169,7 +169,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: npoint_as_hexwkb, wkb_variant_from_endian """ - return npoint_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return npoint_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) def as_ewkt(self, max_decimals: int = 15) -> str: """ @@ -297,7 +297,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: npoint_as_hexewkb, wkb_variant_from_endian """ - return npoint_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return npoint_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- def to_geometry(self, precision: int = 15) -> shp.BaseGeometry: diff --git a/pymeos/collections/npoint/npointset.py b/pymeos/collections/npoint/npointset.py index 5c32de10..54a0f128 100644 --- a/pymeos/collections/npoint/npointset.py +++ b/pymeos/collections/npoint/npointset.py @@ -116,7 +116,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: spatialset_as_hexewkb, wkb_variant_from_endian """ - return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Output ---------------------------------------- def __str__(self, max_decimals: int = 15): diff --git a/pymeos/collections/npoint/nsegment.py b/pymeos/collections/npoint/nsegment.py index 06547629..b6b46b85 100644 --- a/pymeos/collections/npoint/nsegment.py +++ b/pymeos/collections/npoint/nsegment.py @@ -255,7 +255,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: nsegment_as_hexwkb, wkb_variant_from_endian """ - return nsegment_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return nsegment_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) def as_ewkb(self, endian: str = "") -> bytes: """ @@ -287,7 +287,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: nsegment_as_hexewkb, wkb_variant_from_endian """ - return nsegment_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return nsegment_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- def to_geometry(self, precision: int = 15) -> shp.BaseGeometry: diff --git a/pymeos/collections/pose/pose.py b/pymeos/collections/pose/pose.py index 991201dd..287308b6 100644 --- a/pymeos/collections/pose/pose.py +++ b/pymeos/collections/pose/pose.py @@ -217,7 +217,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: pose_as_hexwkb, wkb_variant_from_endian """ - return pose_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return pose_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) @staticmethod def from_text(string: str) -> Pose: @@ -313,7 +313,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: pose_as_hexewkb, wkb_variant_from_endian """ - return pose_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return pose_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Conversions ----------------------------------- def to_geometry(self, precision: int = 15) -> shp.BaseGeometry: diff --git a/pymeos/collections/pose/poseset.py b/pymeos/collections/pose/poseset.py index f1b443a3..8d09ace8 100644 --- a/pymeos/collections/pose/poseset.py +++ b/pymeos/collections/pose/poseset.py @@ -116,7 +116,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: spatialset_as_hexewkb, wkb_variant_from_endian """ - return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return spatialset_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Output ---------------------------------------- diff --git a/pymeos/mixins/spatial_io.py b/pymeos/mixins/spatial_io.py index 6693cb36..6951e3a5 100644 --- a/pymeos/mixins/spatial_io.py +++ b/pymeos/mixins/spatial_io.py @@ -73,7 +73,7 @@ def as_hexewkb(self, endian: str = "") -> str: MEOS Functions: tspatial_as_hexewkb, wkb_variant_from_endian """ - return tspatial_as_hexewkb(self._inner, wkb_variant_from_endian(endian))[0] + return tspatial_as_hexewkb(self._inner, wkb_variant_from_endian(endian)) @classmethod def from_ewkt(cls: type[Self], ewkt: str) -> Self: diff --git a/pymeos/temporal/temporal.py b/pymeos/temporal/temporal.py index fa8d3f46..b3d390b7 100644 --- a/pymeos/temporal/temporal.py +++ b/pymeos/temporal/temporal.py @@ -281,7 +281,7 @@ def as_hexwkb(self, endian: str = "") -> str: MEOS Functions: temporal_as_hexwkb, wkb_variant_from_endian """ - return temporal_as_hexwkb(self._inner, wkb_variant_from_endian(endian))[0] + return temporal_as_hexwkb(self._inner, wkb_variant_from_endian(endian)) # ------------------------- Accessors ------------------------------------- def bounding_box(self) -> TsTzSpan | Box: