Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport bugfixes #63

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ jobs:
- name: Install pymeos_cffi
run: |
cd PyMEOS-CFFI
python ./pymeos_cffi/builder/build_header.py
python ./pymeos_cffi/builder/build_pymeos_functions.py
python ./builder/build_header.py
python ./builder/build_pymeos_functions.py
pip install .

- name: Test PyMEOS with pytest
Expand Down
21 changes: 15 additions & 6 deletions pymeos/main/tpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,12 @@ def __init__(
p = f'POINT({" ".join(str(x) for x in point)})'
else:
p = f"{point}"
self._inner = tgeompoint_in(f"SRID={srid};{p}@{timestamp}")
full_str = (
f"SRID={srid};{p}@{timestamp}"
if srid is not None
else f"{p}@{timestamp}"
)
self._inner = tgeompoint_in(full_str)


class TGeogPointInst(
Expand All @@ -2116,12 +2121,16 @@ def __init__(
) -> None:
super().__init__(string=string, value=point, timestamp=timestamp, _inner=_inner)
if self._inner is None:
p = (
f"POINT({point[0]} {point[1]})"
if isinstance(point, tuple)
else f"{point}"
if isinstance(point, tuple):
p = f'POINT({" ".join(str(x) for x in point)})'
else:
p = f"{point}"
full_str = (
f"SRID={srid};{p}@{timestamp}"
if srid is not None
else f"{p}@{timestamp}"
)
self._inner = tgeogpoint_in(f"SRID={srid};{p}@{timestamp}")
self._inner = tgeogpoint_in(full_str)


class TGeomPointSeq(
Expand Down
Loading