GeoPostGIS v3.1.0 Geo.PostGIS View Source
Postgis functions that can used in ecto queries PostGIS Function Documentation
Currently only the OpenGIS functions are implemented
ex.
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
Link to this section 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
Link to this section Functions
st_area(geometry) View Source (macro)
st_as_binary(geometry) View Source (macro)
st_as_text(geometry) View Source (macro)
st_bd_m_poly_from_text(wkt, srid) View Source (macro)
st_bd_poly_from_text(wkt, srid) View Source (macro)
st_boundary(geometry) View Source (macro)
st_buffer(geometry, double) View Source (macro)
st_buffer(geometry, double, integer) View Source (macro)
st_centroid(geometry) View Source (macro)
st_collect(geometryList) View Source (macro)
st_collect(geometryA, geometryB) View Source (macro)
st_contains(geometryA, geometryB) View Source (macro)
st_convex_hull(geometry) View Source (macro)
st_covered_by(geometryA, geometryB) View Source (macro)
st_covers(geometryA, geometryB) View Source (macro)
st_crosses(geometryA, geometryB) View Source (macro)
st_difference(geometryA, geometryB) View Source (macro)
st_dimension(geometry) View Source (macro)
st_disjoint(geometryA, geometryB) View Source (macro)
st_distance(geometryA, geometryB) View Source (macro)
st_distance_in_meters(geometryA, geometryB) View Source (macro)
Casts the 2 geometries given to geographies in order to return distance in meters
st_distance_sphere(geometryA, geometryB) View Source (macro)
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.
st_distancesphere(geometryA, geometryB) View Source (macro)
st_dwithin(geometryA, geometryB, float) View Source (macro)
st_dwithin_in_meters(geometryA, geometryB, float) View Source (macro)
Casts the 2 geometries given to geographies in order to check for distance in meters