Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIP-115 Yet Another Geo Tag (ISO-3166-1/2/3) #952

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Changes from 7 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6857595
add yagt
dskvr Dec 27, 2023
096edab
clarification
dskvr Dec 27, 2023
5961d2d
Merge branch 'nostr-protocol:master' into propose/nip-yagt
dskvr Dec 27, 2023
84225e7
remove contientCode and continentName
dskvr Dec 29, 2023
8a72271
Merge branch 'propose/nip-yagt' of github.com:dskvr/nips into propose…
dskvr Dec 29, 2023
6d22ef3
Fix typo, minor terminology improvement
dskvr Jan 16, 2024
9460831
minor terminology improvement
dskvr Jan 16, 2024
9a0304a
optimize, remove tag[3]
dskvr Jan 23, 2024
a573509
remove numeric<->geohash collision, save bytes geohash->gh
dskvr Feb 8, 2024
07a3b5c
Remove filterable geohashes from NIP (despite knowing they will be em…
dskvr Mar 24, 2024
ff3b5bc
Rename yagt.md to NIP-115.md
dskvr Mar 24, 2024
f6bb925
Add NIP-115 to document
dskvr Mar 24, 2024
5b4168f
Rename NIP-115.md to 115.md
dskvr Mar 24, 2024
2c7deb1
Add NIP-115 to README
dskvr Mar 24, 2024
d325bd4
Update nip link
dskvr Mar 24, 2024
8d4714d
add section describing purpose of G
dskvr Mar 25, 2024
d530b3c
adjust language, simpler motivation section
dskvr Mar 25, 2024
47d5d4c
remove redundancy and fix format typo
dskvr Mar 25, 2024
16a2c2c
Merge branch 'nostr-protocol:master' into propose/nip-yagt
dskvr Mar 25, 2024
01d6fe0
update collisions
dskvr Mar 25, 2024
50af275
collisions: higher specificity
dskvr Mar 25, 2024
590d251
draft4
dskvr Apr 23, 2024
1e5a9eb
changed terminology
dskvr Apr 23, 2024
12b59cf
update some language and improve consistency
dskvr Apr 23, 2024
ef6c568
remove deprecated language
dskvr Apr 23, 2024
c62fb73
remove regionName and add collisions
dskvr Apr 23, 2024
c780682
add collision note for ISO-3166-1/2
dskvr Apr 23, 2024
83d05c0
add best practices, include ISO-3166-3 alpha-2/3
dskvr Apr 23, 2024
9357182
remove some deprecated language + add alpha-2 as default
dskvr Apr 23, 2024
afb74f6
add value types compatibility table and convert markers section to co…
dskvr Apr 23, 2024
cba026c
fix compat for 2/3
dskvr Apr 23, 2024
2a93610
remove countryName
dskvr Apr 23, 2024
74ccfd9
rationale rewrite, fix readme refs and add library supportt
dskvr Apr 23, 2024
f29289e
fix language, fix table
dskvr Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
91 changes: 91 additions & 0 deletions yagt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# NIP-XYZ: Yet Another Geo Tag (YAGT)

`draft` `optional`

This NIP extends an existing indexable tag `g` and a new indexable tag `G`.

## Motivation
The core aim of this NIP is to establish a unified and efficient method for geotagging within events. During the development of the [nostr-geotags](https://github.com/sandwichfarm/nostr-geotags) library which utilizes NIP-32, it became evident that more specific guidelines were needed for geotagging. This NIP is designed to provide a clear and standardized format for geotagging, promoting uniformity and effectiveness of geodata across nostr.

## Rationale
Developing a dedicated geotagging NIP offers several advantages over the general application of NIP-32 for geographical data:

- **Simplicity and Clarity:** Using NIP-32 for geodata can lead to verbose and complex labels, making them challenging to understand. This NIP simplifies expression.
- **Handling ISO Standards:** The complexity added by ISO-3166-3 country code changes when using NIP-32 is streamlined in this NIP by simply labeling the change as countryCode, thus making both publishing and filtering more straightforward.
- **Significance of Geodata:** Given its ubiquity, importance and diversity, geodata warrants its own specific letter designations and detailed specifications within nostr.
- **Extends Existing GeoTag** `NIP-52` defined the `g` geotag, which this NIP extends and is compatible with.

## Schema
This NIP uses a similar pattern as `NIP-32` (`G` and `g` instead of `L` and `l`) but with an additional key as position `3` and catered geographical data.

```
["G", label] //optional
["g", value, label, format]
```

## Keys
Standards are assigned to human readable labels instead of labeling content with standards, which complicates both publishing and filtering.

- `geohash` - A geohash of any precision.
- `countryCode` - `ISO-3166-1/3` country code.
- `countryName` - `ISO-3166-1/3` compatible country name.
- `regionCode` - `ISO-3166-2` region code.
- `regionName` - `ISO-3166-2` compatible region name.
- `cityName` - The the internationally recognized name of the city, formally cased. Use multiple `cityName` tags if a city has multiple spellings.
- `cityCode` - _Placeholder, there is no city code standard_

## Defaults
When `g` tag has no `tag[2]` it is assumed to be of type (key) `geohash`

```json
{ tags:
[
[ "g", "u2mwdd8q4" ]
]
}
```

## Examples

### Minimal Example
```json
{ tags:
[
[ "g", "u2mwdd8q4" ]
]
}
```

### Robust Example
```json
{ tags:
[
[ "G", "geohash" ],
[ "g", "u2mwdd8q4", "geohash" ],
[ "g", "u2mwdd8q", "geohash" ],
[ "g", "u2mwdd8", "geohash" ],
[ "g", "u2mwdd", "geohash" ],
[ "g", "u2mwd", "geohash" ],
[ "g", "u2mw", "geohash" ],
[ "g", "u2m", "geohash" ],
[ "g", "u2", "geohash" ],
[ "g", "u", "geohash" ],
[ "G", "countryCode" ],
[ "g", "AI", "countryCode", "alpha-2" ],
dskvr marked this conversation as resolved.
Show resolved Hide resolved
[ "g", "AIA", "countryCode", "alpha-3" ],
[ "g", "660", "countryCode", "numeric" ],
[ "g", "DJ", "countryCode", "alpha-2" ], //ISO-3166-3 "change"
[ "G", "countryName" ],
[ "g", "Anguilla", "countryName" ],
[ "G", "cityName" ],
[ "g", "Mount Fortune", "cityName" ],
]
}
```

### Filter
_Effective for events with **countryCode** `G` tag where `g` is either `AI` or `DJ`_

```
{ "#G": ["countryCode"], "#g": ["AI", "DJ"] }
```