Skip to content
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
367 changes: 367 additions & 0 deletions pymeos/main/_generated/tgeogpoint_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
# Copyright (c) 2016-2026, Université libre de Bruxelles and PyMEOS
# contributors. Licensed under the PostgreSQL License (see LICENSE).
#
# ============================================================================
# GENERATED by tools/oo_codegen/codegen.py -- DO NOT EDIT.
# Regenerate:
# python3 tools/oo_codegen/codegen.py --idl <meos-idl.json> --mixin geogpoint \
# --mixin-out pymeos/main/_generated/tgeogpoint_methods.py
# ============================================================================
#
# Wired into pymeos.main.TGeogPoint via TGeogPointRegularMixin. Every method
# dispatches by argument type to the EXACT pymeos_cffi backing the
# hand-written method used -- same native call, same transforms, same
# result, never reimplemented: identical by construction.
"""Generated regular OO methods for the TGeogPoint family."""

from __future__ import annotations

from typing import TYPE_CHECKING

import shapely.geometry as shp
import shapely.geometry.base as shpb
from pymeos_cffi import *

from ...collections import FloatSpan
from ...temporal import Temporal

if TYPE_CHECKING:
pass


class TGeogPointRegularMixin:
"""Generated regular families (comparison, spatial relationship,
distance, restriction) for :class:`TGeogPoint`."""

def always_equal(self, other):
"""Generated regular ``always_equal``.

MEOS Functions:
always_eq_geo_tgeo, always_eq_tgeo_geo, always_eq_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = always_eq_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = always_eq_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result > 0

def always_intersects(self, other):
"""Generated regular ``always_intersects``.

MEOS Functions:
aintersects_geo_tgeo, aintersects_tgeo_geo, aintersects_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = aintersects_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = aintersects_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def always_not_equal(self, other):
"""Generated regular ``always_not_equal``.

MEOS Functions:
always_ne_geo_tgeo, always_ne_tgeo_geo, always_ne_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = always_ne_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = always_ne_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result > 0

def at(self, other):
"""Generated regular ``at``.

MEOS Functions:
tgeo_at_geom, tgeo_at_stbox, tgeo_at_value, tpoint_at_elevation, tpoint_at_geom, tpoint_at_value
"""
from ...boxes import STBox

if isinstance(other, shp.Point):
result = tgeo_at_value(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, shpb.BaseGeometry):
result = tgeo_at_geom(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, FloatSpan):
result = tpoint_at_elevation(self._inner, other._inner)
elif isinstance(other, STBox):
result = tgeo_at_stbox(self._inner, other._inner, True)
else:
return super().at(other)
return Temporal._factory(result)

def disjoint(self, other):
"""Generated regular ``disjoint``.

MEOS Functions:
tdisjoint_geo_tgeo, tdisjoint_tgeo_geo, tdisjoint_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, TGeogPoint):
result = tdisjoint_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return Temporal._factory(result)

def distance(self, other):
"""Generated regular ``distance``.

MEOS Functions:
tdistance_tgeo_geo, tdistance_tgeo_tgeo, tdistance_tposechain_geo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = tdistance_tgeo_geo(self._inner, geo_to_gserialized(other, True), True)
elif isinstance(other, TGeogPoint):
result = tdistance_tgeo_tgeo(self._inner, other._inner, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return Temporal._factory(result)

def ever_equal(self, other):
"""Generated regular ``ever_equal``.

MEOS Functions:
ever_eq_geo_tgeo, ever_eq_tgeo_geo, ever_eq_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = ever_eq_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = ever_eq_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result > 0

def ever_intersects(self, other):
"""Generated regular ``ever_intersects``.

MEOS Functions:
eintersects_geo_tgeo, eintersects_tgeo_geo, eintersects_tgeo_tgeo, eintersects_tpcpoint_geo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = eintersects_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = eintersects_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def ever_not_equal(self, other):
"""Generated regular ``ever_not_equal``.

MEOS Functions:
ever_ne_geo_tgeo, ever_ne_tgeo_geo, ever_ne_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = ever_ne_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = ever_ne_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result > 0

def intersects(self, other):
"""Generated regular ``intersects``.

MEOS Functions:
tintersects_geo_tgeo, tintersects_tgeo_geo, tintersects_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, TGeogPoint):
result = tintersects_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return Temporal._factory(result)

def is_always_disjoint(self, other):
"""Generated regular ``is_always_disjoint``.

MEOS Functions:
adisjoint_geo_tgeo, adisjoint_tgeo_geo, adisjoint_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = adisjoint_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = adisjoint_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def is_always_within_distance(self, other, distance):
"""Generated regular ``is_always_within_distance``.

MEOS Functions:
adwithin_geo_tgeo, adwithin_tgeo_geo, adwithin_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, TGeogPoint):
result = adwithin_tgeo_tgeo(self._inner, other._inner, distance, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def is_ever_disjoint(self, other):
"""Generated regular ``is_ever_disjoint``.

MEOS Functions:
edisjoint_geo_tgeo, edisjoint_tgeo_geo, edisjoint_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = edisjoint_tgeo_geo(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, TGeogPoint):
result = edisjoint_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def is_ever_within_distance(self, other, distance):
"""Generated regular ``is_ever_within_distance``.

MEOS Functions:
edwithin_geo_tgeo, edwithin_tgeo_geo, edwithin_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = edwithin_tgeo_geo(self._inner, geo_to_gserialized(other, True), distance, True)
elif isinstance(other, TGeogPoint):
result = edwithin_tgeo_tgeo(self._inner, other._inner, distance, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result == 1

def minus(self, other):
"""Generated regular ``minus``.

MEOS Functions:
tgeo_minus_geom, tgeo_minus_stbox, tgeo_minus_value, tpoint_minus_elevation, tpoint_minus_geom, tpoint_minus_value
"""
from ...boxes import STBox

if isinstance(other, shp.Point):
result = tgeo_minus_value(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, shpb.BaseGeometry):
result = tgeo_minus_geom(self._inner, geo_to_gserialized(other, True))
elif isinstance(other, FloatSpan):
result = tpoint_minus_elevation(self._inner, other._inner)
elif isinstance(other, STBox):
result = tgeo_minus_stbox(self._inner, other._inner, True)
else:
return super().minus(other)
return Temporal._factory(result)

def nearest_approach_distance(self, other):
"""Generated regular ``nearest_approach_distance``.

MEOS Functions:
nad_stbox_geo, nad_tgeo_geo, nad_tgeo_stbox, nad_tgeo_tgeo, nad_tpcpoint_geo, nad_tposechain_geo
"""
from ...boxes import STBox
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = nad_tgeo_geo(self._inner, geo_to_gserialized(other, True), True)
elif isinstance(other, TGeogPoint):
result = nad_tgeo_tgeo(self._inner, other._inner, True)
elif isinstance(other, STBox):
result = nad_tgeo_stbox(self._inner, other._inner, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return result

def nearest_approach_instant(self, other):
"""Generated regular ``nearest_approach_instant``.

MEOS Functions:
nai_tgeo_geo, nai_tgeo_tgeo, nai_tposechain_geo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = nai_tgeo_geo(self._inner, geo_to_gserialized(other, True), True)
elif isinstance(other, TGeogPoint):
result = nai_tgeo_tgeo(self._inner, other._inner, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return Temporal._factory(result)

def shortest_line(self, other):
"""Generated regular ``shortest_line``.

MEOS Functions:
shortestline_tgeo_geo, shortestline_tgeo_tgeo, shortestline_tposechain_geo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = shortestline_tgeo_geo(self._inner, geo_to_gserialized(other, True), True)
elif isinstance(other, TGeogPoint):
result = shortestline_tgeo_tgeo(self._inner, other._inner, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return gserialized_to_shapely_geometry(result, 10)

def temporal_equal(self, other):
"""Generated regular ``temporal_equal``.

MEOS Functions:
teq_geo_tgeo, teq_tgeo_geo
"""
if isinstance(other, shpb.BaseGeometry):
result = teq_tgeo_geo(self._inner, geo_to_gserialized(other, True))
else:
return super().temporal_equal(other)
return Temporal._factory(result)

def temporal_not_equal(self, other):
"""Generated regular ``temporal_not_equal``.

MEOS Functions:
tne_geo_tgeo, tne_tgeo_geo
"""
if isinstance(other, shpb.BaseGeometry):
result = tne_tgeo_geo(self._inner, geo_to_gserialized(other, True))
else:
return super().temporal_not_equal(other)
return Temporal._factory(result)

def within_distance(self, other, distance):
"""Generated regular ``within_distance``.

MEOS Functions:
tdwithin_geo_tgeo, tdwithin_tgeo_geo, tdwithin_tgeo_tgeo
"""
from ..tpoint import TGeogPoint

if isinstance(other, shpb.BaseGeometry):
result = tdwithin_tgeo_geo(self._inner, geo_to_gserialized(other, True), distance, True)
elif isinstance(other, TGeogPoint):
result = tdwithin_tgeo_tgeo(self._inner, other._inner, distance, True)
else:
raise TypeError(f"Operation not supported with type {other.__class__}")
return Temporal._factory(result)
Loading
Loading