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

Updated add_raster function #1083

Merged
merged 2 commits into from May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/notebooks/100_numpy_to_cog.ipynb
Expand Up @@ -133,8 +133,8 @@
"outputs": [],
"source": [
"m = geemap.Map()\n",
"m.add_geotiff(in_cog, band=[4, 1, 2], layer_name=\"Color infrared\")\n",
"m.add_geotiff(out_cog, palette=\"Greens\", layer_name=\"NDVI\")\n",
"m.add_raster(in_cog, band=[4, 1, 2], layer_name=\"Color infrared\")\n",
"m.add_raster(out_cog, palette=\"Greens\", layer_name=\"NDVI\")\n",
"m"
]
},
Expand Down Expand Up @@ -163,7 +163,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.9"
"version": "3.9.10"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/104_clip_image.ipynb
Expand Up @@ -68,7 +68,7 @@
"outputs": [],
"source": [
"m = geemap.Map()\n",
"m.add_geotiff(dem, palette='terrain', layer_name=\"DEM\")\n",
"m.add_raster(dem, palette='terrain', layer_name=\"DEM\")\n",
"m"
]
},
Expand Down Expand Up @@ -173,7 +173,7 @@
"metadata": {},
"outputs": [],
"source": [
"m.add_geotiff(output, palette='gist_earth', layer_name=\"Clip Image\")"
"m.add_raster(output, palette='gist_earth', layer_name=\"Clip Image\")"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/105_netcdf.ipynb
Expand Up @@ -113,7 +113,7 @@
"outputs": [],
"source": [
"m = geemap.Map(layers_control=True)\n",
"m.add_geotiff(tif, band=[1], palette='coolwarm', layer_name='u_wind')\n",
"m.add_raster(tif, band=[1], palette='coolwarm', layer_name='u_wind')\n",
"m.add_geojson(geojson, layer_name='Countries')\n",
"m"
]
Expand Down
58 changes: 44 additions & 14 deletions docs/notebooks/83_local_tile.ipynb
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -60,13 +60,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"if not os.path.exists(dem):\n",
" dem_url = 'https://drive.google.com/file/d/1vRkAWQYsLWCi6vcTMk8vLxoXMFbdMFn8/view?usp=sharing'\n",
" geemap.download_from_gdrive(dem_url, 'dem.tif', out_dir, unzip=False)"
" geemap.download_file(dem_url, dem, unzip=False)"
]
},
{
Expand All @@ -78,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -94,7 +94,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,9 +103,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fa373e0e739d42b0babdbc98d97c5e49",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[37.63046720520512, -119.03021877270292], controls=(WidgetControl(options=['position', 'transparent…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m"
]
Expand All @@ -119,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,9 +161,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "215e9762ebae4fdaa1f5f5966ec6d4ca",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[20, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=HBox(children=(Togg…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m"
]
Expand Down
6 changes: 3 additions & 3 deletions examples/notebooks/100_numpy_to_cog.ipynb
Expand Up @@ -133,8 +133,8 @@
"outputs": [],
"source": [
"m = geemap.Map()\n",
"m.add_geotiff(in_cog, band=[4, 1, 2], layer_name=\"Color infrared\")\n",
"m.add_geotiff(out_cog, palette=\"Greens\", layer_name=\"NDVI\")\n",
"m.add_raster(in_cog, band=[4, 1, 2], layer_name=\"Color infrared\")\n",
"m.add_raster(out_cog, palette=\"Greens\", layer_name=\"NDVI\")\n",
"m"
]
},
Expand Down Expand Up @@ -163,7 +163,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.9"
"version": "3.9.10"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/104_clip_image.ipynb
Expand Up @@ -68,7 +68,7 @@
"outputs": [],
"source": [
"m = geemap.Map()\n",
"m.add_geotiff(dem, palette='terrain', layer_name=\"DEM\")\n",
"m.add_raster(dem, palette='terrain', layer_name=\"DEM\")\n",
"m"
]
},
Expand Down Expand Up @@ -173,7 +173,7 @@
"metadata": {},
"outputs": [],
"source": [
"m.add_geotiff(output, palette='gist_earth', layer_name=\"Clip Image\")"
"m.add_raster(output, palette='gist_earth', layer_name=\"Clip Image\")"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/105_netcdf.ipynb
Expand Up @@ -113,7 +113,7 @@
"outputs": [],
"source": [
"m = geemap.Map(layers_control=True)\n",
"m.add_geotiff(tif, band=[1], palette='coolwarm', layer_name='u_wind')\n",
"m.add_raster(tif, band=[1], palette='coolwarm', layer_name='u_wind')\n",
"m.add_geojson(geojson, layer_name='Countries')\n",
"m"
]
Expand Down
58 changes: 44 additions & 14 deletions examples/notebooks/83_local_tile.ipynb
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -60,13 +60,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"if not os.path.exists(dem):\n",
" dem_url = 'https://drive.google.com/file/d/1vRkAWQYsLWCi6vcTMk8vLxoXMFbdMFn8/view?usp=sharing'\n",
" geemap.download_from_gdrive(dem_url, 'dem.tif', out_dir, unzip=False)"
" geemap.download_file(dem_url, dem, unzip=False)"
]
},
{
Expand All @@ -78,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -94,7 +94,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,9 +103,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fa373e0e739d42b0babdbc98d97c5e49",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[37.63046720520512, -119.03021877270292], controls=(WidgetControl(options=['position', 'transparent…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m"
]
Expand All @@ -119,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,9 +161,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "215e9762ebae4fdaa1f5f5966ec6d4ca",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[20, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=HBox(children=(Togg…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m"
]
Expand Down
2 changes: 1 addition & 1 deletion geemap/foliumap.py
Expand Up @@ -620,7 +620,7 @@ def add_local_tile(
tile.add_to(self)
self.zoom_to_bounds(bounds)

add_geotiff = add_local_tile
add_raster = add_local_tile

def add_remote_tile(
self,
Expand Down