Metadata: Option to remove existing location estimates #1723

Open
opened 2026-02-20 00:19:54 -05:00 by deekerman · 19 comments
Owner

Originally created by @HeikoGr on GitHub (Feb 25, 2023).

Originally assigned to: @lastzero on GitHub.

there should be an option to disable the placement of pictures with estimated locations on the map.

i was able to remove the pictures from the map by updateing the database as described here: #1395 (i did set lat and lon to 0, too).

Describe what problem this solves and why this would be valuable to many users
my expectation was that the pictures would disappear from the map after i unchecked the option to estimate locations.
Further thinking brought to my mind, that the actual option is related to indexing - and is no map setting.

Originally created by @HeikoGr on GitHub (Feb 25, 2023). Originally assigned to: @lastzero on GitHub. there should be an option to disable the placement of pictures with estimated locations on the map. i was able to remove the pictures from the map by updateing the database as described here: #1395 (i did set lat and lon to 0, too). **Describe what problem this solves and why this would be valuable to many users** my expectation was that the pictures would disappear from the map after i unchecked the option to estimate locations. Further thinking brought to my mind, that the actual option is related to indexing - and is no map setting.
Author
Owner

@graciousgrey commented on GitHub (Feb 28, 2023):

The map shows all photos with lat/lng information. If you disable the location estimates this does not remove already existing estimates.

@graciousgrey commented on GitHub (Feb 28, 2023): The map shows all photos with lat/lng information. If you disable the location estimates this does not remove already existing estimates.
Author
Owner

@HeikoGr commented on GitHub (Feb 28, 2023):

Yes, and it works as designed. But it would be nice to have the ability to either

  • remove the estimates from the database, or
  • disable the mapping of the photos with estimated locations
@HeikoGr commented on GitHub (Feb 28, 2023): Yes, and it works as designed. But it would be nice to have the ability to either - remove the estimates from the database, or - disable the mapping of the photos with estimated locations
Author
Owner

@graciousgrey commented on GitHub (Feb 28, 2023):

I guess removing estimates makes more sense in this case or what do you think?

@graciousgrey commented on GitHub (Feb 28, 2023): I guess removing estimates makes more sense in this case or what do you think?
Author
Owner

@HeikoGr commented on GitHub (Feb 28, 2023):

In my opinion: yes, removing the estimates does make more sense.

@HeikoGr commented on GitHub (Feb 28, 2023): In my opinion: yes, removing the estimates does make more sense.
Author
Owner

@lastzero commented on GitHub (Feb 28, 2023):

AFAIK the background worker should remove the estimates from the pictures. However, this does not happen instantly, but over time.

@lastzero commented on GitHub (Feb 28, 2023): AFAIK the background worker should remove the estimates from the pictures. However, this does not happen instantly, but over time.
Author
Owner

@HeikoGr commented on GitHub (Feb 28, 2023):

I will test it and report my mileage.

reading through the source (i might be totally wrong - i am bad at programming) in /internal/entity/photo_optimize.go it‘s only updating if lat/lon is set or the estimate setting is checked.

@HeikoGr commented on GitHub (Feb 28, 2023): I will test it and report my mileage. reading through the source (i might be totally wrong - i am bad at programming) in /internal/entity/photo_optimize.go it‘s only updating if ~lat/lon is set or~ the estimate setting is checked.
Author
Owner

@HeikoGr commented on GitHub (Mar 1, 2023):

I tested it the following way:

  • make shure there is no estimated geolocation in the database (select * from photos where place_src = 'estimate' => 0 entries)
  • enable option to estimate location
  • run docker compose exec photoprism photoprism optimise -f
  • check database: now there are 2.430 entries with estimated locations
  • disable option to estimate location
  • restart photoprism and make shure the option is still disabled (just to be shure)
  • run docker compose exec photoprism photoprism optimise -f
  • check database: there are still 2.430 entries with estimated locations

so i might be right with my assumption, that the optimizer is only able to set/update estimated locations.
It's actually not able to unset.

as this should be a really small change i would love to make a PR in the next days/weeks by myself. (including documentation and test case)

@HeikoGr commented on GitHub (Mar 1, 2023): I tested it the following way: - make shure there is no estimated geolocation in the database (`select * from photos where place_src = 'estimate'` => 0 entries) - enable option to estimate location - run `docker compose exec photoprism photoprism optimise -f` - check database: now there are 2.430 entries with estimated locations - disable option to estimate location - restart photoprism and make shure the option is still disabled (just to be shure) - run `docker compose exec photoprism photoprism optimise -f` - check database: there are still 2.430 entries with estimated locations so i might be right with my assumption, that the optimizer is only able to set/update estimated locations. It's actually not able to unset. as this should be a really small change i would love to make a PR in the next days/weeks by myself. (including documentation and test case)
Author
Owner

@lastzero commented on GitHub (Mar 1, 2023):

It can take up to 7 days. I can also verify and fix this if needed, however we are currently out of the office.

@lastzero commented on GitHub (Mar 1, 2023): It can take up to 7 days. I can also verify and fix this if needed, however we are currently out of the office.
Author
Owner

@HeikoGr commented on GitHub (Mar 1, 2023):

I thought the optimize command does the same as the background worker?

It's not super important for me (i found my fix by alter the database) - i just thought the actual behaviour may not meet the normal user expectation.

@HeikoGr commented on GitHub (Mar 1, 2023): I thought the optimize command does the same as the background worker? It's not super important for me (i found my fix by alter the database) - i just thought the actual behaviour may not meet the normal user expectation.
Author
Owner

@lastzero commented on GitHub (Mar 1, 2023):

Maybe if you run it with --force. Don't remember all the options.

@lastzero commented on GitHub (Mar 1, 2023): Maybe if you run it with --force. Don't remember all the options.
Author
Owner

@lastzero commented on GitHub (Mar 3, 2023):

Seems I was right about the 7 days (check was broken, but is fixed with the most recent patch):

Screenshot 2023-03-03 at 20 41 00
@lastzero commented on GitHub (Mar 3, 2023): Seems I was right about the 7 days (check was broken, but is fixed with the most recent patch): <img width="883" alt="Screenshot 2023-03-03 at 20 41 00" src="https://user-images.githubusercontent.com/301686/222811778-5e7404e6-66f4-4a3d-b76b-27ff80079130.png">
Author
Owner

@HeikoGr commented on GitHub (Mar 6, 2023):

@lastzero thank you for your last fix, as for now, you don't have to take action - i am still at research


little update from me on my research, even if the 7 days ar not over yet:

Maybe if you run it with --force. Don't remember all the options.

to be fair - the command is not documented. I got it from https://www.reddit.com/r/photoprism/comments/sec7y9/location_info/
as far as i understand the optimize command is only part of the background worker.

the worker does more then metadata:

  • metadata worker (<- runs optimize)
  • share worker
  • sync worker

but i can't find any code where the estimate location got deleted if the option is disabled.

back to my test database:

  • all 2430 estimated fotos are still in the database
  • the database entries do all have recent updates (fields "checked_at" and "estimated_at")

so i still doubt that the estimates gets deleted at the moment, but i will continue research.

@HeikoGr commented on GitHub (Mar 6, 2023): @lastzero thank you for your last fix, as for now, you don't have to take action - i am still at research --- little update from me on my research, even if the 7 days ar not over yet: > Maybe if you run it with --force. Don't remember all the options. to be fair - the command is not documented. I got it from [https://www.reddit.com/r/photoprism/comments/sec7y9/location_info/](url) as far as i understand the optimize command is only part of the background worker. the worker does more then metadata: - metadata worker (<- runs optimize) - share worker - sync worker but i can't find any code where the estimate location got deleted if the option is disabled. back to my test database: - all 2430 estimated fotos are still in the database - the database entries do all have recent updates (fields "checked_at" and "estimated_at") so i still doubt that the estimates gets deleted at the moment, but i will continue research.
Author
Owner

@lastzero commented on GitHub (Mar 6, 2023):

Still traveling and on my phone. Once I'm back at my workstation I can sort it out for very quickly.

@lastzero commented on GitHub (Mar 6, 2023): Still traveling and on my phone. Once I'm back at my workstation I can sort it out for very quickly.
Author
Owner

@HeikoGr commented on GitHub (Mar 29, 2023):

I can now for sure say that the background worker did not remove the estimated locations after unsetting the index feature "estimates".

I installed a clean instance of photoprism 3 weeks ago and set "estimates" before importing the pictures (and disabled it afterwards).

@lastzero would you like to prefer to look after it for yourself or should i try to write a PR? I was not able to set up a development environment at the moment and i am not sure which way you would prefer:

  • delete the estimates from the db at the moment the setting was updated
  • let a worker do the job
  • keep the metadata in the database and disable the mapping of estimated places
@HeikoGr commented on GitHub (Mar 29, 2023): I can now for sure say that the background worker did not remove the estimated locations after unsetting the index feature "estimates". I installed a clean instance of photoprism 3 weeks ago and set "estimates" before importing the pictures (and disabled it afterwards). @lastzero would you like to prefer to look after it for yourself or should i try to write a PR? I was not able to set up a development environment at the moment and i am not sure which way you would prefer: - delete the estimates from the db at the moment the setting was updated - let a worker do the job - keep the metadata in the database and disable the mapping of estimated places
Author
Owner

@lastzero commented on GitHub (Aug 6, 2023):

@dd900 If you need help, you are welcome to post your question in GitHub Discussions or ask in our Community Chat. Common problems can be quickly diagnosed and solved using our Troubleshooting Checklists. Silver, Gold, and Platinum members are also welcome to email us for technical support and advice.

View Support Options ›

@lastzero commented on GitHub (Aug 6, 2023): @dd900 If you need help, you are welcome to post your question in [GitHub Discussions](https://link.photoprism.app/discussions) or ask in our [Community Chat](https://link.photoprism.app/chat). Common problems can be quickly diagnosed and solved using our [Troubleshooting Checklists](https://docs.photoprism.app/getting-started/troubleshooting/). [Silver, Gold, and Platinum](https://link.photoprism.app/membership) members are also welcome to email us for technical support and advice. [View Support Options ›](https://www.photoprism.app/kb/getting-support)
Author
Owner

@HeikoGr commented on GitHub (Aug 6, 2023):

your exec command is wrong. I need to run
docker exec -it photoprism-mariadb-1 bash if i want to run the bash shell interactively on the mariadb container. From there you can run mysql/mariadb shell commands.

@HeikoGr commented on GitHub (Aug 6, 2023): your exec command is wrong. I need to run `docker exec -it photoprism-mariadb-1 bash ` if i want to run the bash shell interactively on the mariadb container. From there you can run mysql/mariadb shell commands.
Author
Owner

@lastzero commented on GitHub (Aug 6, 2023):

We've recently added docs that explain how to open a terminal with Portainer: https://docs.photoprism.app/getting-started/portainer/#command-line-interface

Anyhow, it would be best to discuss this on GitHub Discussions and not in the issue comments where everyone gets an email notification for every new comment. Thank you! :)

@lastzero commented on GitHub (Aug 6, 2023): We've recently added docs that explain how to open a terminal with Portainer: https://docs.photoprism.app/getting-started/portainer/#command-line-interface Anyhow, it would be best to discuss this on GitHub Discussions and not in the issue comments where everyone gets an email notification for every new comment. Thank you! :)
Author
Owner

@lastzero commented on GitHub (Aug 6, 2023):

How complicated is it to follow the link and simply ask there????

@lastzero commented on GitHub (Aug 6, 2023): How complicated is it to follow the link and simply ask there????
Author
Owner

@lastzero commented on GitHub (Aug 6, 2023):

👉 https://github.com/photoprism/photoprism/discussions

@lastzero commented on GitHub (Aug 6, 2023): 👉 https://github.com/photoprism/photoprism/discussions
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#1723
No description provided.