{"version":"1.0","type":"rich","title":"Link two datasets into lines between nearest points","description":"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.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-5979532?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}