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": 46.9172167332785,
"longitude": -105.3514338281698,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91722167091008,
"longitude": -105.3513858343666,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91722660854167,
"longitude": -105.3513378405634,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91723154617325,
"longitude": -105.3512898467602,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.917236483804835,
"longitude": -105.351241852957,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.917241421436415,
"longitude": -105.3511938591538,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.917246359068,
"longitude": -105.3511458653506,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91725129669958,
"longitude": -105.3510978715474,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91725623433116,
"longitude": -105.3510498777442,
"duration": 179.9999863387941,
"heading": 19.47900196864913
},
{
"latitude": 46.91726117196275,
"longitude": -105.351001883941,
"duration": 179.9999863387941,
"heading": 19.47900196864913
}
]

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