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.33095699111128,
"longitude": -76.95055066945535,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.33095288905403,
"longitude": -76.9506010605718,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.33094878699679,
"longitude": -76.95065145168823,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.330944684939546,
"longitude": -76.95070184280468,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.3309405828823,
"longitude": -76.95075223392112,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.33093648082506,
"longitude": -76.95080262503755,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.33093237876781,
"longitude": -76.950853016154,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.330928276710566,
"longitude": -76.95090340727045,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.330924174653326,
"longitude": -76.95095379838689,
"duration": 179.9999944369272,
"heading": 142.01467341681013
},
{
"latitude": 48.33092007259608,
"longitude": -76.95100418950332,
"duration": 179.9999944369272,
"heading": 142.01467341681013
}
]

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