Skip to content

Instantly share code, notes, and snippets.

@ramiroaznar
Created December 16, 2016 15:32
Show Gist options
  • Save ramiroaznar/d1eb1579652d7560800529e8f32ccb02 to your computer and use it in GitHub Desktop.
Save ramiroaznar/d1eb1579652d7560800529e8f32ccb02 to your computer and use it in GitHub Desktop.
Update several columns from CARTO geocoding
update mad_comm_routes m1
set (minutes,kilometers,the_geom) =
(
select
b.duration,
b.length,
b.shape
from
mad_comm_routes a,
cdb_route_point_to_point(
cdb_latlng(a.lat_o, a.long_o),
cdb_latlng(a.lat_d, a.long_d),
'car') as b
where a.cartodb_id = m1.cartodb_id
)
where the_geom is null and
cartodb_id between 1 and 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment