Update deps

This commit is contained in:
Thomas Citharel
2018-08-24 12:31:41 +02:00
parent f62a15eb0c
commit eb0c0002be
7 changed files with 2274 additions and 3245 deletions

View File

@@ -13,7 +13,7 @@ defmodule Eventos.Addresses.Address do
field(:addressRegion, :string)
field(:description, :string)
field(:floor, :string)
field(:geom, Geo.Geometry)
field(:geom, Geo.PostGIS.Geometry)
field(:postalCode, :string)
field(:streetAddress, :string)
has_one(:event, Event)

View File

@@ -78,17 +78,17 @@ defmodule Eventos.Events do
# 50 000 meters -> 50 kms
def find_close_events(lon, lat, radius \\ 50_000) do
ip_point = Geo.WKT.decode("SRID=4326;POINT(#{lon} #{lat})")
Repo.all(
from(
e in Event,
join: a in Address,
on: a.id == e.physical_address_id,
where: st_dwithin_in_meters(^ip_point, a.geom, ^radius),
preload: :organizer_actor
with {:ok, ip_point} <- Geo.WKT.decode("SRID=4326;POINT(#{lon} #{lat})") do
Repo.all(
from(
e in Event,
join: a in Address,
on: a.id == e.physical_address_id,
where: st_dwithin_in_meters(^ip_point, a.geom, ^radius),
preload: :organizer_actor
)
)
)
end
end
@doc """