Places: Fallback to nearby state if unknown at the precise location #1230

Open
opened 2026-02-20 00:08:47 -05:00 by deekerman · 2 comments
Owner

Originally created by @Fylax on GitHub (Nov 28, 2021).

What does not work as expected?

New states categorization seems to fail with some coordinates

How can we reproduce it?

Steps to reproduce the behavior:

  1. Download sample images
  2. Add them to PhotoPrism
    • the wrong picture will be placed in "Camaiore, Italy" (creating a new state accordingly)
    • the correct picture (taken a few meters away) will be placed in "Camaiore, Toscana, Italy"

What behavior do you expect?

Both pictures should be in the "Toscana" state

What version you are using?

211127-86c43159-Linux-x86_64

Any other helpful information?

  • error occurred after running photoprism places update
  • a video geo-localized in 43.891815, 10.222351 is also placed in the wrong state.
Originally created by @Fylax on GitHub (Nov 28, 2021). **What does not work as expected?** New states categorization seems to fail with some coordinates **How can we reproduce it?** Steps to reproduce the behavior: 1. Download [sample images](https://github.com/photoprism/photoprism/files/7613641/photoprism.zip) 2. Add them to PhotoPrism * the wrong picture will be placed in "Camaiore, Italy" (creating a new state accordingly) * the correct picture (taken a few meters away) will be placed in "Camaiore, Toscana, Italy" **What behavior do you expect?** Both pictures should be in the "Toscana" state **What version you are using?** 211127-86c43159-Linux-x86_64 **Any other helpful information?** - error occurred after running `photoprism places update` - a video geo-localized in _43.891815, 10.222351_ is also placed in the wrong state.
Author
Owner

@lastzero commented on GitHub (Nov 28, 2021):

Looked it up. If I read this correctly, it is 1 m away from the "official" state boundary? 👇

tuscany

We run a private Nominatim instance that doesn't return the state, other than the official API:

Also note we use S2 Cell IDs which intentionally are less precise to preserve your privacy:

In conclusion, this likely happens in such an edge case because the Mediterranean Sea doesn't belong to the state in the backend database - the image is basically taken on the water.

Wouldn't see it as a high priority bug therefore. I'll change the issue into a "todo", so we can change the API to be less strict at a later time (when multi user support is done).

Let us know when you have other examples that are certainly not an edge case and must be fixed with a higher priority.

@lastzero commented on GitHub (Nov 28, 2021): Looked it up. If I read this correctly, it is 1 m away from the "official" state boundary? 👇 ![tuscany](https://user-images.githubusercontent.com/301686/143776466-7a517e5f-c048-4e18-8927-6b68231dec0a.png) We run a private Nominatim instance that doesn't return the state, other than the official API: - https://nominatim.openstreetmap.org/reverse?lat=43.891876&lon=10.222449&format=json Also note we use S2 Cell IDs which intentionally are less precise to preserve your privacy: - https://s2geometry.io/devguide/s2cell_hierarchy.html In conclusion, this likely happens in such an edge case because the Mediterranean Sea doesn't belong to the state in the backend database - the image is basically taken on the water. Wouldn't see it as a high priority bug therefore. I'll change the issue into a "todo", so we can change the API to be less strict at a later time (when multi user support is done). Let us know when you have other examples that are certainly not an edge case and must be fixed with a higher priority.
Author
Owner

@Fylax commented on GitHub (Nov 29, 2021):

Nice edge case, thank you for the explanation.
Definitely not a high-priority task and I can definitely mock the position to be a few meters away.

Just for your reference, as of today, no country seems to claim less than 3 nautical miles (5.6 km) as territorial sea, so for future development, you might use that value for "closest country".
Territorial seas claims by country

@Fylax commented on GitHub (Nov 29, 2021): Nice edge case, thank you for the explanation. Definitely not a high-priority task and I can definitely mock the position to be a few meters away. Just for your reference, as of today, no country seems to claim less than 3 nautical miles (5.6 km) as territorial sea, so for future development, you might use that value for "closest country". [Territorial seas claims by country](https://en.wikipedia.org/wiki/Territorial_waters#Territorial_sea_claim)
Sign in to join this conversation.
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
starred/photoprism#1230
No description provided.