*Returns distance in meters from given latitude/longitude coordinates to datapoint*

The `distance`

transform computes the distance in meters from the current datapoint to its argument coordinates.

The datapoint is assumed to have `latitude`

and `longitude`

fields in decimal coordinates. It returns the distance in meters computed using the Haversine formula.

```
[{
"latitude": 40.4277304,
"longitude": -86.9170587
}]
```

Given the above stream, we find its distance to the chosen coordinate: `distance(40.426841,-86.9165106)`

:

```
[109.238]
```

The two coordinates above are about 109 meters apart.

One-To-One | Stateless | Peek | Input Schema | Output Schema |
---|---|---|---|---|

True | True | False | {"type": "boolean"} |

# | Description | Optional | Constant | Hijacked | Default |
---|---|---|---|---|---|

1 | Latitude | False | True | False | |

2 | Longitude | False | True | False |