Using CartoDB SQL API I'd like to: Update the_geom field in a table that has no spatial data by selecting the polygons from a table with spatial data and joining based on one common field..

In this particular case, the polygons are property boundaries or parcels and the common field in both tables is the "parcel_id" which is a unique identifier as a string

UPDATE table_without_geoms_name SET the_geom = (SELECT a.the_geom FROM table_with_geoms as a WHERE table_without_geoms_name.parcel_id = a.parcel_id)

Of course, you'd need to change the name of your tables accordingly. :-)

  • haha yes of course :) - this is terrific! thanks for the help – user26190 Mar 4 '15 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.