sedona
sedona copied to clipboard
[Python] Rendering image in jupyter notebook using SedonaUtils, display_image takes long time
calling
class SedonaUtils:
@classmethod
def display_image(cls, df):
from IPython.display import HTML, display
pdf = SedonaMapUtils.__convert_to_gdf_or_pdf__(df, rename=False)
display(HTML(pdf.to_html(escape=False)))
In the jupyter notebook on the raster DataFrame, running the display_image is not finishing for a raster 1400x800
replacing this with
from IPython.display import Image, display
png_frame = raster \
.selectExpr("RS_AsPNG(rast)")
image_data = png_frame.head()[0]
display(Image(image_data))
We could call the RS_AsPNG and the Image function or utilize arrow on bytes
cc: @jiayuasu