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.771116515292036,
"longitude": -70.5973864443219,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.77112043497006,
"longitude": -70.5974212864296,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.77112435464807,
"longitude": -70.59745612853729,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.771128274326095,
"longitude": -70.597490970645,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.77113219400412,
"longitude": -70.59752581275269,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.77113611368214,
"longitude": -70.59756065486039,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.771140033360155,
"longitude": -70.59759549696808,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.77114395303818,
"longitude": -70.59763033907578,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.7711478727162,
"longitude": -70.59766518118349,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
},
{
"latitude": 45.771151792394214,
"longitude": -70.59770002329118,
"duration": 179.99994487088168,
"heading": 2.2286310872850663
}
]

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