Create a GriddedSurface¶
A GriddedSurface consists in a explicit grid of cells with the same size. Unlike a Voxel all cells not have to be defined, enabling to have object with less cells, thus reducing the memory footprint of the object. Property here are carried on the nodes. Typical use for GriddedSurface is the case of topography data extracted from LiDAR for example. LiDAR data often are collected on a regular pattern, allowing to be represented on a 2D grid using a color property to reprensent the elevation.
In [1]:
Copied!
import geolime as geo
from pyproj import CRS
import geolime as geo
from pyproj import CRS
In [4]:
Copied!
gs = geo.GriddedSurface(name="GridSurf", xyz=grid.coords())
gs = geo.GriddedSurface(name="GridSurf", xyz=grid.coords())
Creation of a meaningless property for plotting purpose.
In [5]:
Copied!
gs.set_property_expr(name="XY", expr="sin(X / 2) * sin (Y / 2)")
gs.set_property_expr(name="XY", expr="sin(X / 2) * sin (Y / 2)")
In [6]:
Copied!
geo.plot(gs, property="XY", agg_method="mean", width=400, height=650)
geo.plot(gs, property="XY", agg_method="mean", width=400, height=650)
In [7]:
Copied!
geo.plot_2d(
gs,
property="XY",
agg_method="mean",
crs=CRS('EPSG:20350'),
width=650,
height=650,
mapbox_zoom=12
)
geo.plot_2d(
gs,
property="XY",
agg_method="mean",
crs=CRS('EPSG:20350'),
width=650,
height=650,
mapbox_zoom=12
)