# Extensions (spatial extension) with duckdb

**URL:** <https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712>\
**Category:** Help\
**Created:** [January 19, 2024, 9:03pm UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712 "2024-01-19T21:03:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjyberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bjyberg/32/8444_2.png) [@bjyberg](https://talk.observablehq.com/u/bjyberg)\
**Post date:** [January 19, 2024, 9:03pm UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/1 "2024-01-19T21:03:10Z")

</div>

Has anyone tried to use a duckdb extension in observable with any luck? The spatial extension would be amazing to use with geoparquet datasets. I’ve tried to install it in a connection query `con.query(`INSTALL spatial`)` and recieve the error “Error: IO Error: Can’t find the home directory at ‘/home/web\_user’  
Specify a home directory using the SET home\_directory=‘/path/to/dir’ option.” Is this possible/does anyone have any good work around for loading and querying large geoparquet datasets in observable?

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [January 20, 2024, 1:07am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/2 "2024-01-20T01:07:41Z")

</div>

The DuckDB-Wasm version used by Observable is currently a few versions behind. Once it has caught up you should be able to use extensions as described here: [Extensions for DuckDB-Wasm - DuckDB](https://duckdb.org/2023/12/18/duckdb-extensions-in-wasm.html)

You can follow the progress in this issue: [Update duckdb-wasm to latest · Issue #588 · observablehq/feedback · GitHub](https://github.com/observablehq/feedback/issues/588)

---

<div class="post-metadata">

**Author:** ![neocarto](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/neocarto/32/6554_2.png) [@neocarto](https://talk.observablehq.com/u/neocarto)\
**Post date:** [February 3, 2024, 7:22am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/3 "2024-02-03T07:22:18Z")

</div>

I can’t wait…

---

<div class="post-metadata">

**Author:** ![neocarto](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/neocarto/32/6554_2.png) [@neocarto](https://talk.observablehq.com/u/neocarto)\
**Post date:** [March 6, 2024, 7:41am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/4 "2024-03-06T07:41:28Z")

</div>

No news yet? No calendar?

---

<div class="post-metadata">

**Author:** ![bjyberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bjyberg/32/8444_2.png) [@bjyberg](https://talk.observablehq.com/u/bjyberg)\
**Post date:** [March 6, 2024, 9:20am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/5 "2024-03-06T09:20:30Z")

</div>

@neocarto It is possible to work around by using the latest version of the duckdb-wasm package installed from NPM, rather than the one built in with Observable. You have to manually setup the DB (or just pull the newest client from [this notebook](https://observablehq.com/@kimmolinna/duckdb-latest/2)). From there you can install and load the spatial extension without issue. Happy to send along a brief example if useful.

---

<div class="post-metadata">

**Author:** ![neocarto](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/neocarto/32/6554_2.png) [@neocarto](https://talk.observablehq.com/u/neocarto)\
**Post date:** [March 6, 2024, 11:28am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/6 "2024-03-06T11:28:45Z")

</div>

I would appreciate to see a notebook with a minimal example of spatial request with duckdb

---

<div class="post-metadata">

**Author:** ![bjyberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bjyberg/32/8444_2.png) [@bjyberg](https://talk.observablehq.com/u/bjyberg)\
**Post date:** [March 8, 2024, 12:55am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/7 "2024-03-08T00:55:23Z")

</div>

@neocarto Here you go! Hope it helps! [DuckDB Spatial Extensions in Observable Notebooks / Brayden Youngberg's Workspace | Observable](https://observablehq.com/d/05eeb7bcdd6afccd)

---

<div class="post-metadata">

**Author:** ![neocarto](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/neocarto/32/6554_2.png) [@neocarto](https://talk.observablehq.com/u/neocarto)\
**Post date:** [March 8, 2024, 7:23am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/8 "2024-03-08T07:23:30Z")

</div>

> [@neocarto](#):
>
> te to see a notebook with a mini

Thank you. Its works. But I need to re-run the cell containing the sql query for the notebook to execute properly

---

<div class="post-metadata">

**Author:** ![bjyberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bjyberg/32/8444_2.png) [@bjyberg](https://talk.observablehq.com/u/bjyberg)\
**Post date:** [March 8, 2024, 8:37am UTC](https://talk.observablehq.com/t/extensions-spatial-extension-with-duckdb/8712/9 "2024-03-08T08:37:56Z")

</div>

Fixed by placing adding the table when creating the initial connection, Cheers!
