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": 45.006818353733046,
"longitude": -86.06778679965743,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00682990012698,
"longitude": -86.06817403421933,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00684144652091,
"longitude": -86.06856126878124,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.006852992914844,
"longitude": -86.06894850334314,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00686453930877,
"longitude": -86.06933573790505,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00687608570271,
"longitude": -86.06972297246695,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00688763209664,
"longitude": -86.07011020702886,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00689917849057,
"longitude": -86.07049744159076,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.006910724884506,
"longitude": -86.07088467615267,
"duration": 179.99859320475167,
"heading": 334.01741824743186
},
{
"latitude": 45.00692227127844,
"longitude": -86.07127191071457,
"duration": 179.99859320475167,
"heading": 334.01741824743186
}
]

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