From 34d2c50046d33de99bbb1c9d627261e2a0ec47ed Mon Sep 17 00:00:00 2001 From: Diego Ripley Date: Fri, 30 May 2025 17:29:58 +0000 Subject: [PATCH] Update DuckDB longboard example --- ...duckdb_census_of_population_lonboard.ipynb | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/experiments/duckdb_census_of_population_lonboard.ipynb b/experiments/duckdb_census_of_population_lonboard.ipynb index 8b824f7..e500e01 100644 --- a/experiments/duckdb_census_of_population_lonboard.ipynb +++ b/experiments/duckdb_census_of_population_lonboard.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 330, + "execution_count": 12, "id": "56ac906e", "metadata": {}, "outputs": [], @@ -13,16 +13,8 @@ "from lonboard import BitmapTileLayer, Map, PolygonLayer\n", "from lonboard.colormap import apply_categorical_cmap\n", "import numpy as np\n", - "import pyarrow as pa" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "708e293d", - "metadata": {}, - "outputs": [], - "source": [ + "import pyarrow as pa\n", + "\n", "con = duckdb.connect()\n", "con.install_extension(\"spatial\")\n", "con.load_extension(\"spatial\")" @@ -39,17 +31,17 @@ }, { "cell_type": "code", - "execution_count": 345, + "execution_count": 26, "id": "580c82ad-f64d-439f-9055-2307fdf7cccd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 345, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -71,7 +63,7 @@ "FROM\n", " 'https://data.dataforcanada.org/processed/statistics_canada/census_of_population/2021/tabular/da_2021.parquet' AS cop,\n", " 'https://data.dataforcanada.org/processed/statistics_canada/boundaries/2021/digital_boundary_files/da_2021.parquet' AS geo\n", - "WHERE geo.csd_name IN ('Ottawa') AND cop.da_dguid = geo.da_dguid;\n", + "WHERE geo.csd_name IN ('Vancouver') AND cop.da_dguid = geo.da_dguid;\n", "\n", "\"\"\")\n", "\n", @@ -82,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 346, + "execution_count": 30, "id": "e4794c4d-6013-40b5-8e59-046fc2495d34", "metadata": {}, "outputs": [], @@ -98,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": 347, + "execution_count": 31, "id": "8672f3f8-82bf-439e-8558-cb3566f2062f", "metadata": {}, "outputs": [], @@ -121,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 353, + "execution_count": 32, "id": "f265300a-9cf7-4ab7-8bdb-d66feae3a2f8", "metadata": {}, "outputs": [], @@ -141,7 +133,7 @@ }, { "cell_type": "code", - "execution_count": 355, + "execution_count": 33, "id": "a6a2ae6c-61b7-4c0e-bbe7-a580a511ee5a", "metadata": {}, "outputs": [], @@ -160,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 356, + "execution_count": 34, "id": "56e96627-0e82-436a-bd8e-e51546c7526b", "metadata": {}, "outputs": [], @@ -177,7 +169,7 @@ }, { "cell_type": "code", - "execution_count": 357, + "execution_count": 35, "id": "fef53303-147d-44af-b8f4-b824f64b486f", "metadata": {}, "outputs": [], @@ -187,12 +179,12 @@ }, { "cell_type": "code", - "execution_count": 358, + "execution_count": 36, "id": "6935a061-41fc-4223-b155-4caf4c6df103", "metadata": {}, "outputs": [], "source": [ - "cop_layer = PolygonLayer.from_geopandas(gdf=gpf,\n", + "cop_layer = PolygonLayer.from_geopandas(gdf=dwellings_df,\n", " stroked=True,\n", " get_fill_color=get_color,\n", " get_line_color=[255, 255, 255],\n", @@ -206,7 +198,7 @@ }, { "cell_type": "code", - "execution_count": 359, + "execution_count": 37, "id": "1ab3dded-cff9-40cb-ac32-306581018083", "metadata": {}, "outputs": [], @@ -216,14 +208,14 @@ }, { "cell_type": "code", - "execution_count": 360, - "id": "3ca8da4b-d287-47f9-8488-cff7b02586b8", + "execution_count": 38, + "id": "afb530c1-f652-4aaa-a3fc-1214a71ffdce", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "fb9e669faec9417dbf4954620c6f9af6", + "model_id": "5d5e30381eff4f839a04ae81eff1b1e2", "version_major": 2, "version_minor": 1 }, @@ -231,7 +223,7 @@ "Map(custom_attribution='', layers=(BitmapTileLayer(data='http://mt0.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={…" ] }, - "execution_count": 360, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" }