Zub*_*air 23 postgresql postgis clojure spatial
如何从clojureql查询postgres Point类型?我希望使用PostGIS功能,但clojureql似乎不包含此功能.
小智 2
我不是 clojureql 专家,但如果这个语法正确:
(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))))
Run Code Online (Sandbox Code Playgroud)
(摘自这里)
为什么不尝试将 rs 更改为:
select point[0] as x, point[1] as y from table
Run Code Online (Sandbox Code Playgroud)
这行得通吗?我不确定它会不会,但如果这种 Clojure 查询方式只是将查询转发到数据库“asis”,您可以尝试在其中使用 PostGIS 运算符。