osm-fr / osmose-frontend

Part of osmose that shows results on the website http://osmose.openstreetmap.fr
GNU General Public License v3.0
41 stars 38 forks source link

[API][Request Feature] Count of issues by "country" #453

Closed Binnette closed 1 month ago

Binnette commented 1 year ago

Hi,

Is there a way (via API) to get the "total" of issues (by item/class) for a specific country?

If no, is it possible to add a "country" filter to this api : /0.3/items/{item}/class/{classs} like this: /0.3/items/{item}/class/{classs}&country={country}

That way we can get the "total" of issues for a given country "france", "france_auvergne".

I need this info because I know that the api /0.3/issues is limited to 10 000 issues and I want to know how many issues I am "missing".

For example there is 10041 brand issues (class=31302) in "france*" but the API only return 10 000. So I want to know that I am missing "41" issues.

Have a nice day.

frodrigo commented 1 year ago

You have the list of public endpoints here http://osmose.openstreetmap.fr/api/docs

What you ask is here http://osmose.openstreetmap.fr/fr/issues/open.json?item=3130&country=france_auvergne* But it is not in the public API.

It should be move to the API, and open to PR doing this (but parts).

Binnette commented 1 year ago

Hi @frodrigo, thank a lot for your quick answer :+1:

Oups, I realized that I opening my issue in the frontend project instead of the backend one...

Anyway, in fact I also realized that my real issue is not to be be able to "know how many issues I am missing" but "not missing any issue".

So my real concern is "how to get all issues for a given item/class/country, even if the number of issues exceed 10000?"

Is there any way to get more issues than the API limit of 10000?

If no, should I create an issue in the backend project (and close this one) ? One of the possible solution would be to implement "pagination" in the API.

frodrigo commented 1 year ago

El dom, 12 mar 2023, 9:25, Binnette @.***> escribió:

Hi @frodrigo https://github.com/frodrigo, thank a lot for your quick answer 👍

Oups, I realized that I opening my issue in the frontend project instead of the backend one...

You open it on backend, but I lived it here. Backend at t for runners. Frontend for API and wen client.

Anyway, in fact I also realized that my real issue is not to be be able to

"know how many issues I am missing" but "not missing any issue".

So my real concern is "how to get all issues for a given item/class/country, even if the number of issues exceed 10000?

Is there any way to get more issues than the API limit of 10000?

The is no way.

If no, should I create an issue in the backend project (and close this one)

? One of the possible solution would be to implement "pagination" in the API.

Yes you could look into this if you want. But it should be without introduction perf issue (no orber by on query)

Reply to this email directly, view it on GitHub https://github.com/osm-fr/osmose-frontend/issues/453#issuecomment-1465137138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANT5DXSELOZPW6RAPXRS2TW3WI65ANCNFSM6AAAAAAVXU23KQ . You are receiving this because you were mentioned.Message ID: @.***>