diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cfb93ef..5ab554d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,11 +15,12 @@ jobs: fail-fast: false matrix: config: - - { os: windows-latest, py: "3.7" } - - { os: macOS-latest, py: "3.7" } - - { os: ubuntu-latest, py: "3.6" } - - { os: ubuntu-latest, py: "3.7" } + - { os: windows-latest, py: "3.10" } + - { os: macOS-latest, py: "3.10" } - { os: ubuntu-latest, py: "3.8" } + - { os: ubuntu-latest, py: "3.9" } + - { os: ubuntu-latest, py: "3.10" } + - { os: ubuntu-latest, py: "3.11" } env: SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk @@ -35,7 +36,7 @@ jobs: python -m pip install --upgrade pip pip install --user --no-cache-dir Cython pip install --user -r requirements.txt - pip install --user -r requirements_dev.txt + # pip install --user -r requirements_dev.txt - name: LOAD EE CREDENTIALS run: python ./.github/ee_token.py env: diff --git a/eefolium/common.py b/eefolium/common.py index 75d2ad6..ff22e61 100644 --- a/eefolium/common.py +++ b/eefolium/common.py @@ -2351,13 +2351,13 @@ def load_GeoTIFFs(URLs): return ee.ImageCollection(collection) -def get_COG_tile(url, titiler_endpoint="https://api.cogeo.xyz/", **kwargs): +def get_COG_tile(url, titiler_endpoint="https://titiler.xyz/", **kwargs): """Get a tile layer from a Cloud Optimized GeoTIFF (COG). Source code adapted from https://developmentseed.org/titiler/examples/Working_with_CloudOptimizedGeoTIFF_simple/ Args: url (str): HTTP URL to a COG, e.g., https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: tuple: Returns the COG Tile layer URL and bounds. @@ -2386,7 +2386,7 @@ def get_COG_tile(url, titiler_endpoint="https://api.cogeo.xyz/", **kwargs): return r["tiles"][0] -def get_COG_mosaic(links, titiler_endpoint="https://api.cogeo.xyz/", username='anonymous', layername=None, overwrite=False, verbose=True, **kwargs): +def get_COG_mosaic(links, titiler_endpoint="https://titiler.xyz/", username='anonymous', layername=None, overwrite=False, verbose=True, **kwargs): import requests @@ -2432,12 +2432,12 @@ def get_COG_mosaic(links, titiler_endpoint="https://api.cogeo.xyz/", username='a print(e) -def get_COG_bounds(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_COG_bounds(url, titiler_endpoint="https://titiler.xyz/"): """Get the bounding box of a Cloud Optimized GeoTIFF (COG). Args: url (str): HTTP URL to a COG, e.g., https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: list: A list of values representing [left, bottom, right, top] @@ -2455,12 +2455,12 @@ def get_COG_bounds(url, titiler_endpoint="https://api.cogeo.xyz/"): return bounds -def get_COG_center(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_COG_center(url, titiler_endpoint="https://titiler.xyz/"): """Get the centroid of a Cloud Optimized GeoTIFF (COG). Args: url (str): HTTP URL to a COG, e.g., https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: tuple: A tuple representing (longitude, latitude) @@ -2470,12 +2470,12 @@ def get_COG_center(url, titiler_endpoint="https://api.cogeo.xyz/"): return center -def get_COG_bands(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_COG_bands(url, titiler_endpoint="https://titiler.xyz/"): """Get band names of a Cloud Optimized GeoTIFF (COG). Args: url (str): HTTP URL to a COG, e.g., https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: list: A list of band names @@ -2493,12 +2493,12 @@ def get_COG_bands(url, titiler_endpoint="https://api.cogeo.xyz/"): return bands -def get_STAC_tile(url, bands=None, titiler_endpoint="https://api.cogeo.xyz/", **kwargs): +def get_STAC_tile(url, bands=None, titiler_endpoint="https://titiler.xyz/", **kwargs): """Get a tile layer from a single SpatialTemporal Asset Catalog (STAC) item. Args: url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: tuple: Returns the COG Tile layer URL and bounds. @@ -2542,12 +2542,12 @@ def get_STAC_tile(url, bands=None, titiler_endpoint="https://api.cogeo.xyz/", ** return r["tiles"][0] -def get_STAC_bounds(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_STAC_bounds(url, titiler_endpoint="https://titiler.xyz/"): """Get the bounding box of a single SpatialTemporal Asset Catalog (STAC) item. Args: url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: list: A list of values representing [left, bottom, right, top] @@ -2565,12 +2565,12 @@ def get_STAC_bounds(url, titiler_endpoint="https://api.cogeo.xyz/"): return bounds -def get_STAC_center(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_STAC_center(url, titiler_endpoint="https://titiler.xyz/"): """Get the centroid of a single SpatialTemporal Asset Catalog (STAC) item. Args: url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: tuple: A tuple representing (longitude, latitude) @@ -2580,12 +2580,12 @@ def get_STAC_center(url, titiler_endpoint="https://api.cogeo.xyz/"): return center -def get_STAC_bands(url, titiler_endpoint="https://api.cogeo.xyz/"): +def get_STAC_bands(url, titiler_endpoint="https://titiler.xyz/"): """Get band names of a single SpatialTemporal Asset Catalog (STAC) item. Args: url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". Returns: list: A list of band names diff --git a/eefolium/eefolium.py b/eefolium/eefolium.py index ae80f78..cb1f514 100644 --- a/eefolium/eefolium.py +++ b/eefolium/eefolium.py @@ -464,7 +464,7 @@ def add_COG_layer( attribution=".", opacity=1.0, shown=True, - titiler_endpoint = "https://api.cogeo.xyz/", + titiler_endpoint = "https://titiler.xyz/", **kwargs ): """Adds a COG TileLayer to the map. @@ -475,7 +475,7 @@ def add_COG_layer( attribution (str, optional): The attribution to use. Defaults to '.'. opacity (float, optional): The opacity of the layer. Defaults to 1. shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True. - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". """ tile_url = get_COG_tile(url, titiler_endpoint, **kwargs) center= get_COG_center(url, titiler_endpoint) # (lon, lat) @@ -489,7 +489,7 @@ def add_COG_mosaic( attribution=".", opacity=1.0, shown=True, - titiler_endpoint = "https://api.cogeo.xyz/", + titiler_endpoint = "https://titiler.xyz/", username='anonymous', overwrite=False, show_footprints=False, @@ -504,7 +504,7 @@ def add_COG_mosaic( attribution (str, optional): The attribution to use. Defaults to '.'. opacity (float, optional): The opacity of the layer. Defaults to 1. shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True. - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". username (str, optional): The username to create mosaic using the titiler endpoint. Defaults to 'anonymous'. overwrite (bool, optional): Whether or not to replace existing layer with the same layer name. Defaults to False. show_footprints (bool, optional): Whether or not to show footprints of COGs. Defaults to False. @@ -548,7 +548,7 @@ def add_STAC_layer( attribution=".", opacity=1.0, shown=True, - titiler_endpoint = "https://api.cogeo.xyz/", + titiler_endpoint = "https://titiler.xyz/", **kwargs ): """Adds a STAC TileLayer to the map. @@ -559,7 +559,7 @@ def add_STAC_layer( attribution (str, optional): The attribution to use. Defaults to '.'. opacity (float, optional): The opacity of the layer. Defaults to 1. shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True. - titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://api.cogeo.xyz/". + titiler_endpoint (str, optional): Titiler endpoint. Defaults to "https://titiler.xyz/". """ tile_url = get_STAC_tile(url, bands, titiler_endpoint, **kwargs) center= get_STAC_center(url, titiler_endpoint) diff --git a/setup.py b/setup.py index 821c84d..3eb84e6 100644 --- a/setup.py +++ b/setup.py @@ -33,10 +33,10 @@ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], description="A lightweight Python package for interactive mapping with Google Earth Engine and folium", install_requires=install_requires,