One of the many ways I use Obsidian is to create notes of places. These could be restaurants I’ve seen a great recommendation for, places I’d like to visit, places I’ve been, upcoming events, etc.
One critical piece of context for a place is its location, so I add in the geolocation coordinates using the Map View plugin (thanks esm!). Then, say I travel to a new town or suburb, I can open a map and see all the places I’d like to visit or eat, along with the notes I made and reference information I entered.
It would be great to be able to also be out somewhere, create a new note and be able to easily add geolocation information to the note from within the app (e.g. using the Map View plugin). This would require the Obsidian mobile app to have the ability to request location permission from the device, which it currently can’t do.
Proposed solution
I propose that the developers add to the mobile app, the ability to request access to location information from the device.
As a second, or concurrent step, I would love to also be able to use a What3Words location instead of Lat/Long coordinates.
Current workaround (optional)
One current workaround is to open Google Maps, zoom to current location, drop a pin, touch and hold the pin, scroll to the coordinates, touch and hold to select coordinates, copy the coordinates, switch back to Obsidian and paste the coordinates into the note in the format Geolocation.
Many other major notes apps allow the user to include the GPS location (pulled from the desktop or mobile OS) as metadata (and furthermore, in a template) when a note is created or modified. This functionality has been around for years in other notes apps. Location is a very useful way to view and sort notes, as when travelling and going around, notes are often created in relation to where one physically is when taking them. Some community plugins (like Obsidian Map View allow you to view a map of locations from notes in your vault and even visually view how links are geographically related. However, there is no native option or even a way to access the location APIs of the operating systems in Obsidian desktop or mobile. Scripts can be used to get location via IP geolocation via web services, but true location services access is not possible either on desktop (HTML5 navigator.geolocation.getCurrentPosition is not even accessible from JavaScript) as this is not exposed in Obsidan desktop nor are location services exposed on mobile which means no access to the native location API on Apple iOS or Android. IP geolocation also doesn’t work when the network is not available (e.g., while taking notes when offline or in an area with no network service) and because the location provided by such services comes from an IP geolocation database, it is often wrong by hundreds or thousands of miles if it is available.
From my research and the notes included in the linked community plugin it seems that this is not presently possible in a community plugin either because the Obsidian app on desktop and mobile does not request permission for the OS location APIs See further discussion about these limitations of the official Obsidian app here: GPS Location Support
Proposed solution
Please include as a core plugin or built-in functionality access to location APIs or provide functionality where Templates can just use something like {{location}}, exactly as it presently does with {{date}}. This is not particularly difficult to implement… I have written several apps that use location on both iOS and Android and it’s trivial to access this information that is virtually ubiquitous in modern apps both on desktop and on mobile.
Current workaround (optional)
There are no current workarounds that exist entirely within the Obsidian app. The only way to include a location in Obsidian is to get your location via another app or a handheld GPS or other location source (a helper app in the aforementioned Map View community plugin) or service and copy/paste it into Obsidian. This is clunky and a time waster, to say the least, and many notes never get a location as I would desire since this process must be done manually as described above.
If you wanted to you could use my Android app “Obsidian GPS” which will create a markdown file in your Obsidian vault. I am awaiting release to Google Play Store but in the mean time if you send me a message I can give you early access. obsidiangps
I extremely agree – I’ve started using obsidian recently and was looking for this exact sort of {{location}} feature to use in my note templates, but without success. Would LOVE if this could be natively implemented or if someone could point me to the best workarounds (additional plugins, etc) to resolve this!
When updating my journal, I’d like to be able to include a relatively precise location. Unfortunately this is essentially impossible right now - best we can do is IP based, which is very imprecise.
Proposed solution
Include the permissions required in manifests for iOS/Android.
At least on iOS, the user won’t be asked until they actually use the feature.
Ensure that navigator.geolocation works properly.
For additional accessibility, provide a command that enters the current location as a core plugin.
For extra additional accessibility, provide the core template with the ability to insert location on insert.
This is also useful for weather information in weather-station-dense localities.
Current workaround (optional)
Use free services - quite limited.
Some plugins use IP geolocation to provide an approximate area.
I’m considering using iOS shortcuts and Templater magic to “give” the geolocation data to Obsidian.
Related feature requests (optional)
I’ve found a similar thread in a very different place on the forum.
Looks like there are three’ish threads on this topic, I’ll just respond to one to avoid spamming . Anyway, I’m running into the same thing, and it’s a bummer - I’d like to build plugins around geospatial data, and I think that Day One’s handling of note geolocation is nifty and would be great in Obsidian, but is not replicable because of this restriction, and the IP-address workaround is a pretty rough one because many of us are running setups that shift our IP location.
Easily get at the current geo position (GPS) on a mobile device that runs Obsidian.
Mainly to update a “current location” note, for use with the Obsidian Leaflet maps.
Proposed solution / current workaround
On my laptop, I use Templater to update a “Current Location” note by calling a Python script that evaluates my current geo location (from the laptop’s GPS or IP address).
I’d very much like to see that on the mobile version, so I could have a “live view” of my Obsidian Leaflet maps. It’s of course not that easy on a smartphone: Users have to consent reading the GPS location, and I wonder if it’s available in Typescript/Javascript, instead of running external code.
So the best bet would be that the Obsidian API could support that functionality and provide some means for a plugin (or JS code) to read out the location data, i.e. at least latitude and longitude (WGS 84), maybe even elevation (meters).
Thus, plugins like Obsidian Leaflet maps could use it directly, and notes using Templater and/or Dataview scripting could also use it.
I’d love to see this feature. One thing I like about Evernote is the metadata in every note: I know when and where each note was composed. If I could have this info in a template in Obsidian, that would be great.
It would be great to get accurate GPS location, but this is what I’m doing on mobile for general location using Templater. It requires an internet connection, and will insert a placeholder (or blank) if none is available.
Works great on desktop or mobile. Templater script:
<%*
return Promise.race([
new Promise((resolve) => {
fetch('http://ip-api.com/json/')
.then(response => response.json())
.then(data => resolve([data.city, data.regionName, data.country].filter(x => !!x).join(', ')))
}),
new Promise((resolve) =>
// If we haven't fetched the location within 300ms,
// time-out and resolve with the placeholder text instead
setTimeout(() => resolve('Location'), 300)
)
])
%>
How would you use this with Obsidian Leaflet? Glancing at the docs for that plugin, I don’t see an easy way for it to import locations from multiple notes.
I know this is some months old, but I was wondering - where do you put this exactly?
I’m new here to Obsidian and I’ve tried adding it to my notes, but it just loads the location and removes everything else. I did see in the docs for templater about about user scripts, but I cannot make it load! I’d like to have it in my ymal with everything else. (date created, modified, tags, etc.,)
Any help would be appreciated as i’d love to use it because it does load my location