v.lrs.segment(1grass)

πŸ’– v.lrs.segment πŸ’–

okay bestie, say hi to v.lrs.segment from the GRASS User's Manual β€” it's a lil main-character module that makes points/segments out of your input lines, your linear reference system, and positions it reads from stdin or a file. πŸŽ€

KEYWORDS: vector, linear reference system, network ✨


🌈 SYNOPSIS 🌈

v.lrs.segment
v.lrs.segment --help
v.lrs.segment input=name output=name  [llayer=string]
[rsdriver=string]   [rsdatabase=string]  rstable=string  [file=name]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

🫢 Flags:

  • --overwrite β€” lets output files just like, overwrite files that already exist. no cap, it will do it.
  • --help β€” prints the usage summary
  • --verbose β€” verbose module output, so it tells you everything
  • --quiet β€” quiet module output, so it tells you nothing
  • --ui β€” forces launching the GUI dialog

πŸ¦‹ Parameters:

  • input=name [required] β€” Name of input vector map. This is the input vector map containing lines.
  • output=name [required] β€” Output vector map where segments will be written
  • llayer=string β€” Layer number or name. It's the line layer. Default: 1
  • rsdriver=string β€” Driver name for the reference system table. Options: dbf, mysql, odbc, ogr, pg, sqlite. Default: sqlite
  • rsdatabase=string β€” Database name for the reference system table. Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
  • rstable=string [required] β€” Name of the reference system table
  • file=name β€” Name of file containing segment rules. If it's not given, it reads from stdin. πŸ’…

✨ DESCRIPTION ✨

So v.lrs.segment literally creates points/segments from input lines, a linear reference system, and positions read from standard in or a file. it's giving very precise, very demure. πŸŽ€

The format is as follows:

P <point_id> <line_id> <milepost>+<offset> [<side offset>]
L <segment_id> <line_id> <milepost>+<offset> <milepost>+<offset> [<side offset>]

πŸ“ NOTES πŸ“

For more info and examples, go see the help page for v.lrs.segment's sister module, v.segment. sibling energy fr fr πŸ‘‘


πŸ“ EXAMPLE πŸ“

This example is written for the Spearfish dataset (it continues the example from v.lrs.create). lowkey a sequel, highkey iconic.

In this example, the 'route_lrs' shall be extended for a new position (point) along the LRS after bus stop 4:

# new point on LRS
echo "P 7 22 4+180" | v.lrs.segment route_lrs out=route_lrs_new rstable=route_lrs
g.region vector=route_lrs n=n+100 s=s-100 -p
d.erase
# existing LRS
d.vect route_lrs
d.vect busstops disp=attr attr=cat size=10 bg=white lcol=blue yref=bottom
d.vect busstops icon=basic/circle fcol=blue
db.select table=route_lrs
# show modified map
d.vect route_lrs_new col=red

πŸ’€ TODO πŸ’€

Figure out how to merge result into existing LRS map and table. not me leaving a lil mystery for future-you πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

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

LRS tutorial, Introducing the Linear Reference System in GRASS


🌸 AUTHOR 🌸

Radim Blazek


πŸŽ€ SOURCE CODE πŸŽ€

Available at: v.lrs.segment source code (history)

Latest change: Wednesday Jul 02 11:14:35 2025 in commit: 99682b0ce35a99593a2f048c9200fd21f735b2ff

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


okay that's the whole thing bestie, you ate πŸ’…βœ¨ this was GRASS 8.5.0 β€” v.lrs.segment(1grass) β€” and yes the manual page really does tag itself with both the title and the manual name at the top and bottom, we just folded them in near the top and gave them a cute sign-off instead. periodt. πŸ’–πŸ¦‹πŸŒˆ

πŸ“¦ where this page comes from