Skip to content

v.lrs.label

Creates stationing from input lines, and linear reference system.

v.lrs.label input=name output=name [llayer=string] [rsdriver=string] [rsdatabase=string] rstable=string [labels=string] [offset=string [,string,...]] [xoffset=float] [yoffset=float] [reference=string] [font=string] [size=integer] [color=name] [width=integer] [highlight_color=name] [highlight_width=integer] [bgcolor=name] [border=name] [opaque=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

v.lrs.label input=name output=name rstable=string

grass.script.run_command("v.lrs.label", input, output, llayer="1", rsdriver="sqlite", rsdatabase="$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db", rstable, labels=None, offset="50,100,25,25", xoffset=25, yoffset=5, reference="center", font="standard", size=100, color="black", width=1, highlight_color="none", highlight_width=0, bgcolor="none", border="none", opaque="yes", overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("v.lrs.label", input="name", output="name", rstable="string")

Parameters

input=name [required]
    Name of input vector map
    Input vector map containing lines
output=name [required]
    Output vector map where stationing will be written
llayer=string
    Layer number or name
    Line layer
    Default: 1
rsdriver=string
    Driver name for reference system table
    Allowed values: dbf, ogr, sqlite
    Default: sqlite
rsdatabase=string
    Database name for reference system table
    Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
rstable=string [required]
    Name of the reference system table
labels=string
    Label file
offset=string [,string,...]
    PM left, MP right, stationing left, stationing right offset
    Default: 50,100,25,25
xoffset=float
    Offset label in label x-direction in map units
    Default: 25
yoffset=float
    Offset label in label y-direction in map units
    Default: 5
reference=string
    Reference position
    Allowed values: center, left, right, upper, lower
    Default: center
font=string
    Font
    Default: standard
size=integer
    Label size (in map-units)
    Allowed values: 1-1000
    Default: 100
color=name
    Text color
    Either a standard color name or R:G:B triplet
    Default: black
width=integer
    Line width of text
    Only for d.label output
    Allowed values: 1-100
    Default: 1
highlight_color=name
    Highlight color for text
    Either a standard color name, R:G:B triplet, or "none"
    Default: none
highlight_width=integer
    Line width of highlight color
    Only for d.label output
    Allowed values: 0-100
    Default: 0
bgcolor=name
    Background color
    Either a standard color name, R:G:B triplet, or "none"
    Default: none
border=name
    Border color
    Either a standard color name, R:G:B triplet, or "none"
    Default: none
opaque=string
    Opaque to vector
    Only relevant if background color is selected
    Allowed values: yes, no
    Default: yes
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of input vector map
    Input vector map containing lines
    Used as: input, vector, name
output : str, required
    Output vector map where stationing will be written
    Used as: output, vector, name
llayer : str, optional
    Layer number or name
    Line layer
    Used as: input, layer
    Default: 1
rsdriver : str, optional
    Driver name for reference system table
    Allowed values: dbf, ogr, sqlite
    Default: sqlite
rsdatabase : str, optional
    Database name for reference system table
    Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
rstable : str, required
    Name of the reference system table
labels : str, optional
    Label file
    Used as: output, Labels
offset : str | list[str], optional
    PM left, MP right, stationing left, stationing right offset
    Default: 50,100,25,25
xoffset : float, optional
    Offset label in label x-direction in map units
    Default: 25
yoffset : float, optional
    Offset label in label y-direction in map units
    Default: 5
reference : str, optional
    Reference position
    Allowed values: center, left, right, upper, lower
    Default: center
font : str, optional
    Font
    Default: standard
size : int, optional
    Label size (in map-units)
    Allowed values: 1-1000
    Default: 100
color : str, optional
    Text color
    Either a standard color name or R:G:B triplet
    Used as: input, color, name
    Default: black
width : int, optional
    Line width of text
    Only for d.label output
    Allowed values: 1-100
    Default: 1
highlight_color : str, optional
    Highlight color for text
    Either a standard color name, R:G:B triplet, or "none"
    Used as: input, color, name
    Default: none
highlight_width : int, optional
    Line width of highlight color
    Only for d.label output
    Allowed values: 0-100
    Default: 0
bgcolor : str, optional
    Background color
    Either a standard color name, R:G:B triplet, or "none"
    Used as: input, color, name
    Default: none
border : str, optional
    Border color
    Either a standard color name, R:G:B triplet, or "none"
    Used as: input, color, name
    Default: none
opaque : str, optional
    Opaque to vector
    Only relevant if background color is selected
    Allowed values: yes, no
    Default: yes
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

v.lrs.label generates LRS labels for pretty-printing of a LRS. This example is written for the Spearfish dataset (it continues the example from v.lrs.create).

v.lrs.label route_lrs rstable=route_lrs output=route_lrs_labels \
            labels=labels col=red size=50 xoffset=100

g.region vector=route_lrs n=n+100 s=s-100 -p
d.erase
d.vect route_lrs
d.vect route_lrs_labels col=grey type=line
d.vect busstops disp=attr attr=cat size=10 bg=white lcol=green yref=bottom
d.vect busstops icon=basic/circle fcol=green
d.labels labels

SEE ALSO

v.lrs.create, v.lrs.segment, v.lrs.where, d.labels, v.label

LRS tutorial,
Introducing the Linear Reference System in GRASS

AUTHORS

Radim Blazek, ITC-irst/MPA Solutions
Documentation update (based on above journal article and available fragments): Markus Neteler

SOURCE CODE

Available at: v.lrs.label source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f