Published
Edited
May 7, 2019
Insert cell
md`# Add id to Geojson for Mapbox Use`
Insert cell
d3 = require("d3@5")
Insert cell
data= d3.json("https://raw.githubusercontent.com/TianyuSu/Innovation-Immigration/master/Geojson/all%20metro.geojson")
Insert cell
data.features.length
Insert cell
iddata=({
type : data.type,
name: data.name,
crs: data.crs,
features:idfeatures
})
Insert cell
features = data.features
Insert cell
idfeatures={
var all = []
for (var i = 0; i<238; i++){
var row = {}
row.type= features[i].type
row.properties = features[i].properties
row.geometry = features[i].geometry
row.id = features[i].properties.GEOID
all.push(row)
}
return all
}
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