Skip to main content

Geo functions

geoWander

Commentary

added in 0.3.11

stateful function

Generates an infinite, randomized path of coordinates in a geospatially bounded box.

Inputs:

  • boundingBox: a geospatially bounded box defined by two points: the lower left point and the upper right point.
  • All other parameters mirror those in waypoints generator.

Outputs:

  • latitude: The latitude of the position.
  • longitude: The longitude of the position.
  • duration: The number of milliseconds between each point. Use this value to throttle the generator for speed-realism.
  • heading: The navigational heading/bearing, in degrees, of the object.

Examples

Generating coordinates

{
"_gen": "geoWander",
"boundingBox": [
[
45,
-125
],
[
50,
-70
]
],
"speed": 500,
"scale": 0.025
}
[
{
"latitude": 47.525023754062275,
"longitude": -86.4723591216636,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.525027685187546,
"longitude": -86.47241778295934,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.525031616312816,
"longitude": -86.4724764442551,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52503554743809,
"longitude": -86.47253510555083,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52503947856335,
"longitude": -86.47259376684659,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52504340968862,
"longitude": -86.47265242814233,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52504734081389,
"longitude": -86.47271108943808,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52505127193916,
"longitude": -86.47276975073382,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.52505520306443,
"longitude": -86.47282841202957,
"duration": 179.99960875784862,
"heading": 358.6484099588995
},
{
"latitude": 47.5250591341897,
"longitude": -86.47288707332531,
"duration": 179.99960875784862,
"heading": 358.6484099588995
}
]

Specification

JSON schema

{
"type": "object",
"properties": {
"boundingBox": {
"oneOf": [
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
},
{
"type": "number"
}
]
},
"minItems": 2,
"maxItems": 2
}
]
},
"minItems": 2,
"maxItems": 2
}
]
},
"speed": {
"oneOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"scale": {
"type": "number",
"minimum": 0.000001
},
"unit": {
"type": "string",
"enum": [
"degrees",
"radians"
]
}
},
"required": [
"boundingBox",
"speed"
]
}