# filter\_geomap\_distance

Source: https://zotonic.com/docs/2770/filter_geomap_distance

URI: https://zotonic.com/id/2770

Language: en



Calculate the great-circle distance between two locations in kilometers.

Use resource IDs or names for both locations:

```django
{{ id|geomap_distance:other_id }}
```

Or supply the destination latitude and longitude as separate arguments:

```django
{{ id|geomap_distance:52.34322:4.33423 }}
```

A location can also be a map with numeric binary-keyed pairs `lat`/`lng`, `location_lat`/`location_lng`, or `computed_location_lat`/`computed_location_lng`. Resource references use their computed location properties. Coordinates are in degrees; this is geographic distance, not a road or travel distance.

The Erlang entry points are `geomap_distance/3` for two locations and `geomap_distance/4` for a location plus latitude and longitude. The separate coordinate arguments are converted to floats when necessary. Undefined inputs, unknown resources, missing coordinates, or unconvertible destination arguments return `undefined`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2770?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2770?language=en>)
