Skip to content

Commit

Permalink
Update lidar notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Nov 21, 2023
1 parent fe95a8c commit 0b97115
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 29 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
- name: Build docs
run: |
mkdocs build
# - name: Deploy to Netlify
# uses: nwtgck/actions-netlify@v2.0
# with:
# publish-dir: "./site"
# production-branch: master
# github-token: ${{ secrets.GITHUB_TOKEN }}
# deploy-message: "Deploy from GitHub Actions"
# enable-pull-request-comment: true
# enable-commit-comment: false
# overwrites-pull-request-comment: true
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# timeout-minutes: 10
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.0
with:
publish-dir: "./site"
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 10
275 changes: 269 additions & 6 deletions docs/examples/dataviz/lidar_viz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "b7976628",
"metadata": {},
"source": [
"[![image](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/opengeos/geoai/blob/main/examples/dataviz/lidar_viz.ipynb)\n",
Expand All @@ -14,13 +15,275 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"id": "754c2310",
"metadata": {},
"outputs": [],
"source": [
"# %pip install leafmap[lidar] open3d"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2ab17108",
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "markdown",
"id": "38ce1a85",
"metadata": {},
"source": [
"Download a [sample LiDAR dataset](https://drive.google.com/file/d/1H_X1190vL63BoFYa_cVBDxtIa8rG-Usb/view?usp=sharing) from Google Drive. The zip file is 52.1 MB and the uncompressed LAS file is 109 MB."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef245254",
"metadata": {},
"outputs": [],
"source": [
"url = 'https://open.gishub.org/data/lidar/madison.zip'\n",
"filename = 'madison.las'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4b3396a6",
"metadata": {},
"outputs": [],
"source": [
"leafmap.download_file(url, 'madison.zip', unzip=True)"
]
},
{
"cell_type": "markdown",
"id": "9bc7ca5e",
"metadata": {},
"source": [
"Read the LiDAR data"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6ccd77c3",
"metadata": {},
"outputs": [],
"source": [
"las = leafmap.read_lidar(filename)"
]
},
{
"cell_type": "markdown",
"id": "ed79ac0d",
"metadata": {},
"source": [
"The LAS header."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bc341781",
"metadata": {},
"outputs": [],
"source": [
"las.header"
]
},
{
"cell_type": "markdown",
"id": "a978b82d",
"metadata": {},
"source": [
"The number of points."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b6ddafea",
"metadata": {},
"outputs": [],
"source": [
"las.header.point_count"
]
},
{
"cell_type": "markdown",
"id": "492a9a41",
"metadata": {},
"source": [
"The list of features."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4a82826f",
"metadata": {},
"outputs": [],
"source": [
"list(las.point_format.dimension_names)"
]
},
{
"cell_type": "markdown",
"id": "30e80845",
"metadata": {},
"source": [
"Inspect data."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a94863dc",
"metadata": {},
"outputs": [],
"source": []
"source": [
"las.X"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "02ca63a0",
"metadata": {},
"outputs": [],
"source": [
"las.Y"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a5ce76c8",
"metadata": {},
"outputs": [],
"source": [
"las.Z"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a45fd506",
"metadata": {},
"outputs": [],
"source": [
"las.intensity"
]
},
{
"cell_type": "markdown",
"id": "bc307ebf",
"metadata": {},
"source": [
"Visualize LiDAR data using the [pyvista](https://github.com/pyvista/pyvista) backend."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "294de234",
"metadata": {},
"outputs": [],
"source": [
"leafmap.view_lidar(filename, cmap='terrain', backend='pyvista')"
]
},
{
"cell_type": "markdown",
"id": "d8a54486",
"metadata": {},
"source": [
"![](https://i.imgur.com/xezcgMP.gif)"
]
},
{
"cell_type": "markdown",
"id": "53155b44",
"metadata": {},
"source": [
"Visualize LiDAR data using the [ipygany](https://github.com/QuantStack/ipygany) backend."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d0564554",
"metadata": {},
"outputs": [],
"source": [
"leafmap.view_lidar(filename, backend='ipygany', background='white')"
]
},
{
"cell_type": "markdown",
"id": "eb8af2db",
"metadata": {},
"source": [
"![](https://i.imgur.com/MyMWW4I.gif)"
]
},
{
"cell_type": "markdown",
"id": "5dc62afa",
"metadata": {},
"source": [
"Visualize LiDAR data using the [panel](https://github.com/holoviz/panel) backend."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "faefc0ff",
"metadata": {},
"outputs": [],
"source": [
"leafmap.view_lidar(filename, cmap='terrain', backend='panel', background='white')"
]
},
{
"cell_type": "markdown",
"id": "fceb2b47",
"metadata": {},
"source": [
"![](https://i.imgur.com/XQGWbJk.gif)"
]
},
{
"cell_type": "markdown",
"id": "e74cf8f8",
"metadata": {},
"source": [
"Visualize LiDAR data using the [open3d](http://www.open3d.org) backend."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fa3b8b97",
"metadata": {},
"outputs": [],
"source": [
"leafmap.view_lidar(filename, backend='open3d')"
]
},
{
"cell_type": "markdown",
"id": "e5e34463",
"metadata": {},
"source": [
"![](https://i.imgur.com/rL85fbl.gif)"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 0b97115

Please sign in to comment.