Link two datasets into lines between nearest points
✓ Published0🌍 Public
Aandrewxhill
Last edited Jul 11, 2013
Created on Jul 11, 2013
The visualization connects two point datasets by drawing a line between each point in one set and its nearest neighbor in the other. A nested SQL query computes the closest geometry for every row using the `<->` distance operator and `ST_MakeLine` to construct the connecting lines. The map renders the resulting `the_geom_webmercator` lines in CartoDB, pairing Citibike stations with points from a second dataset. The approach highlights spatial proximity relationships through direct, nearest-neighbor linkages.
AI-generated description