You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
case class A(g : String)
val a0 = 1.0
val a1 = 11.0
val d = Seq( A(s"POLYGON (($a0 $a0, $a1 $a0, $a1 $a1, $a0 $a1, $a0 $a0))"))
import spark.implicits._
val df = d.toDS().toDF()
val df2 = df
.withColumn("geo", expr("ST_GeomFromWKT(g)"))
.withColumn("Is4_4", expr("ST_Contains(geo, ST_Point(4,4))")) // should be in
.withColumn("px", expr("ST_Pixelize(geo, 10,10, ST_PolygonFromEnvelope(0,0,12,12))")) // make sure (a0,a0) to (a1,a1)
println( s"Number of pixels: ${df2.select( explode(col("px")) ).count()} - would expect ${(a1-a0) * (a1-a0)} ")
df2.select( col("geo"), size(col("px")), col("Is4_4"), expr("ST_Area(geo)"), expr("ST_Length(geo)")).show(false)
df2 .select( explode(col("px")) ) .show(false)
Settings
Sedona version = 1.5.0
Apache Spark version = 3.3.0
Apache Flink version = ?
API type = Scala,
Scala version = 2.12
JRE version = 1.8
Python version = ?
Environment = Databricks
The text was updated successfully, but these errors were encountered:
Expected behavior
drawing 10 x 10 polygon expect 100 pixels
Actual behavior
drawing 10 x 10 polygon only getting 40, on the boundary
output - size(px) is wrong
Steps to reproduce the problem
Settings
Sedona version = 1.5.0
Apache Spark version = 3.3.0
Apache Flink version = ?
API type = Scala,
Scala version = 2.12
JRE version = 1.8
Python version = ?
Environment = Databricks
The text was updated successfully, but these errors were encountered: