Public
Edited
Mar 21, 2024
7 stars
Insert cell
Insert cell
Insert cell
// charger les données
zipped = new Promise((resolve, reject) =>
load && remote("https://www.data.gouv.fr/fr/datasets/r/c1dcd2cd-2c94-4e76-9380-eb1d9d0877e1").zip()
.then(resolve, reject))
Insert cell
// dezipper et ouvrir avec SPL
bat41 = zipped
.file("bnb_export_41.gpkg")
.arrayBuffer()
.then((buffer) => spl.db(buffer))
Insert cell
// faire une requête
req = bat41.exec("select * from batiment WHERE insee_nom_commune = 'MAZANGE'")
Insert cell
Insert cell
features = Array.from(await req.get.objs, (d) => d.geombui)
Insert cell
// on cartographie la requête
Plot.plot({
height: 1000,
projection: {
type: "reflect-y",
domain: { type: "FeatureCollection", features }
},
marks: [Plot.geo(features)]
})
Insert cell
Insert cell
import { Plot } from "@observablehq/plot-geo"
Insert cell
import {remote} from "@observablehq/remote"
Insert cell
SPL = import("https://cdn.skypack.dev/spl.js@0.1.0-beta.3?min")
Insert cell
spl = SPL.default()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more