[
https://issues.apache.org/jira/browse/SEDONA-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17707906#comment-17707906
]
Jia Yu commented on SEDONA-269:
-------------------------------
[~umartin] I believe we could re-use some logic from our Geotiff writer
implementation since it can write binary to geotiff:
https://github.com/apache/sedona/tree/master/sql/src/main/scala/org/apache/spark/sql/sedona_sql/io
> Add data source for writing binary files
> ----------------------------------------
>
> Key: SEDONA-269
> URL: https://issues.apache.org/jira/browse/SEDONA-269
> Project: Apache Sedona
> Issue Type: Improvement
> Reporter: Martin Andersson
> Priority: Major
>
> The main use case in Sedona would be to write raster files in other formats
> than Geotiff.
> The binary file data source in Spark makes it easy to support reading
> different raster formats in Sedona. We only need to implement a function to
> convert the binary content to a raster.
> Spark doesn't offer a binary data source that supports writing. That could be
> implemented in Sedona.
> The benefits to Sedona would be:
> * Sedona would be able to support writing different raster formats by
> implementing different RS_As[ImageFormat] functions instead of creating a
> custom data source for each format. Like
> [https://postgis.net/docs/RT_reference.html#Raster_Outputs]
> * Users would be able to transport rasters in common formats to other data
> stores like RDBMS.
> Example:
> {code}
> // Writing rasters to file using the proposed data source:
> df.selectExpr("filename",
> "RS_AsPNG(raster)").write.format("binary").path(....)
> // Transfering rasters to Postgis:
> df.selectExpr("filename", "RS_AsWKB(raster)").write.format("jdbc").option(...)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)