weecology / DeepForest

Python Package for Airborne RGB machine learning
https://deepforest.readthedocs.io/
MIT License
486 stars 172 forks source link

Add Tile Map Server Download functionality and wrap async into cleaner function. #718

Closed bw4sz closed 1 month ago

bw4sz commented 2 months ago

In line with the new function described here:

https://deepforest.readthedocs.io/en/latest/annotation.html#specify-a-lat-long-box-and-crop-an-imageserver-asset

We should add other image source APIs, like TMS (Tile Map Server)

https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification

Here is an example from South Africa

https://aerial.openstreetmap.org.za/

  1. Write a new function that downloads data from TMS specification. Perhaps using https://github.com/gumblex/tms2geotiff or inspired from there.
  2. Wrap the utilities.download_ArcGIS_REST and this download_TileMapServer() function into a download_web_server() wrapper. That detects which function to use based on the URL and has the (optional? not sure) ability for async
  3. Move all of this out of utilities and into a new module, download.py

@Om-Doiphode do you want to collaborate with me on this? If interested, give it a go and I will help.

bw4sz commented 2 months ago

It looks like the wrapper already exists, but the docs make it seem like the user needs to do it.

https://github.com/weecology/DeepForest/blob/039418f6462b5b72a0c2ac19f54e165cefef5b29/deepforest/utilities.py#L575

Add 4. Update docs to make it clear with examples.