Public
Edited
Jul 7
Insert cell
Insert cell
Insert cell
dbClient
SELECT * FROM arbolado
Insert cell
Insert cell
Insert cell
mutable puntos = []
Insert cell
maping.map.on("moveend", async () => {
const bounds = maping.map.getBounds();
console.log(bounds);
const query = `
SELECT lat, lon FROM arbolado
WHERE lat BETWEEN ${bounds.getSouth()} AND ${bounds.getNorth()}
AND lon BETWEEN ${bounds.getWest()} AND ${bounds.getEast()};
`;
const result = await dbClient.query(query);

mutable puntos = result;
})
Insert cell
puntos.forEach(({ lat, lon }) =>
L.circle([lat, lon], {
radius: 2,
fillColor: "green",
fillOpacity: 0.8,
stroke: false
}).addTo(maping.map)
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3.mean(barrios_arboles.features.map((d) => d.properties.arboles))
Insert cell
Insert cell
Insert cell
Insert cell
kde = require("fast-kde")
Insert cell
density1d = kde.density1d(
barrios_arboles.features
.map((d) => d.properties.arboles)
.sort((a, b) => a - b),
{ bandwidth: 1, pad: 4, bins: 512 }
)
Insert cell
barrios_arboles.features.map((d) => d.properties.arboles).sort((a, b) => a - b)
Insert cell
Insert cell
parcelas_visualize = FileAttachment("parcelas_visualize.parquet")
Insert cell
parcelas = geoparquet.toGeoJson({
file: await parcelas_visualize.arrayBuffer()
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
width: 800,
projection: {
type: "reflect-y",
domain: distancias
},
marks: [
Plot.geo(distancias, {
fill: (d) =>
Math.min(
d.properties["distancia_a_Paseo Bolivar"],
d.properties.distancia_a_Buenavista
)
})
]
})
Insert cell
centros = FileAttachment("centros@3.geojson").json()
Insert cell
Insert cell
arbolesporbarrio = barrios_arboles.features.map((feat) => {
return {
...feat.properties,
pormetro: feat.properties.arboles / feat.properties.AREA_M2
};
})
Insert cell
tress = FileAttachment("tress.geojson").json()
Insert cell
import { Plot } from "@mkfreeman/plot-tooltip"
Insert cell
geoparquet = await import("https://cdn.jsdelivr.net/npm/geoparquet/+esm")
Insert cell
distancias = geoparquet.toGeoJson({
file: await parcelas_distancias.arrayBuffer()
})
Insert cell
parcelas_distancias = FileAttachment("parcelas_distancias.parquet")
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(parcelas_datos, {
x: "ESTRATOACT",
y: ""
}),
Plot.linearRegressionY(parcelas_datos, {
x: "ESTRATOACT",
y: "Valor_Metro",
stroke: "red"
})
]
})
Insert cell
parcelas_datos = parcelas.features.map((f) => f.properties)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more