How can I query the postgres Point type from clojureql?
Asked Answered
K

1

24

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.

Katha answered 10/7, 2011 at 17:38 Comment(4)
Do you know what type gets returned if you query the table? Maybe try (class returned-object) to find out, then you can look at the associated JavaDocDepraved
Yes, you are right. A point type is returned. Thanks. If you write that as the answer I will accept it.Katha
The data type point is implemented in standard PostgreSQL, PostGis is not involved so far. This question turned out not to be a question at all, just several misunderstandings at once.Bourn
You think this might get more traction at Geographic Information Systems?Gunyah
S
2

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.

Suppressive answered 2/1, 2012 at 17:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.