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

Integration of beacondb as a cellid source #57

Open
Marhasp opened this issue Oct 10, 2024 · 6 comments
Open

Integration of beacondb as a cellid source #57

Marhasp opened this issue Oct 10, 2024 · 6 comments

Comments

@Marhasp
Copy link

Marhasp commented Oct 10, 2024

Hello, would it also be possible to integrate beacondb.net?
In the menu you could then select Opencellid or Beacondb as the source of the cellids/celltowers and the towers of the corresponding source would be displayed on the map.

@christianrowlands
Copy link
Owner

I am not sure that BeaconDB provides tower locations. It was my understanding that it is a geolocation database similar to how Mozilla Location Services used to be. So it allows storing survey records, and where they were captured, but it does not provide an estimated tower location based on calculations of signal strength of the survey records.

Is my understanding of the database wrong?

@Marhasp
Copy link
Author

Marhasp commented Nov 2, 2024

Mozilla, Opencellid and BeaconDB work according to the same principle.
The correct locations of the base stations are never calculated, but a circle of all measurements with the accuracy.
You then have latitude, longitude and the range as a circle.

@Marhasp
Copy link
Author

Marhasp commented Nov 3, 2024

The base stations displayed in the Cell Tower Map are not the correct locations. It is the center of all measurements.
A query of the cell tower at BeaconDB brings the same result.

beaconDB hosts an endpoint at https://beacondb.net/v1/geolocate which is compatible with Ichnaea's request format.

https://ichnaea.readthedocs.io/en/latest/api/geolocate.html

@joelkoen
Copy link
Contributor

joelkoen commented Nov 3, 2024

I don't recommend using the geolocate API for this, I would be happy to write an API that allows clients to query cell towers in a specific area if that would that help.

@christianrowlands
Copy link
Owner

@joelkoen , I appreciate that, but it might be even easier than that. Let me walk through how I get tower locations to display on the map currently and that might help you with your API design.

The way I handle getting the tower locations for displaying in the Network Survey (NS) app's tower map is as follows:

  1. I have a postgres DB setup that holds the tower location information. The table columns are almost an identical match to the CSV file that can be downloaded from OpenCelliD here: https://www.opencellid.org/downloads.php
  2. The NS tower map makes a REST API call to a service I have running, which then queries the DB and returns the results as JSON, which are rendered on the map.
  3. To keep the postgres DB updated, I have a function that runs every night at 2 am that downloads the delta changes from OpenCelliD, and then upserts those changes into the postgres DB.

Given this, it would be easiest for me if you provide a way to download the full DB, and then a way to get the delta changes every 24 hours the same way that OpenCelliD does. I can then populate a different DB table with your tower data, and then add a query parameter for my REST API call so that the user can pick which source they want the data from (and of course provide an option in the NS App UI so the user can pick which source they want).

Would that work for you?

@christianrowlands
Copy link
Owner

And @joelkoen , I can share my db update function code with you if you are interested in seeing it.

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

No branches or pull requests

3 participants