dont use postgis for animaldex
This commit is contained in:
@@ -20,10 +20,10 @@ export const GET: RequestHandler = async ({ url }) => {
|
||||
isNull(animals.deniedAt),
|
||||
isNotNull(sightings.acceptedAt),
|
||||
isNull(sightings.deniedAt),
|
||||
sql`ST_Within(
|
||||
${sightings}.location::geometry,
|
||||
ST_MakeEnvelope(${q.minLng}, ${q.minLat}, ${q.maxLng}, ${q.maxLat}, 4326)
|
||||
)`
|
||||
gte(sightings.lat, q.minLat),
|
||||
lte(sightings.lat, q.maxLat),
|
||||
gte(sightings.lng, q.minLng),
|
||||
lte(sightings.lng, q.maxLng)
|
||||
];
|
||||
|
||||
if (q.species) conditions.push(ilike(animals.species, `%${q.species}%`));
|
||||
|
||||
Reference in New Issue
Block a user