Function ST_Contains(geometry, point) does not exist

1,115 views
Skip to first unread message

cr...@coalharbourgroup.com

unread,
Jun 29, 2013, 7:59:05 AM6/29/13
to car...@googlegroups.com
Our task is simple -- return certain fields for where a Point falls within a shape in the_geom. We store lat/lon as Dec(10,6).

I did a SQL statement conditioned with ST_Contains(geometry, point), and the JSON I received is that the function doesn't exist.

I have tried many different approaches (ST_MakePoint, ST_GeomFromText), but none work. ST_MakePoint returns a null set, but I know for certain that the lat/lon I'm providing is within one of the_geom shapes.

I'd very much appreciate some help. Thank you!


Craig

Javier de la Torre

unread,
Jun 30, 2013, 6:08:59 AM6/30/13
to car...@googlegroups.com
Hi,

Try with a SQL like

SELECT * FROM tm_world_borders_simpl_0_6 WHERE ST_Intersects(the_geom,CDB_LatLng(30,0))

Does this work?


--
 
---
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.
 
 

Craig Spradling

unread,
Jun 30, 2013, 6:27:42 AM6/30/13
to car...@googlegroups.com
Javier, you rock! It indeed works. The issue was with the CDB_LatLng argument. I used CDB_LatLng in my original ST_Contains SQL statement and that worked as well.

Thank you so much!


Craig

You received this message because you are subscribed to a topic in the Google Groups "cartodb" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cartodb/GzguFK2mQLk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cartodb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages