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

Add ability to download route information from an API server #234

Merged
merged 0 commits into from
Apr 18, 2023
Merged

Add ability to download route information from an API server #234

merged 0 commits into from
Apr 18, 2023

Conversation

dirkhh
Copy link
Contributor

@dirkhh dirkhh commented Mar 21, 2023

This collects the callsigns in question in batches - the first one after 5 seconds, after that every 10 seconds, and calls a (configurable) backend server. This server can be run locally or a public server can be used - right now this is configured for api.adsb.lol.

The feature is turned off by default.

@dirkhh
Copy link
Contributor Author

dirkhh commented Mar 21, 2023

yet another attempt. I'd love to hear what you think. This one does what we discussed last night (your time). Sends batches of callsigns and positions to the backend server.

I'm sure the error handling and overall code quality could be improved. I am NOT a JavaScript programmer - so this is mostly "cut'n'paste programming"...

dirkhh added a commit to dirkhh/api that referenced this pull request Mar 21, 2023
This endpoint expects a POST request with JSON data that includes an
array of structures consisting of callsign, lat, lon. It then checks
for route information for each of those callsigns (and adds a
plausibility check based on the given position).
The result is returned as a JSON encoded array of routes.

This setup should create significantly less API load if paired with
a frontend implementation that only checks every 5-10 seconds.

A pull request for tar1090 that does just that is here:
wiedehopf/tar1090#234

All this is only "lightly tested". Also, I'm not a Python programmer,
so this might benefit from some careful review. And I'm very open to
edits / suggestions.

Also, note that this is back to using the CORS setup (as with the
changes to tar1090 this appears to be needed again) - and right now this
is globally implemented, which you obviously don't want.

I'm running out of brain cells to remember how I initially implemented
this to only use it for this API call. So please add that before
merging.

Signed-off-by: Dirk Hohndel <[email protected]>
@dirkhh dirkhh mentioned this pull request Mar 21, 2023
iakat pushed a commit to adsblol/api that referenced this pull request Mar 21, 2023
This endpoint expects a POST request with JSON data that includes an
array of structures consisting of callsign, lat, lon. It then checks
for route information for each of those callsigns (and adds a
plausibility check based on the given position).
The result is returned as a JSON encoded array of routes.

This setup should create significantly less API load if paired with
a frontend implementation that only checks every 5-10 seconds.

A pull request for tar1090 that does just that is here:
wiedehopf/tar1090#234

All this is only "lightly tested". Also, I'm not a Python programmer,
so this might benefit from some careful review. And I'm very open to
edits / suggestions.

Also, note that this is back to using the CORS setup (as with the
changes to tar1090 this appears to be needed again) - and right now this
is globally implemented, which you obviously don't want.

I'm running out of brain cells to remember how I initially implemented
this to only use it for this API call. So please add that before
merging.

Signed-off-by: Dirk Hohndel <[email protected]>
@dirkhh
Copy link
Contributor Author

dirkhh commented Apr 16, 2023

Just checking in if there's anything I can do to make this easier to merge.

@wiedehopf wiedehopf merged commit ba61924 into wiedehopf:master Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants