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": 48.761666770485114,
"longitude": -90.19812216201537,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.761662293322736,
"longitude": -90.19802967390476,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.76165781616036,
"longitude": -90.19793718579415,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.761653338997974,
"longitude": -90.19784469768354,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.761648861835596,
"longitude": -90.19775220957294,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.76164438467322,
"longitude": -90.19765972146233,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.76163990751084,
"longitude": -90.19756723335172,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.76163543034846,
"longitude": -90.19747474524111,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.76163095318608,
"longitude": -90.1973822571305,
"duration": 179.99938591670636,
"heading": 95.11119363367419
},
{
"latitude": 48.7616264760237,
"longitude": -90.19728976901989,
"duration": 179.99938591670636,
"heading": 95.11119363367419
}
]

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