Skip to content

Conversation

@kylebarron
Copy link
Member

@kylebarron kylebarron commented Oct 24, 2025

aws s3 cp s3://naip-visualization/ny/2022/60cm/rgb/40073/m_4007307_sw_18_060_20220803.tif ./ --request-payer
import rasterio
from sidecar import Sidecar

from lonboard import Map
from lonboard.experimental._surface import SurfaceLayer

src = rasterio.open("../m_4007307_sw_18_060_20220803.tif")
layer = SurfaceLayer.from_rasterio(src, downscale=4, opacity=0.8)

sidecar = Sidecar()

m = Map(layer)
with sidecar:
    display(m)
Screen.Recording.2025-10-24.at.5.17.02.PM.mov

If we look at the wireframe we see it's only two triangles:
image

@github-actions github-actions bot added the feat label Oct 24, 2025
@kylebarron kylebarron merged commit 417831f into main Oct 24, 2025
9 checks passed
@kylebarron kylebarron deleted the kyle/raster-simplest-corner-reprojection branch October 24, 2025 21:19
kylebarron added a commit that referenced this pull request Oct 28, 2025
### Change list

- Currently, as implemented in
#976 the SurfaceLayer
only supports four vertices and two internal triangles. Over larger
areas this will run the risk of larger reprojection non-linearities.
- This PR implements a quick initial hack to this problem: offering the
user the ability to specify the height and width of the regular grid
they'd like to use.

```py
import rasterio
from sidecar import Sidecar

from lonboard import Map
from lonboard.experimental._surface import SurfaceLayer

# aws s3 cp s3://naip-visualization/ny/2022/60cm/rgb/40073/m_4007307_sw_18_060_20220803.tif ./ --request-payer
src = rasterio.open("m_4007307_sw_18_060_20220803.tif")

layer = SurfaceLayer.from_rasterio(
    src, 
    downscale=4, 
    opacity=0.8, 
    wireframe=True
)
sidecar = Sidecar(anchor="split-right")
m = Map(layer)
with sidecar:
    display(m)
```

<img width="588" height="618" alt="image"
src="https://github.com/user-attachments/assets/45943649-4669-4bef-8879-eacc4598a054"
/>
<img width="468" height="581" alt="image"
src="https://github.com/user-attachments/assets/e5dd64e4-6c59-4592-a0df-07ff90fc8f96"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants