Geocode Note

by blamouche
5
4
3
2
1
New Plugin

Description

This plugin has not been manually reviewed by Obsidian staff. Add geographic coordinates, icon and color to your notes via geolocation or address lookup.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Geocode Note

An Obsidian plugin that adds geographic metadata to your notes — coordinates, marker icon, and color — stored in the YAML frontmatter.

Designed to work seamlessly with map plugins like Obsidian Map View.

Features

  • Four ways to set coordinates:
    • Current location — Uses device geolocation (GPS on mobile, IP-based fallback on desktop)
    • Address search — Powered by OpenStreetMap Nominatim (free, no API key needed)
    • Manual entry — Type latitude and longitude directly
    • Draggable map marker — Fine-tune the position on an interactive MapLibre GL map rendering OpenFreeMap vector tiles (the same look & feel as Obsidian's built-in Bases maps, auto-switched between light and dark styles to match your theme); the address is refreshed via reverse geocoding as you drag
  • Live marker preview — The marker in the modal rebuilds instantly when you pick a different icon or color, without losing its position
  • Inline map code block — Drop a ```geocode-map block anywhere in a note and it renders as an interactive map centered on the frontmatter coordinates, with the same marker icon and color. Add height: 320 inside the block to override the default size. Use the "Insert map block" command to drop the snippet at the cursor
  • Resolved address saved to frontmatter — Keeps the human-readable address alongside the coordinates
  • Update mode — Reopen a previously geocoded note and the modal reloads existing coordinates, icon, color and address for quick edits
  • Prefill from note content — Configure the plugin to prefill the address search from the note title or from the frontmatter address field
  • Icon picker — 42 icons from Lucide organized in 4 categories (Places, Nature, Transport, Activities)
  • Color picker — 10 color options for your map marker
  • Bulk export — Export every geocoded note from your vault to standard formats (GeoJSON, KML, GPX, CSV) in one click
  • Obsidian Maps locate button (fallback) — On older Bases map views that do not yet ship MapLibre's native GeolocateControl, optionally inject a geolocation button of our own. Recent Bases versions already include a native control, in which case our injection is automatically skipped
  • Mobile-friendly — Responsive UI with large touch targets, works on both phone and desktop
  • No API key required — All services used are free and open

Frontmatter format

The plugin writes the following fields to your note's YAML frontmatter:

---
coordinates:
  - "48.85837"
  - "2.294481"
icon: "landmark"
color: "red"
address: "Tour Eiffel, 5, Avenue Anatole France, Paris, France"
---
Field Description
coordinates Array of two strings: latitude and longitude
icon Lucide icon name for the map marker
color Color name for the map marker
address Human-readable address resolved from the geocoder (omitted when coordinates come from manual entry or pure geolocation)

Usage

Opening the plugin

Option 1: Click the map pin icon in the left ribbon.

Option 2: Open the command palette (Ctrl/Cmd + P) and search for "Geocode current note".

Setting coordinates

  1. Current location — Click "My current location". On mobile, the device GPS is used. On desktop, an approximate IP-based location is provided.
  2. Address search — Type an address in the search field and press Enter or click the search button. The first result from OpenStreetMap is used, and its full address is stored in the address frontmatter field.
  3. Manual entry — Click "Enter coordinates manually" to reveal latitude/longitude fields.
  4. Fine-tune on the map — Once coordinates are set, a MapLibre GL map appears with the OpenFreeMap bright or dark style depending on your Obsidian theme. Drag the marker to adjust the position; the address field is refreshed automatically via reverse geocoding.

Choosing an icon

Select an icon from the visual grid. Icons are grouped into categories:

Category Examples
Places Pin, Home, Building, Landmark, Church, Castle, Hotel, Hospital...
Nature Tree, Pine, Forest, Mountain, Flower, Camping, Sea...
Transport Car, Bus, Train, Plane, Ship, Bike, Gas station...
Activities Coffee, Restaurant, Bar, Shopping, Gym, Music, Photo...

Choosing a color

Click one of the 10 color circles: red, blue, green, orange, purple, yellow, pink, teal, gray, or black.

Saving

Click "Save" to write the coordinates, icon, color and address to the note's frontmatter.

Updating an existing note

If the active note already contains geocoding data, opening the modal switches to update mode: the existing coordinates, icon, color and address are preloaded, the map is centered on the current position, and saving overwrites the frontmatter fields in place.

Embedding a map in a note

Insert a fenced code block with the geocode-map language tag anywhere in a geocoded note:

```geocode-map
```

In reading mode the block is replaced by an interactive MapLibre map centered on the note's coordinates, with the marker icon and color from the frontmatter. Notes without coordinates show a placeholder inviting you to run "Geocode current note".

You can override the default height per block:

```geocode-map
height: 320
```

The "Insert map block" command (palette Ctrl/Cmd + P) drops the snippet at the cursor.

Settings

Open Settings → Community plugins → Geocode Note to access two sections:

Options

Option Values Description
Prefill search field Nothing (default), Note title, Frontmatter "address" field When the modal opens, the address search input is prefilled with the selected source. In update mode the existing address is preferred; this fallback is used when it is missing.

Map code block

Option Values Description
Default map height 120480 pixels (default 240) Height used by geocode-map blocks that don't set their own height:.

Experimental

Option Description
Add locate button to Obsidian Maps Safety net for older Bases versions that don't ship MapLibre's native GeolocateControl. When enabled, injects our own geolocation button into each Bases map view — clicking it centers the map on your position (device GPS, with IP-based fallback) and drops a blue location marker. If a native control is already present on the view, our injection is automatically skipped so you don't end up with two stacked buttons. Disabling the option cleanly removes our button and marker from all open maps.

This option hooks into internals of the Bases map view that are not part of its public API and may break with future updates. If the button does not appear, try closing and reopening the base tab after toggling the option.

Export

Scans every note in the vault that has a coordinates frontmatter field and generates a download in the chosen format. The settings panel shows how many geocoded notes are currently available.

Format Extension Use case
GeoJSON (RFC 7946) .geojson Leaflet, Mapbox, QGIS, ArcGIS, and most modern web mapping libraries
KML 2.2 .kml Google Earth, Google My Maps
GPX 1.1 .gpx GPS devices and outdoor apps (each note is exported as a waypoint)
CSV .csv Excel, Numbers, Google Sheets, data analysis pipelines

Each exported entry carries the note's title, coordinates and resolved address; GeoJSON and CSV additionally include the icon, color and vault path. Files are named geocoded-notes-YYYY-MM-DD.<ext>.

Installation

Manual installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create a folder: <your-vault>/.obsidian/plugins/geocode-note/
  3. Copy the three files into that folder
  4. Open Obsidian > Settings > Community plugins > Enable "Geocode Note"

With BRAT (Beta Reviewer's Auto-update Tool)

If you use the BRAT plugin, add this repository (blamouche/obsidian-geocode-note) as a beta plugin to get automatic updates on every release.

Development

# Clone the repo
git clone https://github.com/blamouche/obsidian-geocode-note.git
cd obsidian-geocode-note

# Install dependencies
npm install

# Build (one-time)
npm run build

# Development mode (watch & rebuild on changes)
npm run dev

For hot-reload during development, install the Hot Reload plugin and create an empty .hotreload file in the plugin folder.

Available icons

All icons come from Lucide and are built into Obsidian.

Places: map-pin, home, building-2, landmark, church, castle, hotel, school, library, store, warehouse, factory, hospital

Nature: tree-deciduous, tree-pine, trees, mountain, mountain-snow, flower-2, leaf, tent, waves

Transport: car, bus, train-front, plane, ship, bike, fuel, anchor

Activities: coffee, utensils, beer, wine, shopping-cart, dumbbell, music, camera, star, heart, flag, globe

Available colors

red, blue, green, orange, purple, yellow, pink, teal, gray, black

License

MIT