Skip to content

Geospatial Expressions

Ibis supports the following geospatial expression APIs

GeoSpatialValue

Bases: NumericValue

Source code in ibis/expr/types/geospatial.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
@public
class GeoSpatialValue(NumericValue):
    def area(self) -> ir.FloatingValue:
        """Compute the area of a geospatial value.

        Returns
        -------
        FloatingValue
            The area of `self`
        """
        return ops.GeoArea(self).to_expr()

    def as_binary(self) -> ir.BinaryValue:
        """Get the geometry as well-known bytes (WKB) without the SRID data.

        Returns
        -------
        BinaryValue
            Binary value
        """
        return ops.GeoAsBinary(self).to_expr()

    def as_ewkt(self) -> ir.StringValue:
        """Get the geometry as well-known text (WKT) with the SRID data.

        Returns
        -------
        StringValue
            String value
        """
        return ops.GeoAsEWKT(self).to_expr()

    def as_text(self) -> ir.StringValue:
        """Get the geometry as well-known text (WKT) without the SRID data.

        Returns
        -------
        StringValue
            String value
        """
        return ops.GeoAsText(self).to_expr()

    def as_ewkb(self) -> ir.BinaryValue:
        """Get the geometry as well-known bytes (WKB) with the SRID data.

        Returns
        -------
        BinaryValue
            WKB value
        """
        return ops.GeoAsEWKB(self).to_expr()

    def contains(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometry contains the `right`.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` contains `right`
        """
        return ops.GeoContains(self, right).to_expr()

    def contains_properly(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the first geometry contains the second one.

        Excludes common border points.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether self contains right excluding border points.
        """
        return ops.GeoContainsProperly(self, right).to_expr()

    def covers(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the first geometry covers the second one.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` covers `right`
        """
        return ops.GeoCovers(self, right).to_expr()

    def covered_by(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the first geometry is covered by the second one.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` is covered by `right`
        """
        return ops.GeoCoveredBy(self, right).to_expr()

    def crosses(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries have at least one interior point in common.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` and `right` have at least one common interior point.
        """
        return ops.GeoCrosses(self, right).to_expr()

    def d_fully_within(
        self,
        right: GeoSpatialValue,
        distance: ir.FloatingValue,
    ) -> ir.BooleanValue:
        """Check if `self` is entirely within `distance` from `right`.

        Parameters
        ----------
        right
            Right geometry
        distance
            Distance to check

        Returns
        -------
        BooleanValue
            Whether `self` is within a specified distance from `right`.
        """
        return ops.GeoDFullyWithin(self, right, distance).to_expr()

    def disjoint(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries have no points in common.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` and `right` are disjoint
        """
        return ops.GeoDisjoint(self, right).to_expr()

    def d_within(
        self,
        right: GeoSpatialValue,
        distance: ir.FloatingValue,
    ) -> ir.BooleanValue:
        """Check if `self` is partially within `distance` from `right`.

        Parameters
        ----------
        right
            Right geometry
        distance
            Distance to check

        Returns
        -------
        BooleanValue
            Whether `self` is partially within `distance` from `right`.
        """
        return ops.GeoDWithin(self, right, distance).to_expr()

    def geo_equals(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries are equal.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` equals `right`
        """
        return ops.GeoEquals(self, right).to_expr()

    def geometry_n(self, n: int | ir.IntegerValue) -> GeoSpatialValue:
        """Get the 1-based Nth geometry of a multi geometry.

        Parameters
        ----------
        n
            Nth geometry index

        Returns
        -------
        GeoSpatialValue
            Geometry value
        """
        return ops.GeoGeometryN(self, n).to_expr()

    def geometry_type(self) -> ir.StringValue:
        """Get the type of a geometry.

        Returns
        -------
        StringValue
            String representing the type of `self`.
        """
        return ops.GeoGeometryType(self).to_expr()

    def intersects(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries share any points.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` intersects `right`
        """
        return ops.GeoIntersects(self, right).to_expr()

    def is_valid(self) -> ir.BooleanValue:
        """Check if the geometry is valid.

        Returns
        -------
        BooleanValue
            Whether `self` is valid
        """
        return ops.GeoIsValid(self).to_expr()

    def ordering_equals(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if two geometries are equal and have the same point ordering.

        Returns true if the two geometries are equal and the coordinates
        are in the same order.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether points and orderings are equal.
        """
        return ops.GeoOrderingEquals(self, right).to_expr()

    def overlaps(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries share space, have the same dimension, and are not completely contained by each other.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Overlaps indicator
        """
        return ops.GeoOverlaps(self, right).to_expr()

    def touches(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the geometries have at least one point in common, but do not intersect.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether self and right are touching
        """
        return ops.GeoTouches(self, right).to_expr()

    def distance(self, right: GeoSpatialValue) -> ir.FloatingValue:
        """Compute the distance between two geospatial expressions.

        Parameters
        ----------
        right
            Right geometry or geography

        Returns
        -------
        FloatingValue
            Distance between `self` and `right`
        """
        return ops.GeoDistance(self, right).to_expr()

    def length(self) -> ir.FloatingValue:
        """Compute the length of a geospatial expression.

        Returns
        -------
        FloatingValue
            Length of `self`
        """
        return ops.GeoLength(self).to_expr()

    def perimeter(self) -> ir.FloatingValue:
        """Compute the perimeter of a geospatial expression.

        Returns
        -------
        FloatingValue
            Perimeter of `self`
        """
        return ops.GeoPerimeter(self).to_expr()

    def max_distance(self, right: GeoSpatialValue) -> ir.FloatingValue:
        """Returns the 2-dimensional max distance between two geometries in projected units.

        If `self` and `right` are the same geometry the function will return
        the distance between the two vertices most far from each other in that
        geometry.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        FloatingValue
            Maximum distance
        """
        return ops.GeoMaxDistance(self, right).to_expr()

    def union(self, right: GeoSpatialValue) -> GeoSpatialValue:
        """Merge two geometries into a union geometry.

        Returns the pointwise union of the two geometries.
        This corresponds to the non-aggregate version the PostGIS ST_Union.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        GeoSpatialValue
            Union of geometries
        """
        return ops.GeoUnion(self, right).to_expr()

    def x(self) -> ir.FloatingValue:
        """Return the X coordinate of `self`, or NULL if not available.

        Input must be a point.

        Returns
        -------
        FloatingValue
            X coordinate of `self`
        """
        return ops.GeoX(self).to_expr()

    def y(self) -> ir.FloatingValue:
        """Return the Y coordinate of `self`, or NULL if not available.

        Input must be a point.

        Returns
        -------
        FloatingValue
            Y coordinate of `self`
        """
        return ops.GeoY(self).to_expr()

    def x_min(self) -> ir.FloatingValue:
        """Return the X minima of a geometry.

        Returns
        -------
        FloatingValue
            X minima
        """
        return ops.GeoXMin(self).to_expr()

    def x_max(self) -> ir.FloatingValue:
        """Return the X maxima of a geometry.

        Returns
        -------
        FloatingValue
            X maxima
        """
        return ops.GeoXMax(self).to_expr()

    def y_min(self) -> ir.FloatingValue:
        """Return the Y minima of a geometry.

        Returns
        -------
        FloatingValue
            Y minima
        """
        return ops.GeoYMin(self).to_expr()

    def y_max(self) -> ir.FloatingValue:
        """Return the Y maxima of a geometry.

        Returns
        -------
        FloatingValue
            Y maxima
        """
        return ops.GeoYMax(self).to_expr()

    def start_point(self) -> PointValue:
        """Return the first point of a `LINESTRING` geometry as a `POINT`.

        Return `NULL` if the input parameter is not a `LINESTRING`

        Returns
        -------
        PointValue
            Start point
        """
        return ops.GeoStartPoint(self).to_expr()

    def end_point(self) -> PointValue:
        """Return the last point of a `LINESTRING` geometry as a `POINT`.

        Return `NULL` if the input parameter is not a `LINESTRING`

        Returns
        -------
        PointValue
            End point
        """
        return ops.GeoEndPoint(self).to_expr()

    def point_n(self, n: ir.IntegerValue) -> PointValue:
        """Return the Nth point in a single linestring in the geometry.

        Negative values are counted backwards from the end of the LineString,
        so that -1 is the last point. Returns NULL if there is no linestring in
        the geometry.

        Parameters
        ----------
        n
            Nth point index

        Returns
        -------
        PointValue
            Nth point in `self`
        """
        return ops.GeoPointN(self, n).to_expr()

    def n_points(self) -> ir.IntegerValue:
        """Return the number of points in a geometry. Works for all geometries.

        Returns
        -------
        IntegerValue
            Number of points
        """
        return ops.GeoNPoints(self).to_expr()

    def n_rings(self) -> ir.IntegerValue:
        """Return the number of rings for polygons and multipolygons.

        Outer rings are counted as well.

        Returns
        -------
        IntegerValue
            Number of rings
        """
        return ops.GeoNRings(self).to_expr()

    def srid(self) -> ir.IntegerValue:
        """Return the spatial reference identifier for the ST_Geometry.

        Returns
        -------
        IntegerValue
            SRID
        """
        return ops.GeoSRID(self).to_expr()

    def set_srid(self, srid: ir.IntegerValue) -> GeoSpatialValue:
        """Set the spatial reference identifier for the `ST_Geometry`.

        Parameters
        ----------
        srid
            SRID integer value

        Returns
        -------
        GeoSpatialValue
            `self` with SRID set to `srid`
        """
        return ops.GeoSetSRID(self, srid=srid).to_expr()

    def buffer(self, radius: float | ir.FloatingValue) -> GeoSpatialValue:
        """Return all points whose distance from this geometry is less than or equal to `radius`.

        Calculations are in the Spatial Reference System of this Geometry.

        Parameters
        ----------
        radius
            Floating expression

        Returns
        -------
        GeoSpatialValue
            Geometry expression
        """
        return ops.GeoBuffer(self, radius=radius).to_expr()

    def centroid(self) -> PointValue:
        """Returns the centroid of the geometry.

        Returns
        -------
        PointValue
            The centroid
        """
        return ops.GeoCentroid(self).to_expr()

    def envelope(self) -> ir.PolygonValue:
        """Returns a geometry representing the bounding box of `self`.

        Returns
        -------
        PolygonValue
            A polygon
        """
        return ops.GeoEnvelope(self).to_expr()

    def within(self, right: GeoSpatialValue) -> ir.BooleanValue:
        """Check if the first geometry is completely inside of the second.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        BooleanValue
            Whether `self` is in `right`.
        """
        return ops.GeoWithin(self, right).to_expr()

    def azimuth(self, right: GeoSpatialValue) -> ir.FloatingValue:
        """Return the angle in radians from the horizontal of the vector defined by the inputs.

        Angle is computed clockwise from down-to-up on the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        FloatingValue
            azimuth
        """
        return ops.GeoAzimuth(self, right).to_expr()

    def intersection(self, right: GeoSpatialValue) -> GeoSpatialValue:
        """Return the intersection of two geometries.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        GeoSpatialValue
            Intersection of `self` and `right`
        """
        return ops.GeoIntersection(self, right).to_expr()

    def difference(self, right: GeoSpatialValue) -> GeoSpatialValue:
        """Return the difference of two geometries.

        Parameters
        ----------
        right
            Right geometry

        Returns
        -------
        GeoSpatialValue
            Difference of `self` and `right`
        """
        return ops.GeoDifference(self, right).to_expr()

    def simplify(
        self,
        tolerance: ir.FloatingValue,
        preserve_collapsed: ir.BooleanValue,
    ) -> GeoSpatialValue:
        """Simplify a given geometry.

        Parameters
        ----------
        tolerance
            Tolerance
        preserve_collapsed
            Whether to preserve collapsed geometries

        Returns
        -------
        GeoSpatialValue
            Simplified geometry
        """
        return ops.GeoSimplify(self, tolerance, preserve_collapsed).to_expr()

    def transform(self, srid: ir.IntegerValue) -> GeoSpatialValue:
        """Transform a geometry into a new SRID.

        Parameters
        ----------
        srid
            Integer expression

        Returns
        -------
        GeoSpatialValue
            Transformed geometry
        """
        return ops.GeoTransform(self, srid).to_expr()

    def line_locate_point(self, right: PointValue) -> ir.FloatingValue:
        """Locate the distance a point falls along the length of a line.

        Returns a float between zero and one representing the location of the
        closest point on the linestring to the given point, as a fraction of
        the total 2d line length.

        Parameters
        ----------
        right
            Point geometry

        Returns
        -------
        FloatingValue
            Fraction of the total line length
        """
        return ops.GeoLineLocatePoint(self, right).to_expr()

    def line_substring(
        self, start: ir.FloatingValue, end: ir.FloatingValue
    ) -> ir.LineStringValue:
        """Clip a substring from a LineString.

        Returns a linestring that is a substring of the input one, starting
        and ending at the given fractions of the total 2d length. The second
        and third arguments are floating point values between zero and one.
        This only works with linestrings.

        Parameters
        ----------
        start
            Start value
        end
            End value

        Returns
        -------
        LineStringValue
            Clipped linestring
        """
        return ops.GeoLineSubstring(self, start, end).to_expr()

    def line_merge(self) -> ir.LineStringValue:
        """Merge a `MultiLineString` into a `LineString`.

        Returns a (set of) LineString(s) formed by sewing together the
        constituent line work of a MultiLineString. If a geometry other than
        a LineString or MultiLineString is given, this will return an empty
        geometry collection.

        Returns
        -------
        GeoSpatialValue
            Merged linestrings
        """
        return ops.GeoLineMerge(self).to_expr()

Functions

area()

Compute the area of a geospatial value.

Returns:

Type Description
FloatingValue

The area of self

Source code in ibis/expr/types/geospatial.py
16
17
18
19
20
21
22
23
24
def area(self) -> ir.FloatingValue:
    """Compute the area of a geospatial value.

    Returns
    -------
    FloatingValue
        The area of `self`
    """
    return ops.GeoArea(self).to_expr()

as_binary()

Get the geometry as well-known bytes (WKB) without the SRID data.

Returns:

Type Description
BinaryValue

Binary value

Source code in ibis/expr/types/geospatial.py
26
27
28
29
30
31
32
33
34
def as_binary(self) -> ir.BinaryValue:
    """Get the geometry as well-known bytes (WKB) without the SRID data.

    Returns
    -------
    BinaryValue
        Binary value
    """
    return ops.GeoAsBinary(self).to_expr()

as_ewkb()

Get the geometry as well-known bytes (WKB) with the SRID data.

Returns:

Type Description
BinaryValue

WKB value

Source code in ibis/expr/types/geospatial.py
56
57
58
59
60
61
62
63
64
def as_ewkb(self) -> ir.BinaryValue:
    """Get the geometry as well-known bytes (WKB) with the SRID data.

    Returns
    -------
    BinaryValue
        WKB value
    """
    return ops.GeoAsEWKB(self).to_expr()

as_ewkt()

Get the geometry as well-known text (WKT) with the SRID data.

Returns:

Type Description
StringValue

String value

Source code in ibis/expr/types/geospatial.py
36
37
38
39
40
41
42
43
44
def as_ewkt(self) -> ir.StringValue:
    """Get the geometry as well-known text (WKT) with the SRID data.

    Returns
    -------
    StringValue
        String value
    """
    return ops.GeoAsEWKT(self).to_expr()

as_text()

Get the geometry as well-known text (WKT) without the SRID data.

Returns:

Type Description
StringValue

String value

Source code in ibis/expr/types/geospatial.py
46
47
48
49
50
51
52
53
54
def as_text(self) -> ir.StringValue:
    """Get the geometry as well-known text (WKT) without the SRID data.

    Returns
    -------
    StringValue
        String value
    """
    return ops.GeoAsText(self).to_expr()

azimuth(right)

Return the angle in radians from the horizontal of the vector defined by the inputs.

Angle is computed clockwise from down-to-up on the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
FloatingValue

azimuth

Source code in ibis/expr/types/geospatial.py
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
def azimuth(self, right: GeoSpatialValue) -> ir.FloatingValue:
    """Return the angle in radians from the horizontal of the vector defined by the inputs.

    Angle is computed clockwise from down-to-up on the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    FloatingValue
        azimuth
    """
    return ops.GeoAzimuth(self, right).to_expr()

buffer(radius)

Return all points whose distance from this geometry is less than or equal to radius.

Calculations are in the Spatial Reference System of this Geometry.

Parameters:

Name Type Description Default
radius float | ir.FloatingValue

Floating expression

required

Returns:

Type Description
GeoSpatialValue

Geometry expression

Source code in ibis/expr/types/geospatial.py
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
def buffer(self, radius: float | ir.FloatingValue) -> GeoSpatialValue:
    """Return all points whose distance from this geometry is less than or equal to `radius`.

    Calculations are in the Spatial Reference System of this Geometry.

    Parameters
    ----------
    radius
        Floating expression

    Returns
    -------
    GeoSpatialValue
        Geometry expression
    """
    return ops.GeoBuffer(self, radius=radius).to_expr()

centroid()

Returns the centroid of the geometry.

Returns:

Type Description
PointValue

The centroid

Source code in ibis/expr/types/geospatial.py
556
557
558
559
560
561
562
563
564
def centroid(self) -> PointValue:
    """Returns the centroid of the geometry.

    Returns
    -------
    PointValue
        The centroid
    """
    return ops.GeoCentroid(self).to_expr()

contains(right)

Check if the geometry contains the right.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self contains right

Source code in ibis/expr/types/geospatial.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
def contains(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometry contains the `right`.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` contains `right`
    """
    return ops.GeoContains(self, right).to_expr()

contains_properly(right)

Check if the first geometry contains the second one.

Excludes common border points.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self contains right excluding border points.

Source code in ibis/expr/types/geospatial.py
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
def contains_properly(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the first geometry contains the second one.

    Excludes common border points.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether self contains right excluding border points.
    """
    return ops.GeoContainsProperly(self, right).to_expr()

covered_by(right)

Check if the first geometry is covered by the second one.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self is covered by right

Source code in ibis/expr/types/geospatial.py
113
114
115
116
117
118
119
120
121
122
123
124
125
126
def covered_by(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the first geometry is covered by the second one.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` is covered by `right`
    """
    return ops.GeoCoveredBy(self, right).to_expr()

covers(right)

Check if the first geometry covers the second one.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self covers right

Source code in ibis/expr/types/geospatial.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
def covers(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the first geometry covers the second one.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` covers `right`
    """
    return ops.GeoCovers(self, right).to_expr()

crosses(right)

Check if the geometries have at least one interior point in common.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self and right have at least one common interior point.

Source code in ibis/expr/types/geospatial.py
128
129
130
131
132
133
134
135
136
137
138
139
140
141
def crosses(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries have at least one interior point in common.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` and `right` have at least one common interior point.
    """
    return ops.GeoCrosses(self, right).to_expr()

d_fully_within(right, distance)

Check if self is entirely within distance from right.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required
distance ir.FloatingValue

Distance to check

required

Returns:

Type Description
BooleanValue

Whether self is within a specified distance from right.

Source code in ibis/expr/types/geospatial.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
def d_fully_within(
    self,
    right: GeoSpatialValue,
    distance: ir.FloatingValue,
) -> ir.BooleanValue:
    """Check if `self` is entirely within `distance` from `right`.

    Parameters
    ----------
    right
        Right geometry
    distance
        Distance to check

    Returns
    -------
    BooleanValue
        Whether `self` is within a specified distance from `right`.
    """
    return ops.GeoDFullyWithin(self, right, distance).to_expr()

d_within(right, distance)

Check if self is partially within distance from right.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required
distance ir.FloatingValue

Distance to check

required

Returns:

Type Description
BooleanValue

Whether self is partially within distance from right.

Source code in ibis/expr/types/geospatial.py
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
def d_within(
    self,
    right: GeoSpatialValue,
    distance: ir.FloatingValue,
) -> ir.BooleanValue:
    """Check if `self` is partially within `distance` from `right`.

    Parameters
    ----------
    right
        Right geometry
    distance
        Distance to check

    Returns
    -------
    BooleanValue
        Whether `self` is partially within `distance` from `right`.
    """
    return ops.GeoDWithin(self, right, distance).to_expr()

difference(right)

Return the difference of two geometries.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
GeoSpatialValue

Difference of self and right

Source code in ibis/expr/types/geospatial.py
623
624
625
626
627
628
629
630
631
632
633
634
635
636
def difference(self, right: GeoSpatialValue) -> GeoSpatialValue:
    """Return the difference of two geometries.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    GeoSpatialValue
        Difference of `self` and `right`
    """
    return ops.GeoDifference(self, right).to_expr()

disjoint(right)

Check if the geometries have no points in common.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self and right are disjoint

Source code in ibis/expr/types/geospatial.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
def disjoint(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries have no points in common.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` and `right` are disjoint
    """
    return ops.GeoDisjoint(self, right).to_expr()

distance(right)

Compute the distance between two geospatial expressions.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry or geography

required

Returns:

Type Description
FloatingValue

Distance between self and right

Source code in ibis/expr/types/geospatial.py
313
314
315
316
317
318
319
320
321
322
323
324
325
326
def distance(self, right: GeoSpatialValue) -> ir.FloatingValue:
    """Compute the distance between two geospatial expressions.

    Parameters
    ----------
    right
        Right geometry or geography

    Returns
    -------
    FloatingValue
        Distance between `self` and `right`
    """
    return ops.GeoDistance(self, right).to_expr()

end_point()

Return the last point of a LINESTRING geometry as a POINT.

Return NULL if the input parameter is not a LINESTRING

Returns:

Type Description
PointValue

End point

Source code in ibis/expr/types/geospatial.py
461
462
463
464
465
466
467
468
469
470
471
def end_point(self) -> PointValue:
    """Return the last point of a `LINESTRING` geometry as a `POINT`.

    Return `NULL` if the input parameter is not a `LINESTRING`

    Returns
    -------
    PointValue
        End point
    """
    return ops.GeoEndPoint(self).to_expr()

envelope()

Returns a geometry representing the bounding box of self.

Returns:

Type Description
PolygonValue

A polygon

Source code in ibis/expr/types/geospatial.py
566
567
568
569
570
571
572
573
574
def envelope(self) -> ir.PolygonValue:
    """Returns a geometry representing the bounding box of `self`.

    Returns
    -------
    PolygonValue
        A polygon
    """
    return ops.GeoEnvelope(self).to_expr()

geo_equals(right)

Check if the geometries are equal.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self equals right

Source code in ibis/expr/types/geospatial.py
200
201
202
203
204
205
206
207
208
209
210
211
212
213
def geo_equals(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries are equal.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` equals `right`
    """
    return ops.GeoEquals(self, right).to_expr()

geometry_n(n)

Get the 1-based Nth geometry of a multi geometry.

Parameters:

Name Type Description Default
n int | ir.IntegerValue

Nth geometry index

required

Returns:

Type Description
GeoSpatialValue

Geometry value

Source code in ibis/expr/types/geospatial.py
215
216
217
218
219
220
221
222
223
224
225
226
227
228
def geometry_n(self, n: int | ir.IntegerValue) -> GeoSpatialValue:
    """Get the 1-based Nth geometry of a multi geometry.

    Parameters
    ----------
    n
        Nth geometry index

    Returns
    -------
    GeoSpatialValue
        Geometry value
    """
    return ops.GeoGeometryN(self, n).to_expr()

geometry_type()

Get the type of a geometry.

Returns:

Type Description
StringValue

String representing the type of self.

Source code in ibis/expr/types/geospatial.py
230
231
232
233
234
235
236
237
238
def geometry_type(self) -> ir.StringValue:
    """Get the type of a geometry.

    Returns
    -------
    StringValue
        String representing the type of `self`.
    """
    return ops.GeoGeometryType(self).to_expr()

intersection(right)

Return the intersection of two geometries.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
GeoSpatialValue

Intersection of self and right

Source code in ibis/expr/types/geospatial.py
608
609
610
611
612
613
614
615
616
617
618
619
620
621
def intersection(self, right: GeoSpatialValue) -> GeoSpatialValue:
    """Return the intersection of two geometries.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    GeoSpatialValue
        Intersection of `self` and `right`
    """
    return ops.GeoIntersection(self, right).to_expr()

intersects(right)

Check if the geometries share any points.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self intersects right

Source code in ibis/expr/types/geospatial.py
240
241
242
243
244
245
246
247
248
249
250
251
252
253
def intersects(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries share any points.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` intersects `right`
    """
    return ops.GeoIntersects(self, right).to_expr()

is_valid()

Check if the geometry is valid.

Returns:

Type Description
BooleanValue

Whether self is valid

Source code in ibis/expr/types/geospatial.py
255
256
257
258
259
260
261
262
263
def is_valid(self) -> ir.BooleanValue:
    """Check if the geometry is valid.

    Returns
    -------
    BooleanValue
        Whether `self` is valid
    """
    return ops.GeoIsValid(self).to_expr()

length()

Compute the length of a geospatial expression.

Returns:

Type Description
FloatingValue

Length of self

Source code in ibis/expr/types/geospatial.py
328
329
330
331
332
333
334
335
336
def length(self) -> ir.FloatingValue:
    """Compute the length of a geospatial expression.

    Returns
    -------
    FloatingValue
        Length of `self`
    """
    return ops.GeoLength(self).to_expr()

line_locate_point(right)

Locate the distance a point falls along the length of a line.

Returns a float between zero and one representing the location of the closest point on the linestring to the given point, as a fraction of the total 2d line length.

Parameters:

Name Type Description Default
right PointValue

Point geometry

required

Returns:

Type Description
FloatingValue

Fraction of the total line length

Source code in ibis/expr/types/geospatial.py
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
def line_locate_point(self, right: PointValue) -> ir.FloatingValue:
    """Locate the distance a point falls along the length of a line.

    Returns a float between zero and one representing the location of the
    closest point on the linestring to the given point, as a fraction of
    the total 2d line length.

    Parameters
    ----------
    right
        Point geometry

    Returns
    -------
    FloatingValue
        Fraction of the total line length
    """
    return ops.GeoLineLocatePoint(self, right).to_expr()

line_merge()

Merge a MultiLineString into a LineString.

Returns a (set of) LineString(s) formed by sewing together the constituent line work of a MultiLineString. If a geometry other than a LineString or MultiLineString is given, this will return an empty geometry collection.

Returns:

Type Description
GeoSpatialValue

Merged linestrings

Source code in ibis/expr/types/geospatial.py
717
718
719
720
721
722
723
724
725
726
727
728
729
730
def line_merge(self) -> ir.LineStringValue:
    """Merge a `MultiLineString` into a `LineString`.

    Returns a (set of) LineString(s) formed by sewing together the
    constituent line work of a MultiLineString. If a geometry other than
    a LineString or MultiLineString is given, this will return an empty
    geometry collection.

    Returns
    -------
    GeoSpatialValue
        Merged linestrings
    """
    return ops.GeoLineMerge(self).to_expr()

line_substring(start, end)

Clip a substring from a LineString.

Returns a linestring that is a substring of the input one, starting and ending at the given fractions of the total 2d length. The second and third arguments are floating point values between zero and one. This only works with linestrings.

Parameters:

Name Type Description Default
start ir.FloatingValue

Start value

required
end ir.FloatingValue

End value

required

Returns:

Type Description
LineStringValue

Clipped linestring

Source code in ibis/expr/types/geospatial.py
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
def line_substring(
    self, start: ir.FloatingValue, end: ir.FloatingValue
) -> ir.LineStringValue:
    """Clip a substring from a LineString.

    Returns a linestring that is a substring of the input one, starting
    and ending at the given fractions of the total 2d length. The second
    and third arguments are floating point values between zero and one.
    This only works with linestrings.

    Parameters
    ----------
    start
        Start value
    end
        End value

    Returns
    -------
    LineStringValue
        Clipped linestring
    """
    return ops.GeoLineSubstring(self, start, end).to_expr()

max_distance(right)

Returns the 2-dimensional max distance between two geometries in projected units.

If self and right are the same geometry the function will return the distance between the two vertices most far from each other in that geometry.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
FloatingValue

Maximum distance

Source code in ibis/expr/types/geospatial.py
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
def max_distance(self, right: GeoSpatialValue) -> ir.FloatingValue:
    """Returns the 2-dimensional max distance between two geometries in projected units.

    If `self` and `right` are the same geometry the function will return
    the distance between the two vertices most far from each other in that
    geometry.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    FloatingValue
        Maximum distance
    """
    return ops.GeoMaxDistance(self, right).to_expr()

n_points()

Return the number of points in a geometry. Works for all geometries.

Returns:

Type Description
IntegerValue

Number of points

Source code in ibis/expr/types/geospatial.py
492
493
494
495
496
497
498
499
500
def n_points(self) -> ir.IntegerValue:
    """Return the number of points in a geometry. Works for all geometries.

    Returns
    -------
    IntegerValue
        Number of points
    """
    return ops.GeoNPoints(self).to_expr()

n_rings()

Return the number of rings for polygons and multipolygons.

Outer rings are counted as well.

Returns:

Type Description
IntegerValue

Number of rings

Source code in ibis/expr/types/geospatial.py
502
503
504
505
506
507
508
509
510
511
512
def n_rings(self) -> ir.IntegerValue:
    """Return the number of rings for polygons and multipolygons.

    Outer rings are counted as well.

    Returns
    -------
    IntegerValue
        Number of rings
    """
    return ops.GeoNRings(self).to_expr()

ordering_equals(right)

Check if two geometries are equal and have the same point ordering.

Returns true if the two geometries are equal and the coordinates are in the same order.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether points and orderings are equal.

Source code in ibis/expr/types/geospatial.py
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
def ordering_equals(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if two geometries are equal and have the same point ordering.

    Returns true if the two geometries are equal and the coordinates
    are in the same order.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether points and orderings are equal.
    """
    return ops.GeoOrderingEquals(self, right).to_expr()

overlaps(right)

Check if the geometries share space, have the same dimension, and are not completely contained by each other.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Overlaps indicator

Source code in ibis/expr/types/geospatial.py
283
284
285
286
287
288
289
290
291
292
293
294
295
296
def overlaps(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries share space, have the same dimension, and are not completely contained by each other.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Overlaps indicator
    """
    return ops.GeoOverlaps(self, right).to_expr()

perimeter()

Compute the perimeter of a geospatial expression.

Returns:

Type Description
FloatingValue

Perimeter of self

Source code in ibis/expr/types/geospatial.py
338
339
340
341
342
343
344
345
346
def perimeter(self) -> ir.FloatingValue:
    """Compute the perimeter of a geospatial expression.

    Returns
    -------
    FloatingValue
        Perimeter of `self`
    """
    return ops.GeoPerimeter(self).to_expr()

point_n(n)

Return the Nth point in a single linestring in the geometry.

Negative values are counted backwards from the end of the LineString, so that -1 is the last point. Returns NULL if there is no linestring in the geometry.

Parameters:

Name Type Description Default
n ir.IntegerValue

Nth point index

required

Returns:

Type Description
PointValue

Nth point in self

Source code in ibis/expr/types/geospatial.py
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
def point_n(self, n: ir.IntegerValue) -> PointValue:
    """Return the Nth point in a single linestring in the geometry.

    Negative values are counted backwards from the end of the LineString,
    so that -1 is the last point. Returns NULL if there is no linestring in
    the geometry.

    Parameters
    ----------
    n
        Nth point index

    Returns
    -------
    PointValue
        Nth point in `self`
    """
    return ops.GeoPointN(self, n).to_expr()

set_srid(srid)

Set the spatial reference identifier for the ST_Geometry.

Parameters:

Name Type Description Default
srid ir.IntegerValue

SRID integer value

required

Returns:

Type Description
GeoSpatialValue

self with SRID set to srid

Source code in ibis/expr/types/geospatial.py
524
525
526
527
528
529
530
531
532
533
534
535
536
537
def set_srid(self, srid: ir.IntegerValue) -> GeoSpatialValue:
    """Set the spatial reference identifier for the `ST_Geometry`.

    Parameters
    ----------
    srid
        SRID integer value

    Returns
    -------
    GeoSpatialValue
        `self` with SRID set to `srid`
    """
    return ops.GeoSetSRID(self, srid=srid).to_expr()

simplify(tolerance, preserve_collapsed)

Simplify a given geometry.

Parameters:

Name Type Description Default
tolerance ir.FloatingValue

Tolerance

required
preserve_collapsed ir.BooleanValue

Whether to preserve collapsed geometries

required

Returns:

Type Description
GeoSpatialValue

Simplified geometry

Source code in ibis/expr/types/geospatial.py
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
def simplify(
    self,
    tolerance: ir.FloatingValue,
    preserve_collapsed: ir.BooleanValue,
) -> GeoSpatialValue:
    """Simplify a given geometry.

    Parameters
    ----------
    tolerance
        Tolerance
    preserve_collapsed
        Whether to preserve collapsed geometries

    Returns
    -------
    GeoSpatialValue
        Simplified geometry
    """
    return ops.GeoSimplify(self, tolerance, preserve_collapsed).to_expr()

srid()

Return the spatial reference identifier for the ST_Geometry.

Returns:

Type Description
IntegerValue

SRID

Source code in ibis/expr/types/geospatial.py
514
515
516
517
518
519
520
521
522
def srid(self) -> ir.IntegerValue:
    """Return the spatial reference identifier for the ST_Geometry.

    Returns
    -------
    IntegerValue
        SRID
    """
    return ops.GeoSRID(self).to_expr()

start_point()

Return the first point of a LINESTRING geometry as a POINT.

Return NULL if the input parameter is not a LINESTRING

Returns:

Type Description
PointValue

Start point

Source code in ibis/expr/types/geospatial.py
449
450
451
452
453
454
455
456
457
458
459
def start_point(self) -> PointValue:
    """Return the first point of a `LINESTRING` geometry as a `POINT`.

    Return `NULL` if the input parameter is not a `LINESTRING`

    Returns
    -------
    PointValue
        Start point
    """
    return ops.GeoStartPoint(self).to_expr()

touches(right)

Check if the geometries have at least one point in common, but do not intersect.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self and right are touching

Source code in ibis/expr/types/geospatial.py
298
299
300
301
302
303
304
305
306
307
308
309
310
311
def touches(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the geometries have at least one point in common, but do not intersect.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether self and right are touching
    """
    return ops.GeoTouches(self, right).to_expr()

transform(srid)

Transform a geometry into a new SRID.

Parameters:

Name Type Description Default
srid ir.IntegerValue

Integer expression

required

Returns:

Type Description
GeoSpatialValue

Transformed geometry

Source code in ibis/expr/types/geospatial.py
659
660
661
662
663
664
665
666
667
668
669
670
671
672
def transform(self, srid: ir.IntegerValue) -> GeoSpatialValue:
    """Transform a geometry into a new SRID.

    Parameters
    ----------
    srid
        Integer expression

    Returns
    -------
    GeoSpatialValue
        Transformed geometry
    """
    return ops.GeoTransform(self, srid).to_expr()

union(right)

Merge two geometries into a union geometry.

Returns the pointwise union of the two geometries. This corresponds to the non-aggregate version the PostGIS ST_Union.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
GeoSpatialValue

Union of geometries

Source code in ibis/expr/types/geospatial.py
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
def union(self, right: GeoSpatialValue) -> GeoSpatialValue:
    """Merge two geometries into a union geometry.

    Returns the pointwise union of the two geometries.
    This corresponds to the non-aggregate version the PostGIS ST_Union.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    GeoSpatialValue
        Union of geometries
    """
    return ops.GeoUnion(self, right).to_expr()

within(right)

Check if the first geometry is completely inside of the second.

Parameters:

Name Type Description Default
right GeoSpatialValue

Right geometry

required

Returns:

Type Description
BooleanValue

Whether self is in right.

Source code in ibis/expr/types/geospatial.py
576
577
578
579
580
581
582
583
584
585
586
587
588
589
def within(self, right: GeoSpatialValue) -> ir.BooleanValue:
    """Check if the first geometry is completely inside of the second.

    Parameters
    ----------
    right
        Right geometry

    Returns
    -------
    BooleanValue
        Whether `self` is in `right`.
    """
    return ops.GeoWithin(self, right).to_expr()

x()

Return the X coordinate of self, or NULL if not available.

Input must be a point.

Returns:

Type Description
FloatingValue

X coordinate of self

Source code in ibis/expr/types/geospatial.py
385
386
387
388
389
390
391
392
393
394
395
def x(self) -> ir.FloatingValue:
    """Return the X coordinate of `self`, or NULL if not available.

    Input must be a point.

    Returns
    -------
    FloatingValue
        X coordinate of `self`
    """
    return ops.GeoX(self).to_expr()

x_max()

Return the X maxima of a geometry.

Returns:

Type Description
FloatingValue

X maxima

Source code in ibis/expr/types/geospatial.py
419
420
421
422
423
424
425
426
427
def x_max(self) -> ir.FloatingValue:
    """Return the X maxima of a geometry.

    Returns
    -------
    FloatingValue
        X maxima
    """
    return ops.GeoXMax(self).to_expr()

x_min()

Return the X minima of a geometry.

Returns:

Type Description
FloatingValue

X minima

Source code in ibis/expr/types/geospatial.py
409
410
411
412
413
414
415
416
417
def x_min(self) -> ir.FloatingValue:
    """Return the X minima of a geometry.

    Returns
    -------
    FloatingValue
        X minima
    """
    return ops.GeoXMin(self).to_expr()

y()

Return the Y coordinate of self, or NULL if not available.

Input must be a point.

Returns:

Type Description
FloatingValue

Y coordinate of self

Source code in ibis/expr/types/geospatial.py
397
398
399
400
401
402
403
404
405
406
407
def y(self) -> ir.FloatingValue:
    """Return the Y coordinate of `self`, or NULL if not available.

    Input must be a point.

    Returns
    -------
    FloatingValue
        Y coordinate of `self`
    """
    return ops.GeoY(self).to_expr()

y_max()

Return the Y maxima of a geometry.

Returns:

Type Description
FloatingValue

Y maxima

Source code in ibis/expr/types/geospatial.py
439
440
441
442
443
444
445
446
447
def y_max(self) -> ir.FloatingValue:
    """Return the Y maxima of a geometry.

    Returns
    -------
    FloatingValue
        Y maxima
    """
    return ops.GeoYMax(self).to_expr()

y_min()

Return the Y minima of a geometry.

Returns:

Type Description
FloatingValue

Y minima

Source code in ibis/expr/types/geospatial.py
429
430
431
432
433
434
435
436
437
def y_min(self) -> ir.FloatingValue:
    """Return the Y minima of a geometry.

    Returns
    -------
    FloatingValue
        Y minima
    """
    return ops.GeoYMin(self).to_expr()

GeoSpatialColumn

Bases: NumericColumn, GeoSpatialValue

Source code in ibis/expr/types/geospatial.py
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
@public
class GeoSpatialColumn(NumericColumn, GeoSpatialValue):
    def unary_union(self) -> ir.GeoSpatialScalar:
        """Aggregate a set of geometries into a union.

        This corresponds to the aggregate version of the PostGIS ST_Union.
        We give it a different name (following the corresponding method
        in GeoPandas) to avoid name conflicts with the non-aggregate version.

        Returns
        -------
        GeoSpatialScalar
            Union of geometries
        """
        return ops.GeoUnaryUnion(self).to_expr().name("union")

Functions

unary_union()

Aggregate a set of geometries into a union.

This corresponds to the aggregate version of the PostGIS ST_Union. We give it a different name (following the corresponding method in GeoPandas) to avoid name conflicts with the non-aggregate version.

Returns:

Type Description
GeoSpatialScalar

Union of geometries

Source code in ibis/expr/types/geospatial.py
740
741
742
743
744
745
746
747
748
749
750
751
752
def unary_union(self) -> ir.GeoSpatialScalar:
    """Aggregate a set of geometries into a union.

    This corresponds to the aggregate version of the PostGIS ST_Union.
    We give it a different name (following the corresponding method
    in GeoPandas) to avoid name conflicts with the non-aggregate version.

    Returns
    -------
    GeoSpatialScalar
        Union of geometries
    """
    return ops.GeoUnaryUnion(self).to_expr().name("union")

Last update: June 22, 2023