Skip to content

Geospatial function #3259

Closed Answered by cpcloud
davidjianu39 asked this question in Q&A
Jan 9, 2022 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

You can construct geometry literals using shapely types:

In [9]: import ibis

In [10]: import shapely

In [11]: ibis.literal(shapely.geometry.Point(0, 0))
Out[11]: value: point = <shapely.geometry.point.Point object at 0x7f1a824e0820>

In [12]: ibis.literal(shapely.geometry.Point(0, 0)).type()
Out[12]: Point(nullable=True)

and you can also use tuples in the case of point and similarly for polygon

In [25]: ibis.literal(((0, 1), (1, 0), (0, 3)), type="polygon")
Out[25]: value: polygon = ((0, 1), (1, 0), (0, 3))

In [26]: ibis.literal(((0, 1), (1, 0), (0, 3)), type="polygon").type()
Out[26]: Polygon(nullable=True)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rcutler-ursa
Comment options

Answer selected by cpcloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants