v.perturb(1grass)

✨ v.perturb ✨

okay so bestie, this is v.perturb from the GRASS User's Manual πŸ’– it does random location perturbations of vector points and honestly?? it's giving chaos gremlin in the best way πŸŽ€

🌸 KEYWORDS 🌸

vector, geometry, statistics, random, point pattern, level1


πŸ¦‹ SYNOPSIS πŸ¦‹

v.perturb
v.perturb --help
v.perturb [-sb] input=name  [layer=string]  output=name
[distribution=string]  parameters=float[,float,...]  [minimum=float]
[seed=integer]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • -s β€” generate a random seed, which means the result is non-deterministic (so, a different vibe every single run, no cap 🌈)
  • -b β€” do not build topology. this one is advantageous when you're handling a large number of points, so like, big brain energy only πŸ‘‘

🌟 Standard flags 🌟

  • --overwrite β€” let output files 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 map. or, plot twist, a data source for direct OGR access
  • layer=string β€” layer number or name ('-1' for all layers). a single vector map can be connected to multiple database tables, and this number decides which table gets used. when you're doing direct OGR access, this is the layer name instead. Default: -1
  • output=name [required] β€” name for output vector map
  • distribution=string β€” distribution of perturbation. Options: uniform, normal. Default: uniform
  • parameters=float[,float,...] [required] β€” parameter(s) of distribution. so if the distribution is uniform, you only need ONE parameter, the maximum. for a normal distribution you need TWO, the mean and the standard deviation. periodt ✨
  • minimum=float β€” minimum deviation in map units. Default: 0.0
  • seed=integer β€” seed value for the random number generator. using the same seed ensures identical results, while a randomly generated seed produces different outcomes in each run. iykyk 🫢

πŸ’… DESCRIPTION πŸ’…

v.perturb reads a vector map of points and writes the same points but perturbs the eastings and northings by adding either a uniform or normal delta value. and what does perturbation even mean?? it means a variating spatial deviation is added to the coordinates. iconic behavior fr fr πŸ”₯


😭 NOTES 😭

the uniform distribution is always centered about zero. the associated parameter is constrained to be positive and specifies the maximum of the distribution; the minimum is the negation of that parameter. so to perturb into a ring around the center, the minimum parameter can be used. lowkey so clever 🌸

usually, the mean (first parameter) of the normal distribution is zero (i.e., the distribution is centered at zero). the standard deviation (second parameter) is naturally constrained to be positive. no shade, it's just math πŸ’€

⚠️ output vector points are not guaranteed to be contained within the current geographic region. like, they might just wander off bestie, that's the whole point πŸ™ˆ

🌈 EXAMPLES 🌈

Random, uniformly distributed selection

to create a random, uniformly distributed selection of possible new points with a radius of 100,000 map units, use the following command:

v.perturb input=comm_colleges output=uniform_perturb parameters=100000

your map should look similar to this figure:

Figure: Map showing the actual community college points and uniformly random chosen points.

Normal distributed selection

for a normal distribution with a mean of 5000 and standard deviation of 2000, use the following command:

v.perturb input=comm_colleges output=normal_perturb distribution=normal parameters=5000,2000

Figure: Map showing the actual community college points and normally random chosen and colored points. Notice that each point is closer to the original point.

Normal distributed selection with a minimum value

in order to include a minimum value of 500, use the following command:

v.perturb input=comm_colleges output=min_perturb distribution=normal parameters=100000,1000 minimum=500

πŸ‘€ SEE ALSO πŸ‘€

v.random, v.univar


πŸ‘‘ AUTHORS πŸ‘‘

James Darrell McCauley when he was at: Agricultural Engineering Purdue University

Random number generators originally written in FORTRAN by Wes Peterson and translated to C using f2c.


🧚 SOURCE CODE 🧚

available at: v.perturb source code (history)

latest change: Sunday Jul 27 05:53:30 2025 in commit: da409580ef15011f3bac379c76d41101c9e36347

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


and that's the whole page bestie πŸ’– this was running on GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, straight outta the GRASS 8.5.0 Reference Manual β€” slay, go perturb some points, you got this πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from