Topography of the Trail Islands in British Columbia, Canada

Topography of the Trail Islands in British Columbia, Canada#

This is a lidar point cloud (ground reflections only) sliced to the small Trail Islands to the North of Vancouver. The islands have some nice looking topography and their isolated nature creates problems for some interpolation methods.

Original source: LidarBC

Pre-processing: Source code for preparation of the original dataset for redistribution in Ensaio

import pandas as pd
import pygmt

import ensaio

Download and cache the data and return the path to it on disk

/home/runner/work/_temp/cache/ensaio/v1/british-columbia-lidar.csv.xz

Load the CSV formatted data with pandas

longitude latitude elevation_m
0 -123.813753 49.460263 -0.67
1 -123.813725 49.460274 -0.96
2 -123.813764 49.460254 -0.78
3 -123.813744 49.460262 -0.61
4 -123.813737 49.460265 -0.62
... ... ... ...
829728 -123.807407 49.455007 -1.24
829729 -123.807410 49.454995 -1.25
829730 -123.807416 49.454980 -1.19
829731 -123.807428 49.454966 -1.21
829732 -123.807432 49.454963 -1.20

829733 rows × 3 columns



Make a PyGMT map with the data points colored by the elevation.

fig = pygmt.Figure()
fig.basemap(
    region=[
        data.longitude.min(),
        data.longitude.max(),
        data.latitude.min(),
        data.latitude.max(),
    ],
    projection="M15c",
    frame=True,
)
pygmt.makecpt(cmap="viridis", series=[data.elevation_m.min(), data.elevation_m.max()])
fig.plot(
    x=data.longitude, y=data.latitude, fill=data.elevation_m, cmap=True, style="c0.05c"
)
fig.colorbar(frame='af+l"elevation [m]"')
fig.show()
british columbia lidar

Total running time of the script: (0 minutes 14.849 seconds)

Gallery generated by Sphinx-Gallery