0
我在使用Geo Elixir package時遇到問題。以下是重現錯誤的步驟。Geo.PostGIS:「undefined function fragment/3」
我將軟件包添加到依賴關係中,並將其添加到iex -S mix
中進行測試。
iex(1)> import Geo.PostGIS
iex(2)> geo1 = %Geo.Point{coordinates: {49.2769578,-123.1219351}, srid: 4326}
iex(3)> geo2 = %Geo.Point{coordinates: {49.2759393,-123.1215435}, srid: 4326}
iex(4)> st_distance(geo1, geo2)
** (CompileError) iex:4: undefined function fragment/3
expanding macro: Geo.PostGIS.st_distance/2
iex:4: (file)
我敢肯定'st_distance'只能在PostgreSQL的查詢中使用的計算是通過依賴於PostgreSQL的PostGIS的完成。 'st_distance'只能在Ecto查詢中使用。 – Dogbert