I’m having trouble getting PostGIS query to work with the Geo Package. I get the error with the following code:
geom = %Geo.Point{coordinates: {49.2771732, -123.1222821}, srid: 4236}
query = from p in Foodhunt.Photo,
join: l in assoc(p, :location),
order_by: st_distance(l.geom, ^geom),
preload: [:location]
Repo.all(query)
My guess was that it’s because some Photos don’t have a location so I tried adding where: st_srid(l.geom) == 4236
but then I don’t get anything from the query. Any thoughts?