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": 49.07694721438115,
"longitude": -113.25323403920201,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.07694327485934,
"longitude": -113.25316364612992,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.07693933533753,
"longitude": -113.25309325305784,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.076935395815724,
"longitude": -113.25302285998575,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.07693145629391,
"longitude": -113.25295246691365,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.0769275167721,
"longitude": -113.25288207384156,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.07692357725029,
"longitude": -113.25281168076948,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.07691963772848,
"longitude": -113.25274128769739,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.076915698206676,
"longitude": -113.2526708946253,
"duration": 179.99998141370182,
"heading": 167.10377095475496
},
{
"latitude": 49.076911758684865,
"longitude": -113.2526005015532,
"duration": 179.99998141370182,
"heading": 167.10377095475496
}
]

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