Get help from the marimo community

Updated 7 months ago

Can you load an ESRI shapefile in a marimo sql cell?

At a glance

The community member is experiencing a ComputerError when trying to create a table from an ESRI shapefile. The error message indicates that the "datatype [binary data] cannot be written to csv". In the comments, another community member suggests that the issue may be resolved by installing and loading the spatial extension for DuckDB, as referenced in the provided link. Another community member mentions having a similar issue with a Jupyter notebook working with DuckDB and needing to "tweak the code to do it the marimo way". Finally, a third community member provides an example of creating a table from Parquet files and selecting the cl_cell_id and geometry data using the ST_GeomFromText function.

Useful resources
I'm getting a ComputerError when i Trey to create a table from an ESRI shaepfile.

CREATE OR REPLACE table piers AS
select *
from './data/in/gis/OneDrive_1_19-08-2024/OutlineGeofence.shp';

This cell raised an exception: ComputeError('datatype [binary data] cannot be written to csv')
A
h
3 comments
You may need to install and load the spatial extension: https://duckdb.org/docs/extensions/spatial.html
I got that as I had a jpuyter notebook working with duckdb. I have to tweak my code to do it the marimo way.
CREATE OR REPLACE table cells AS
from 's3://cl-ckdelta-production-3uk/processed/cells/active_cells/year=2024/month=7/*.parquet';
select cl_cell_id,ST_GeomFromText(geometry27700) as geometry from cells;
Add a reply
Sign up and join the conversation on Discord