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.50862877954484,
"longitude": -100.96664595812311,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50862620004709,
"longitude": -100.96666336763808,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.508623620549336,
"longitude": -100.96668077715303,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.508621041051576,
"longitude": -100.966698186668,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50861846155382,
"longitude": -100.96671559618296,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50861588205607,
"longitude": -100.96673300569792,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50861330255832,
"longitude": -100.96675041521289,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50861072306056,
"longitude": -100.96676782472785,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.5086081435628,
"longitude": -100.9667852342428,
"duration": 179.99973143653528,
"heading": 201.76774737180153
},
{
"latitude": 47.50860556406505,
"longitude": -100.96680264375777,
"duration": 179.99973143653528,
"heading": 201.76774737180153
}
]

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"
]
}