Rafael H. M. Pereira 🚡 Urban Demographics

@urbandemog.bsky.social

Researcher Ipea Brazil | Visiting prof @geo_uoft | PhD @TSUOxford | Structured procrastination on Cities, Urban mobility, Accessibility, Equity, Data science, R. About: www.urbandemographics.org/

The upcoming v0.5 release of mapgl for #rstats is going to be massive. Included: a slider control that allows for interactive data filtering - no Shiny required. Thanks to @ekotov.pro - brush a window over a histogram, see your data filter in real-time Lots more examples to share this week

Chuffed to give one of the keynote presentations at the fantastic two-day Transport Poverty and Accessibility Workshop organised by the Joint Research Centre of the European Commission today. I will talk about how people map transport poverty in space in practice (abstract below)

Bild

» arrow-extendr « now supports geoarrow 🌏 Use geoarrow types from anywhere in your 🦀 Rust-powered R packages 🐇📦 👈🏼 Centroid using geoarrow + extendr 👉🏼 called from R compared to {sf} #rust #rstats

use anyhow::bail;
use arrow_extendr::FromArrowRobj;
use extendr_api::prelude::*;
use geo_traits::{CoordTrait, PointTrait};
use geoarrow::array::{GeoArrowArrayAccessor, PointArray};

#[extendr]
fn geoarrow_centroid(x: Robj) -> anyhow::Result<Doubles> {
    let res = PointArray::from_arrow_robj(&x)?;

    let (sum_x, sum_y, n) = res.iter_values().filter_map(|xi| xi.ok()).fold(
        (0.0_f64, 0.0_f64, 0usize),
        |(sx, sy, n), v| {
            let (x, y) = v.coord().unwrap().x_y();
            (sx + x, sy + y, n + 1)
        },
    );

    if n == 0 {
        bail!("cannot compute centroid of empty array");
    }

    let res = [sum_x / n as f64, sum_y / n as f64]
        .map(Rfloat::from)
        .into_iter()
        .collect::<Doubles>();

    Ok(res)
}library(wk)
library(geoarrow)
devtools::load_all()
#> ℹ Loading extendrtest

pnts <- wk::xy(rnorm(100, -180, 180), runif(100, -90, 90))
x <- geoarrow::as_geoarrow_array(pnts)

geoarrow_centroid(x)
#> [1] -182.711392   -2.806439
sf::st_as_sfc(pnts) |> 
  sf::st_combine() |> 
  sf::st_centroid()
#> Geometry set for 1 feature 
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -182.7114 ymin: -2.806439 xmax: -182.7114 ymax: -2.806439
#> CRS:           NA
#> POINT (-182.7114 -2.806439)

Access door-to-door: An intercity efficiency and distributional analysis of the costs of travel by plane, train, and automobile

Access door-to-door: An intercity efficiency and distributional analysis of the costs of travel by plane, train, and automobile

Recently published: * Yu L., Li, M., Dai, Z., Cui, M., and Levinson, D. (2026) Access door-to-door: An intercity efficiency and distributional analysis of the costs of travel by plane, train, and automobile. Transport Policy. Volume 184, August 2026, 104188 [doi] Existing studies typically evaluate air travel accessibility by examining either air network performance or ground access to airports in isolation. This paper offers a complementary perspective by assessing the national air travel accessibility through a door-to-door framework and comparing it against multiple modes of intercity transport. We compare four scenarios: air-only, railway-only, highway-only, and an optimal-mode scenario. The first three rely exclusively on a single mode for intercity trips, whereas the optimal-mode scenario selects the lowest-cost option among air, rail, and direct driving for each origin–destination pair. The results show that air travel provides higher accessibility and more balanced spatial equity than rail or highway travel at higher cost thresholds. Air travel also delivers clear advantages in regions with significant geographical constraints, where land-based transport infrastructure is limited. Although the optimal-mode scenario generally enhances spatial equity, it reduces within-group equity in regions characterized either by highly developed urban cores (e.g., the Yangtze River Delta in East China) or by significant geographic constraints (e.g., the peninsula areas of Northeast China). Figure 9: Difference in accessibility among three scenarios (air-only, railway-only, and highway-only) based on the cost-weighted accessibility metrics.

dlvr.it

NEW: The One-Hour City Conspiracy! “Here's the REAL conspiracy: Too many people are forced into car-dependent lives, with more health harms, crashes, noise, air pollution, social isolation —& less space for everything our streets should be giving us.” Thanks @usa.streetsblog.org #1HourCityConspiracy

Urban Truth Collective: The One-Hour City Conspiracy — Streetsblog USA

Here's the real conspiracy: Too many people are forced into car-dependent lives, with more health harms, more crashes, more noise, more air pollution, more social isolation — and less space for everyt...

usa.streetsblog.org

spopt, an R package for spatial optimization, is now in general release on CRAN. spopt-r is inspired by the Python package of the same name. Features include: - Regionalization algorithms for building contiguous districts / territories; - Facility location solvers;

BildBildBildBild

Facility and route optimization on road network graphs can solve countless problems across many industries. However, these solvers often require expensive software to set up and run them, or expensive, rate-limited travel-time matrix APIs. The spopt-r R package offers a solution.

BildBildBild

New in the R mapgl package: static maps! I developed mapgl to bring my favorite interactive mapping libraries to R. But - interactive maps are by definition hard to share in non-interactive formats. I'm rolling out a couple new functions I'm already finding useful: