Can you load an ESRI shapefile in a marimo sql cell?
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')
2 Replies
You may need to install and load the spatial extension: https://duckdb.org/docs/extensions/spatial.html
DuckDB
Spatial Extension
The spatial extension provides support for geospatial data processing in DuckDB. For an overview of the extension, see our blog post. Installing and Loading To install and load the spatial extension, run: INSTALL spatial; LOAD spatial; GEOMETRY Type The core of the spatial extension is the GEOMETRY type. If you're unfamiliar with geospatial data...
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;