EnglishFrenchSpanish

OnWorks favicon

v.segmentgrass - Online in the Cloud

Run v.segmentgrass in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command v.segmentgrass that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


v.segment - Creates points/segments from input vector lines and positions.

KEYWORDS


vector, geometry, node, point, segment, vertex

SYNOPSIS


v.segment
v.segment --help
v.segment input=name [layer=string] output=name [rules=name] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]

Flags:
--overwrite
Allow output files to overwrite existing files

--help
Print usage summary

--verbose
Verbose module output

--quiet
Quiet module output

--ui
Force launching GUI dialog

Parameters:
input=name [required]
Name of input vector lines map
Or data source for direct OGR access

layer=string
Layer number or name
Vector features can have category values in different layers. This number determines
which layer to use. When used with direct OGR access this is the layer name.
Default: 1

output=name [required]
Name for output vector map

rules=name
Name of file containing segment rules
’-’ for standard input

DESCRIPTION


v.segment generates segments or points from input lines and from positions read from a
text file or ’stdin’. It includes the creation of parallel lines or points in given
destination from the line.

The format is:
P <point id> <line cat> <offset> [<side offset>]
L <segment id> <line cat> <start offset> <end offset> [<side offset>]
The offsets can be percent values of the line length. If the offsets are negative, they
start from the end node of the line. -0 means the end of the line.

EXAMPLE
The user could send to stdin something like:
P 1 356 24.56
P 2 495 12.31
P 3 500 -12.31
P 4 510 -20%
...
(pipe or redirect from file into the command).

NOTES


A segment is only created for the first line found of the specified category.

Points are generated along the lines at the given distance(s) or percent(s) of the line
length from the beginning or end, if offsets are negative, of the vector line.

The side offset is the orthogonal distance from the line. Positive side offsets are to the
right side of the line going forward, negative offsets are to the left (d.vect with
display=shape,dir shows the direction of vector lines). As the segment distance is
measured along the original line, side-offset lines will be longer than the start-end
segment distance for outside corners of curving lines, and shorter for inside corners.

All offsets are measured in map units (see "g.proj -p") or percents of the line length, if
followed by a % character.

To place a point in the middle of a line, 50% offset can be used or the v.to.db module may
be used to find the line’s length. Then half of that distance can be used as the
along-line offset.

EXAMPLES


The examples may be used in the North Carolina sample location.

Example: Extract line segment from 400m to 5000m from beginning of line 1:
# extract lines from railroad map:
v.extract railroads out=myrr cats=1
# join segments into polyline and reassign category numbers
v.build.polylines myrr out=myrr_pol
v.category myrr_pol out=myrailroads option=add
# zoom to an area of interest
g.region vector=myrailroads -p
# show line, category, direction (to find the beginning)
d.mon wx0
d.vect myrailroads disp=shape,cat,dir lsize=12
# extract line segment from 400m to 5000m from beginning of line 1
echo "L 1 1 400 5000" | v.segment myrailroads out=myrailroads_segl
d.erase
d.vect myrailroads
d.vect myrailroads_segl col=green width=2
# set node at 5000m from beginning of line 1
echo "P 1 1 5000" | v.segment myrailroads out=myrailroads_segp
d.vect myrailroads_segp icon=basic/circle color=red fcolor=red size=5
Extract line segment from 400m to 5000m from beginning of line 1

Example: Create parallel 1km long line segments along first 8km of track, offset 500m to
the left of the tracks.
v.segment myrailroads out=myrailroads_segl_side << EOF
L 1 1 1000 2000 -500
L 2 1 3000 4000 -500
L 3 1 5000 6000 -500
L 4 1 7000 8000 -500
EOF
d.erase
d.vect myrailroads disp=shape,dir
d.vect -c myrailroads_segl_side width=2

Example: A series of points, spaced every 2km along the tracks
v.segment myrailroads out=myrailroads_pt2km << EOF
P 1 1 1000
P 2 1 3000
P 3 1 5000
P 4 1 7000
EOF
d.erase
d.vect myrailroads disp=shape,dir
d.vect myrailroads_pt2km icon=basic/circle color=blue fcolor=blue size=5
A series of points, spaced every 2km along the tracks

Example: A series of points, spaced every 2km along the tracks, offset 500m to the right
v.segment myrailroads out=myrailroads_pt2kmO500m << EOF
P 1 1 1000 500
P 2 1 3000 500
P 3 1 5000 500
P 4 1 7000 500
EOF
d.erase
d.vect myrailroads disp=shape,dir
d.vect myrailroads_pt2kmO500m icon=basic/circle color=aqua fcolor=aqua size=5
A series of points, spaced every 2km along the tracks, offset 500m to the right

Example: A series of points, spaced every 10% of the line’s length along the tracks from
the end of the line up to the middle point, offset 500m to the right
v.segment myrailroads out=myrailroads_pt10pctO500m << EOF
P 1 1 -0% 500
P 2 1 -10% 500
P 3 1 -20% 500
P 4 1 -30% 500
P 5 1 -40% 500
P 6 1 -50% 500
EOF
d.erase
d.vect myrailroads disp=shape,dir
d.vect myrailroads_pt10pctO500m icon=basic/circle color=red fcolor=black size=5
A series of points, spaced every 10% of the line’s length along the tracks from the end of
the line up to the middle point, offset 500m to the right

KNOWN ISSUES


There is a problem with side-offset parallel line generation for inside corners.

Use v.segmentgrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    GenX
    GenX
    GenX is a scientific program to refine
    x-ray refelcetivity, neutron
    reflectivity and surface x-ray
    diffraction data using the differential
    evolution algorithm....
    Download GenX
  • 2
    pspp4windows
    pspp4windows
    PSPP is a program for statistical
    analysis of sampled data. It is a free
    replacement for the proprietary program
    SPSS. PSPP has both text-based and
    graphical us...
    Download pspp4windows
  • 3
    Git Extensions
    Git Extensions
    Git Extensions is a standalone UI tool
    for managing Git repositories. It also
    integrates with Windows Explorer and
    Microsoft Visual Studio
    (2015/2017/2019). Th...
    Download Git Extensions
  • 4
    eSpeak: speech synthesis
    eSpeak: speech synthesis
    Text to Speech engine for English and
    many other languages. Compact size with
    clear but artificial pronunciation.
    Available as a command-line program with
    many ...
    Download eSpeak: speech synthesis
  • 5
    Sky Chart / Cartes du Ciel
    Sky Chart / Cartes du Ciel
    SkyChart is a software to draw chart of
    the night sky for the amateur astronomer
    from a bunch of stars and nebulae
    catalogs. See main web page for full
    download...
    Download Sky Chart / Cartes du Ciel
  • 6
    GSmartControl
    GSmartControl
    GSmartControl is a graphical user
    interface for smartctl. It allows you to
    inspect the hard disk and solid-state
    drive SMART data to determine its
    health, as w...
    Download GSmartControl
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqmktop
    coqmktop
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop
    coqtop
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    g.copygrass
    g.copygrass
    g.copy - Copies available data files in
    the current mapset search path to the
    user�s current mapset. KEYWORDS:
    general, map management ...
    Run g.copygrass
  • 6
    g.dirsepsgrass
    g.dirsepsgrass
    g.dirseps - Internal GRASS utility for
    converting directory separator
    characters. Converts any directory
    separator characters in the input string
    to or from na...
    Run g.dirsepsgrass
  • More »

Ad