james-willis commented on code in PR #1159:
URL: https://github.com/apache/sedona-db/pull/1159#discussion_r3899043443
##########
python/sedonadb/python/sedonadb/testing.py:
##########
@@ -375,6 +395,22 @@ def create_table_arrow(self, name, obj) -> "SedonaDB":
self.con.create_data_frame(obj).to_view(name, overwrite=True)
return self
+ def create_raster_view(self, name, path) -> "SedonaDB":
+ self.con.sql(f"SELECT RS_FromPath('{path}') AS rast").to_view(
+ name, overwrite=True
+ )
+ return self
+
+ def decode_raster_result(self, sql):
+ from sedonadb.raster_testing import decode_raster
+
+ # RS_FromPath yields an OutDb (lazy) raster, so materialize the result
+ # before reading its pixels; Sedona Spark's RS_FromGeoTiff loads
eagerly,
+ # so this keeps the two engines comparing the same bytes.
+ loaded = f"SELECT RS_EnsureLoaded(c) AS c FROM ({sql}) AS sub(c)"
+ table = self.execute_and_collect(loaded)
+ return decode_raster(table.column(0)[0])
Review Comment:
No I don't think it should. I consider that to be an internal detail of the
system rather than a documented/stable behavior. similarly I don't think lazy
cropping should be tested for parity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]