Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I query the postgres Point type from clojureql?

Tags:

How can I query the postgres Point type from clojureql? I wish to use the PostGIS functionality but clojureql does not seem to include this.

like image 287
yazz.com Avatar asked Jul 10 '11 17:07

yazz.com


1 Answers

I am not an expert in clojureql, but if this syntax is correct:

(with-connection db 
   (with-query-results rs ["select * from blogs"] 
     ; rs will be a sequence of maps, 
     ; one for each record in the result set. 
     (dorun (map #(println (:title %)) rs))))

(taken from here)

why not trying to change the rs into:

select point[0] as x, point[1] as y from table

Will this work? I am not sure it will, but if this Clojure way of querying is simply forwarding the query to the DB "asis" you might try using as well PostGIS operators in it.

like image 174
simonecampora Avatar answered Sep 28 '22 11:09

simonecampora