Skip to content

Commit

Permalink
Fix MosaicJSON bug in add_stac_layer (#538)
Browse files Browse the repository at this point in the history
* Add GitHub Actions for checking PR file size

* Update workflows

* Update workflows

* Skip GDAL test

* skip gdal check

* Change pip gdal

* Fix stac tile error

* Fix gdal installation error

* Fix stac tile error

* Fix gdal installation
  • Loading branch information
giswqs committed Sep 11, 2023
1 parent 3d5235c commit 593e653
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 300 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ jobs:
- name: Install GDAL
run: |
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj --yes
# conda install -c conda-forge mamba --yes
# mamba install -c conda-forge gdal pyproj --yes
pip install --no-cache-dir Cython
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL
- name: Test GDAL installation
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ jobs:
- name: Install GDAL
run: |
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj --yes
# conda install -c conda-forge mamba --yes
# mamba install -c conda-forge gdal pyproj --yes
pip install --no-cache-dir Cython
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL
- name: Test GDAL installation
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj --yes
- name: Test GDAL installation
run: |
python -c "from osgeo import gdal"
gdalinfo --version
# - name: Test GDAL installation
# run: |
# python -c "from osgeo import gdal"
# gdalinfo --version

- name: Install dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj --yes
- name: Test GDAL installation
run: |
python -c "from osgeo import gdal"
gdalinfo --version
# - name: Test GDAL installation
# run: |
# python -c "from osgeo import gdal"
# gdalinfo --version

- name: Install dependencies
run: |
Expand Down
151 changes: 13 additions & 138 deletions docs/notebooks/74_map_tiles_to_geotiff.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -44,24 +44,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "64179897fd044c98a924b5fc03c04dc7",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[20, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m"
Expand All @@ -76,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -90,87 +75,17 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Download TMS tiles and create a GeoTIFF file. First, let's try OpenStreetMap."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloaded image 1/15\n",
"Downloaded image 2/15\n",
"Downloaded image 3/15\n",
"Downloaded image 4/15\n",
"Downloaded image 5/15\n",
"Downloaded image 6/15\n",
"Downloaded image 7/15\n",
"Downloaded image 8/15\n",
"Downloaded image 9/15\n",
"Downloaded image 10/15\n",
"Downloaded image 11/15\n",
"Downloaded image 12/15\n",
"Downloaded image 13/15\n",
"Downloaded image 14/15\n",
"Downloaded image 15/15\n",
"Saving GeoTIFF. Please wait...\n",
"Image saved to osm.tif\n"
]
}
],
"source": [
"leafmap.map_tiles_to_geotiff('osm.tif', bbox, zoom=13, source='OpenStreetMap', quiet=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![](https://i.imgur.com/ft597DD.png)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Try Google Satellite."
"Download map tiles and create a GeoTIFF file. First, let's try Esri world imagery basemap."
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "fd118011",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloaded image 1/15\n",
"Downloaded image 2/15\n",
"Downloaded image 3/15\n",
"Downloaded image 4/15\n",
"Downloaded image 5/15\n",
"Downloaded image 6/15\n",
"Downloaded image 7/15\n",
"Downloaded image 8/15\n",
"Downloaded image 9/15\n",
"Downloaded image 10/15\n",
"Downloaded image 11/15\n",
"Downloaded image 12/15\n",
"Downloaded image 13/15\n",
"Downloaded image 14/15\n",
"Downloaded image 15/15\n",
"Saving GeoTIFF. Please wait...\n",
"Image saved to satellite.tif\n"
]
}
],
"outputs": [],
"source": [
"leafmap.map_tiles_to_geotiff('satellite.tif', bbox, zoom=13, source='Satellite')"
"leafmap.map_tiles_to_geotiff('satellite.tif', bbox, zoom=13, source='Esri.WorldImagery')"
]
},
{
Expand All @@ -180,53 +95,13 @@
"![](https://i.imgur.com/ILYunA9.png)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Try OpenTopoMap."
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"source = 'https://a.tile.opentopomap.org/{z}/{x}/{y}.png'"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloaded image 1/15\n",
"Downloaded image 2/15\n",
"Downloaded image 3/15\n",
"Downloaded image 4/15\n",
"Downloaded image 5/15\n",
"Downloaded image 6/15\n",
"Downloaded image 7/15\n",
"Downloaded image 8/15\n",
"Downloaded image 9/15\n",
"Downloaded image 10/15\n",
"Downloaded image 11/15\n",
"Downloaded image 12/15\n",
"Downloaded image 13/15\n",
"Downloaded image 14/15\n",
"Downloaded image 15/15\n",
"Saving GeoTIFF. Please wait...\n",
"Image saved to topo.tif\n"
]
}
],
"source": [
"leafmap.map_tiles_to_geotiff('topo.tif', bbox, zoom=13, source=source)"
"leafmap.map_tiles_to_geotiff('topo.tif', bbox, zoom=13, source='OpenTopoMap')"
]
},
{
Expand All @@ -253,7 +128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 593e653

Please sign in to comment.