View Source Geo.PostGIS (GeoPostGIS v3.7.1)
PostGIS functions that can used in ecto queries PostGIS Function Documentation.
Currently only the OpenGIS functions are implemented.
Examples
defmodule Example do
import Ecto.Query
import Geo.PostGIS
def example_query(geom) do
from location in Location, limit: 5, select: st_distance(location.geom, ^geom)
end
end
Summary
Functions
Casts the 2 geometries given to geographies in order to return distance in meters.
Please note that ST_Distance_Sphere has been deprecated as of Postgis 2.2. Postgis 2.1 is no longer supported on PostgreSQL >= 9.5. This macro is still in place to support users of PostgreSQL <= 9.4.x.
Casts the 2 geometries given to geographies in order to check for distance in meters.
Functions
Casts the 2 geometries given to geographies in order to return distance in meters.
Please note that ST_Distance_Sphere has been deprecated as of Postgis 2.2. Postgis 2.1 is no longer supported on PostgreSQL >= 9.5. This macro is still in place to support users of PostgreSQL <= 9.4.x.
Casts the 2 geometries given to geographies in order to check for distance in meters.