Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
956dd1a
Vendor upstream implementation
kylebarron Oct 27, 2025
01448a8
cleanup
kylebarron Oct 27, 2025
4512ec6
Add tile matrix set schema
kylebarron Oct 27, 2025
35c493e
wip: cog node traversal
kylebarron Oct 27, 2025
f58f71a
Merge branch 'main' into kyle/cog-layer
kylebarron Oct 29, 2025
0b52302
Add simplified types for TileMatrixSet definition
kylebarron Oct 29, 2025
ea69bb4
Add geotiff and proj4js deps
kylebarron Oct 29, 2025
43d42c5
Update types
kylebarron Oct 29, 2025
5372ac5
Implement metadata extraction
kylebarron Oct 29, 2025
03c7826
wip cog traversal
kylebarron Oct 29, 2025
32640d1
Remove insideBounds implementation
kylebarron Oct 29, 2025
952073c
don't need to pass in bounds
kylebarron Oct 29, 2025
ae146d2
progress on tile traversal
kylebarron Oct 29, 2025
27383a8
clean up cog traversal
kylebarron Oct 29, 2025
1a61c1e
cleanup
kylebarron Oct 29, 2025
16e74ab
Merge branch 'main' into kyle/cog-layer
kylebarron Nov 5, 2025
a72665b
lock update
kylebarron Nov 5, 2025
6f1fa48
remove old files
kylebarron Nov 5, 2025
d1d879d
add cogtilelayer definitions
kylebarron Nov 5, 2025
7b8d261
closure
kylebarron Nov 5, 2025
9caf504
try to implement conversion to world bounds
kylebarron Nov 5, 2025
c01d20d
Move metadata to getTileMetadata
kylebarron Nov 6, 2025
89cc6be
add comments
kylebarron Nov 6, 2025
d8d197f
handle geotransforms
kylebarron Nov 6, 2025
dab326f
cleanup
kylebarron Nov 6, 2025
7a47940
rendering one top-level box
kylebarron Nov 6, 2025
35a1f3d
something renders
kylebarron Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions cog-tile-testing.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"id": "66285659-d958-4be6-ae62-b3b6efdad127",
"metadata": {},
"outputs": [],
"source": [
"from lonboard import Map\n",
"from lonboard.experimental._surface import COGTileLayer"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "49ea9e5f-ee08-4924-b968-2e18c058c876",
"metadata": {},
"outputs": [],
"source": [
"url = \"https://ds-wheels.s3.us-east-1.amazonaws.com/m_4007307_sw_18_060_20220803.tif\"\n",
"layer = COGTileLayer(data=url)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b890fe4a-6291-4dd6-b62a-20581e22404d",
"metadata": {},
"outputs": [],
"source": [
"view_state = {'longitude': -73.20972420038129,\n",
" 'latitude': 40.90307721701271,\n",
" 'zoom': 10.98785761041711}"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "21aa3c2f-e8d3-4a92-acf1-2c1af8451de7",
"metadata": {},
"outputs": [],
"source": [
"m = Map(layer, view_state=view_state)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "cf976d1f-4264-44b5-bed6-fbd1ae8c9811",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "087f29c18787446591cd6ec85ef49a59",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"Map(basemap=MaplibreBasemap(), controls=(FullscreenControl(), NavigationControl(), ScaleControl()), custom_att…"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "5f559dda-d832-40d5-a746-340944ef64e3",
"metadata": {},
"outputs": [],
"source": [
"from dataclasses import asdict"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9787bfa0-0f7f-4ee4-a6ff-c674acdb9451",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 15,
"id": "7eb7fc24-ef48-43de-a4dd-7686dfeab320",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'longitude': -73.20972420038129,\n",
" 'latitude': 40.90307721701271,\n",
" 'zoom': 10.98785761041711,\n",
" 'pitch': 0,\n",
" 'bearing': 0,\n",
" 'max_zoom': 20,\n",
" 'min_zoom': 0,\n",
" 'max_pitch': 60,\n",
" 'min_pitch': 0}"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"asdict(m.view_state)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4f07a3d8-e045-42ba-840e-58ae844d643f",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "5349bab1-6542-41ce-88fc-413e559253f6",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "9f7961e7-8bdd-429c-9bb9-9de33e03405a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "lonboard",
"language": "python",
"name": "lonboard"
},
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
8 changes: 8 additions & 0 deletions lonboard/experimental/_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,11 @@ def from_rasterio(
- Type: `bool`, optional
- Default: `False`
"""


class COGTileLayer(BaseLayer):
"""COGTileLayer."""

_layer_type = t.Unicode("cog-tile").tag(sync=True)

data = t.Unicode().tag(sync=True)
Loading
Loading