Skip to content

Instantly share code, notes, and snippets.

@giswqs
Created March 5, 2025 21:58
Show Gist options
  • Save giswqs/ae1e3c00018e67cdbc716ec38968e74f to your computer and use it in GitHub Desktop.
Save giswqs/ae1e3c00018e67cdbc716ec38968e74f to your computer and use it in GitHub Desktop.
Download cars imagery
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(center=[29.679193211481646, -95.42116820812227], zoom=18, height=\"800px\")\n",
"m.add_basemap(\"SATELLITE\")\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bbox = [-95.4249, 29.6778, -95.4193, 29.6804]\n",
"leafmap.map_tiles_to_geotiff(\"cars.tif\", bbox, zoom= 20, source=\"Satellite\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"leafmap.cog_validate(\"cars.tif\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"leafmap.image_to_cog(\"cars.tif\", \"cars_cog.tif\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "geo",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment