Skip to content

Commit

Permalink
update-vrt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarshak committed Jan 28, 2025
1 parent 6b38b8a commit 4279d92
Showing 1 changed file with 57 additions and 11 deletions.
68 changes: 57 additions & 11 deletions notebooks/Merging_DEM_Tiles_into_a_VRT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "83668b32-8376-444f-a6a0-32acf578b2e5",
"metadata": {},
"outputs": [],
"source": [
"vsicurl_paths = [f'/vsicurl/{url}' for url in dem_tile_paths]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "f4848969",
"metadata": {
"ExecuteTime": {
Expand All @@ -119,20 +129,56 @@
},
{
"cell_type": "code",
"execution_count": 6,
"id": "3d642224",
"metadata": {
"ExecuteTime": {
"end_time": "2023-03-23T22:44:39.119320Z",
"start_time": "2023-03-23T22:43:29.984396Z"
"execution_count": 7,
"id": "d9971b0d-21ed-4f6d-8205-74a4704949a0",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/cmarshak/miniforge3/envs/dem-stitcher/lib/python3.12/site-packages/osgeo/gdal.py:312: FutureWarning: Neither gdal.UseExceptions() nor gdal.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 218 ms, sys: 915 ms, total: 1.13 s\n",
"Wall time: 33.2 s\n"
]
}
},
"outputs": [],
],
"source": [
"%%time\n",
"\n",
"ds = gdal.BuildVRT(vrt_path, dem_tile_paths)\n",
"ds = None"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "d26b7777-9fac-4c78-94b4-25a3e0c2b038",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 13.6 ms, sys: 6.98 ms, total: 20.6 ms\n",
"Wall time: 11.6 s\n"
]
}
],
"source": [
"%%time\n",
"\n",
"ds = gdal.BuildVRT(vrt_path, vsicurl_paths)\n",
"ds = None"
]
},
{
"cell_type": "markdown",
"id": "fc3072c4",
Expand All @@ -143,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"id": "03cdc596",
"metadata": {
"ExecuteTime": {
Expand All @@ -158,7 +204,7 @@
"BoundingBox(left=-122.00013888888888, bottom=34.00013888888889, right=-120.00013888888888, top=37.00013888888889)"
]
},
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -186,7 +232,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 4279d92

Please sign in to comment.