다음을 통해 공유


st_touches

중요합니다

이 기능은 공개 미리보기 단계에 있습니다.

두 기하 도형이 서로 닿으면 반환 True 합니다. Geometry 컬렉션은 지원되지 않습니다.

해당 Databricks SQL 함수에 대해 알아보려면 st_touches 함수를 참조하세요.

문법

from pyspark.databricks.sql import functions as dbf

dbf.st_touches(col1=<col1>, col2=<col2>)

매개 변수

매개 변수 유형 Description
col1 pyspark.sql.Column 또는 str 첫 번째 Geometry 값.
col2 pyspark.sql.Column 또는 str 두 번째 Geometry 값입니다.

비고

두 기하 도형의 SRID 값이 같을 것으로 예상되며, 그렇지 않으면 오류가 반환됩니다.

예시

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 0,5 10)','MULTILINESTRING((0 0,10 10),(0 10,10 0))',)], ['wkt1', 'wkt2'])
df.select(dbf.st_touches(dbf.st_geomfromtext('wkt1'), dbf.st_geomfromtext('wkt2')).alias('result')).collect()
[Row(result=False)]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 5,5 0,10 0)','MULTILINESTRING((0 0,10 10),(0 10,10 0))',)], ['wkt1', 'wkt2'])
df.select(dbf.st_touches(dbf.st_geomfromtext('wkt1'), dbf.st_geomfromtext('wkt2')).alias('result')).collect()
[Row(result=True)]