# How to use location in org-roam?

**URL:** <https://org-roam.discourse.group/t/how-to-use-location-in-org-roam/3159>\
**Category:** Requests\
**Created:** [July 24, 2023, 12:28am UTC](https://org-roam.discourse.group/t/how-to-use-location-in-org-roam/3159 "2023-07-24T00:28:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [July 30, 2023, 5:41pm UTC](https://org-roam.discourse.group/t/how-to-use-location-in-org-roam/3159/3 "2023-07-30T17:41:21Z")

</div>

I have done a [quick experiment (code in Gist)](https://gist.github.com/nobiot/bcccc1033d74b16eefc19e936a4fdba1). It works on my end.

If someone can make it better, I’d love to see improvement. I just took it on as a technical exercise.

To use it:

1. Evaluate all the functions in the Gist
2. Create a couple of test nodes with a `:geo:` property
3. Visit a Org-roam node that has a `:geo:` property – where you are will be the origin
4. Run command `my/list-node-IDs-within-range-of-distance`
5. Enter a number: that is the max distance in kilometers
6. You will see a list of nodes ID that are within the kilometer distance

Please try not to be confused with the fact that the prompt asks for the max distance in kilometers and the resultant pop-up buffer shows the distance in meters. I could not show kilometers without rounding the values to 4km and 44km respectively (4 km vs 4.75 km is large enough for me to care).

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/2X/5/507f6c10315bf7a4240202957b606bfd15b215fd.jpeg)

Two notes:

- I used `GEO` property name, not `LATLONG` but they denote the same thing
- The value of `GEO` property must be [decimal degrees](https://en.wikipedia.org/wiki/Decimal_degrees) and must be separated by a space
- If you want to use this notation `37°22′16″N 122°2′15″W`, you’d need to convert it
- The algorithm is from [this website](https://www.movable-type.co.uk/scripts/latlong.html) – see the source code for a bit more detail

My test files are as follows.

File 1 (the origin)

```plaintext
:properties:
:modified: 2023-07-30T182055
:ID: 2023-07-30T163232
:geo: 37.3927 -122.042
:end:
#+title: test GEO Mountain View
#+filetags: test

```

File 2

```plaintext
:properties:
:modified: 2023-07-30T164943
:ID: 2023-07-30T164720
:geo: 37.3587 -122.075
:end:
#+title: test GEO 10km Ortega park
#+filetags:

```

File 3

```plaintext
:properties:
:modified: 2023-07-30T165100
:ID: 2023-07-30T165039
:geo: 37.0154 -122.211
:end:
#+title: test GEO more than 10km Devon Port
#+filetags: test

```

---

_[View the full topic](https://org-roam.discourse.group/t/how-to-use-location-in-org-roam/3159)._
