Add geolocation support to events (NIP-52 'g' tag) #13

Open
opened 2026-04-27 16:20:07 +00:00 by padreug · 0 comments
Owner

Summary

Allow events to be geotagged with coordinates so they can be discovered on a map. NIP-52 supports the g tag (geohash) for location-based filtering.

Scope

  • Add geohash field to Event model (optional string)
  • Add latitude and longitude fields to CreateEvent (optional floats)
  • Convert lat/lng to geohash on creation (using ngeohash library, already used by the webapp activities module)
  • Publish as NIP-52 g tag in the NostrEvent
  • Migration to add geohash column
  • The existing location field (free-text venue/address) remains separate — geohash is the machine-readable coordinate

NIP-52 spec

The g tag uses geohash encoding for location-based relay queries:

["g", "<geohash>"]

Relays can filter by geohash prefix for geographic proximity searches.

  • aiolabs/webapp#30 — webapp UI for geotagging events (map picker + map-based discovery)
  • The activities module already uses ngeohash for activity geolocation
## Summary Allow events to be geotagged with coordinates so they can be discovered on a map. NIP-52 supports the `g` tag (geohash) for location-based filtering. ## Scope - Add `geohash` field to Event model (optional string) - Add `latitude` and `longitude` fields to CreateEvent (optional floats) - Convert lat/lng to geohash on creation (using `ngeohash` library, already used by the webapp activities module) - Publish as NIP-52 `g` tag in the NostrEvent - Migration to add `geohash` column - The existing `location` field (free-text venue/address) remains separate — geohash is the machine-readable coordinate ## NIP-52 spec The `g` tag uses geohash encoding for location-based relay queries: ```json ["g", "<geohash>"] ``` Relays can filter by geohash prefix for geographic proximity searches. ## Related - aiolabs/webapp#30 — webapp UI for geotagging events (map picker + map-based discovery) - The activities module already uses `ngeohash` for activity geolocation
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/events#13
No description provided.