PathLayer¶
The PathLayer
renders lists of coordinate points as extruded polylines with mitering.
Screenshot from North America roads example
lonboard.PathLayer ¶
The PathLayer
renders lists of coordinate points as extruded polylines with
mitering.
billboard
class-attribute
instance-attribute
¶
billboard = traitlets.Bool(allow_none=True).tag(sync=True)
If True
, extrude the path in screen space (width always faces the camera).
If False
, the width always faces up.
- Type:
bool
, optional - Default:
False
cap_rounded
class-attribute
instance-attribute
¶
cap_rounded = traitlets.Bool(allow_none=True).tag(sync=True)
Type of caps. If True
, draw round caps. Otherwise draw square caps.
- Type:
bool
, optional - Default:
False
get_color
class-attribute
instance-attribute
¶
get_color = ColorAccessor()
The color of each path in the format of [r, g, b, [a]]
. Each channel is a number
between 0-255 and a
is 255 if not supplied.
- Type: ColorAccessor, optional
- If a single
list
ortuple
is provided, it is used as the color for all paths. - If a numpy or pyarrow array is provided, each value in the array will be used as the color for the path at the same row index.
- If a single
- Default:
[0, 0, 0, 255]
.
get_width
class-attribute
instance-attribute
¶
get_width = FloatAccessor()
The width of each path, in units specified by width_units
(default 'meters'
).
- Type: FloatAccessor, optional
- If a number is provided, it is used as the width for all paths.
- If an array is provided, each value in the array will be used as the width for the path at the same row index.
- Default:
1
.
joint_rounded
class-attribute
instance-attribute
¶
joint_rounded = traitlets.Bool(allow_none=True).tag(sync=True)
Type of joint. If True
, draw round joints. Otherwise draw miter joints.
- Type:
bool
, optional - Default:
False
miter_limit
class-attribute
instance-attribute
¶
miter_limit = traitlets.Int(allow_none=True).tag(sync=True)
The maximum extent of a joint in ratio to the stroke width.
Only works if jointRounded
is False
.
- Type:
float
, optional - Default:
4
width_max_pixels
class-attribute
instance-attribute
¶
width_max_pixels = traitlets.Float(allow_none=True).tag(sync=True)
The maximum path width in pixels. This prop can be used to prevent the path from getting too thick when zoomed in.
- Type:
float
, optional - Default:
None
width_min_pixels
class-attribute
instance-attribute
¶
width_min_pixels = traitlets.Float(allow_none=True).tag(sync=True)
The minimum path width in pixels. This prop can be used to prevent the path from getting too thin when zoomed out.
- Type:
float
, optional - Default:
0
width_scale
class-attribute
instance-attribute
¶
width_scale = traitlets.Float(allow_none=True).tag(sync=True)
The path width multiplier that multiplied to all paths.
- Type:
float
, optional - Default:
1
width_units
class-attribute
instance-attribute
¶
width_units = traitlets.Unicode(allow_none=True).tag(sync=True)
The units of the line width, one of 'meters'
, 'common'
, and 'pixels'
. See
unit
system.
- Type:
str
, optional - Default:
'meters'
from_geopandas
classmethod
¶
from_geopandas(gdf: gpd.GeoDataFrame, **kwargs) -> PathLayer
Construct a PathLayer from a geopandas GeoDataFrame.
The GeoDataFrame will be reprojected to EPSG:4326 if it is not already in that coordinate system.
Parameters:
-
gdf
(GeoDataFrame
) –The GeoDataFrame to set on the layer.
Returns:
-
PathLayer
–A PathLayer with the initialized data.