Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding API to fetch images with footprint in a geo point within a det… #100

Merged
merged 8 commits into from
Mar 27, 2024

Conversation

jamest1903
Copy link
Contributor

…ermined distance

SQL query to test locally. Same in API with some attributes removed. You can change the lat/long for other locations. Here i picked le Pâquier

SELECT "id",ST_force2d(location), "title",
ST_X(ST_SnapToGrid(location, 0.0001)) AS "longitude",
ST_Y(ST_SnapToGrid(location, 0.0001)) AS "latitude"
FROM "images" AS "images"
WHERE ("images"."state" = 'validated' 
AND ST_Contains("images"."footprint", ST_SetSRID(ST_MakePoint(7.053254941554428, 46.594400727633314), 4326)) = true
AND ST_Distance(ST_SetSRID(ST_MakePoint(7.053254941554428, 46.594400727633314), 4326)::geography,
    "images"."location"::geography) <= 2000);

@jamest1903 jamest1903 requested review from slecorne and gdozot2 March 8, 2024 15:11
@jamest1903 jamest1903 added the enhancement New feature or request label Mar 8, 2024
@jamest1903 jamest1903 marked this pull request as draft March 8, 2024 15:13
@jamest1903 jamest1903 marked this pull request as ready for review March 18, 2024 10:58
app/api/images/images.list.controller.js Show resolved Hide resolved
app/api/images/images.openapi.yml Outdated Show resolved Hide resolved
app/api/images/schemas/image-bound.schema.json Outdated Show resolved Hide resolved
@jamest1903 jamest1903 requested a review from slecorne March 27, 2024 10:17
@slecorne slecorne merged commit f5acb4b into main Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants