Iterate | Nicolas Lambert | Observable
ojs
ojs
ojs
Author
Nicolas Lambert
@neocarto
Front-end cartographer. Research Engineer in Geographic Information Science at CNRS & UAR RIATE. Author of Mad Maps (2019), Practical Handbook of Thematic Cartography (2016, 2020, 2025) and Cartographia (2025).
Comments (2)
Fati CHEN
Jan 3, 2023
You can also do : ```observablehq propertiesandgeom = geo.map(world, (d, i) => { const [lon, lat] = d3.geoCentroid(world.features[i]) return {id: d.CNTR_ID, name: d.CNTR_NAME, lat, lon, geoArea: d3.geoArea(world.features[i])} }) ``` instead of accessors
Nicolas Lambert
Jan 3, 2023
Thank you. It's much better this way. I add your code below.
Reply
Add comment
Subscribe to notifications
© 2026 Observable, Inc.
Terms of service
Privacy policy
Product
About
Pricing
Documentation
Release notes
Contact us
Open source
Notebook Kit
Plot
D3
Community
Public
Forum
Bluesky
YouTube
X
Observable
Sign up
Nicolas Lambert
11
Reply
Add comment
Subscribe to notifications
1
Iterate | Nicolas Lambert | Observable