Σημείωση
Η πρόσβαση σε αυτή τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να συνδεθείτε ή να αλλάξετε καταλόγους.
Η πρόσβαση σε αυτή τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να αλλάξετε καταλόγους.
Important
This feature is in Public Preview.
Returns True if the first geometry is within the second geometry. Geometry collections are not supported.
For the corresponding Databricks SQL function, see st_within function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_within(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
The first Geometry value. |
col2 |
pyspark.sql.Column or str |
The second Geometry value. |
Notes
The two geometries are expected to have the same SRID value, otherwise an error is returned.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(1 1)','POLYGON((0 0,10 0,0 10,0 0))',)], ['wkt1', 'wkt2'])
df.select(dbf.st_within(dbf.st_geomfromtext('wkt1'), dbf.st_geomfromtext('wkt2')).alias('result')).collect()
[Row(result=True)]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(5 6)','POLYGON((0 0,10 0,0 10,0 0))',)], ['wkt1', 'wkt2'])
df.select(dbf.st_within(dbf.st_geomfromtext('wkt1', 4326), dbf.st_geomfromtext('wkt2', 4326)).alias('result')).collect()
[Row(result=False)]