mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 21:56:39 +00:00
3.0 KiB
3.0 KiB
High level description
We need to implement a service which will have the following high level functionality:
- Download map tiles with from google maps for specific area which is defined by:
- Zoom level (default - maximum zoom in google maps)
- Lattitude (center of square)
- Longitude (center of square)
- Size of the square in meters, minimum 100 meters, maximum 1000 meters
- Store downloaded tiles and its metadata
- We should store tiles "as is" just like google maps returns them in folder /tiles (which will be mounted to the docker container where the service is running)
- We should store metadata in Postgres database in table "tiles". We should store the following information: -- Unique UUID -- Zoom level -- Lattitude (center of square) -- Longitude (center of square) -- Tile size in meters (per google maps data) -- Tile size in pixels -- Composite key - it should be a combination of Lattitude, Longitude and Tile size in meters for fast lookups or search -- Image type -- Maps version (google maps can update maps over time) -- File path relative to the folder where tiles are stored
- Request maps for certain region We should have API endpoint POST /api/satellite/request which will do the following:
- Request map tiles for the region defined by -- Unique ID (region UUID) -- Lattitude (center of square) -- Longitude (center of square) -- Size of the square in meters, minimum 100 meters, maximum 10000 meters
- Use previously stored tiles and metadata, if tiles are missing it should download them (see above)
- When all tiles are ready, it should create a file region_{id}ready.csv in folder /ready (which will be mounted to the docker container where the service is running) -- The file should have comma separated data with coordinates and filenames from /tiles folder covering the region -- Rows sequence should represent tiles from top left corner to bottom right corner of the region -- Create file region{id}_summary.txt where write a summary of how many tiles were downloaded, how many we reused from cache, time taken and othe usefull summary information
- API endpoint GET /api/satellite/region/{id} should return path to file region_{id}_ready.csv when all tiles are ready and the file is created, otherwise it should return response indicating that download is in progress.
The service will be running in docker container, we also need to run postgres database also in docker container. I also want to use integration tests as a separate app running as a console app in a separate docker container. We would need two docker compose files:
- docker-compose.svc.yml - will run the service and its dependencies
- docker-compose.tests.yml - will run the integration tests, the service and its dependencies
We have legacy code which already implements downloading tiles using google map, you can use it for reference. But don't directly copy code as we might have different structure and different requirements. You might find there api key for google maps, feel free to use it. Legacy code is here: ../dev/annotator/Azaion.Common/Services/SatelliteDownloader.cs