st_point/st_makepoint does not exist

2,456 views
Skip to first unread message

wbmer...@cityofbinghamton.com

unread,
Jun 7, 2013, 6:44:17 PM6/7/13
to car...@googlegroups.com
Hi there cartodb folks! Just diving into cartodb for the first time here with a python script to toss some data from a mssql server up to a cartodb table. I got that part down, but now I'd like to be able to georeference it with the script instead of having to manually do that in cartodb. The lat and lng fields exist already and are populated (although a quick way to tell a whole table, or rows whose the_geom is null to geocode based on a full address field would be super handy thing I haven't yet managed to figure out either) and I'm trying to tell the_geom to take on those existing lat and lng values and be a point:


UPDATE mytable SET the_geom = ST_SetSRID(ST_MakePoint(lng,lat),4326) WHERE the_geom IS NULL

From this I get:

[u'function st_makepoint(text, text) does not exist']

Any enlightening thoughts? I've dug around enough to see pretty much that exact query being used seemingly without a hitch.

Thanks,
Will
 

Javier de la Torre

unread,
Jun 7, 2013, 8:10:03 PM6/7/13
to car...@googlegroups.com, car...@googlegroups.com
Hi, 

Quickly. 
Your lat and long are strings and the makepoint function expects numbers. Try casting the data like

UPDATE mytable SET the_geom = ST_SetSRID(ST_MakePoint(lng::float,lat::float),4326) WHERE the_geom IS NULL



Thanks,
Will
 

--
 
---
You received this message because you are subscribed to the Google Groups "cartodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cartodb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

wbmer...@cityofbinghamton.com

unread,
Jun 10, 2013, 10:51:33 AM6/10/13
to car...@googlegroups.com
Well I'll be. That works a charm! Thanks so much, Javier.

Mathieu Simonson

unread,
Jan 18, 2018, 6:41:41 AM1/18/18
to cartodb

Thank you Javier ! :)
Reply all
Reply to author
Forward
0 new messages