Bug 351987 - Allow to search by Country, City, Town when appropriate geo-location tags exist in database
Summary: Allow to search by Country, City, Town when appropriate geo-location tags exi...
Status: REOPENED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (show other bugs)
Version: 4.12.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
: 180268 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-29 18:09 UTC by Jens
Modified: 2023-01-29 16:56 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Current Geographic search options (9.61 KB, image/png)
2022-11-05 19:29 UTC, José Oliver-Didier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2015-08-29 18:09:50 UTC
Search by geotags is implemented but not useful. I do not wish to look up the geotags associated to a specific area before searching.

iPhoto and other media browsers allow searching by country, region/district/departement, city and named location (which have a specified size or radius). This should work within Digikam too.
Apparently, the data is there: In https://mail.kde.org/pipermail/digikam-users/2010-May/010422.html, there is talk about a GSoC project which autofills the IPTC location tags according to the latitude and longitude data of a photo. Has this ever been done? Can this feature be manually activated for a specific set of photos after import? It does not happen with Digikam 4.12.0 on my PC.

If this feature is there, the only thing that's missing is a "Places" browser that displays the IPTC locations tree in the left sidebar which can be used to filter the images displayed in the main view (please allow multiselection here), whether this be the map or thumbnails. (And one item at the top "No Geotag" which lists all images without geotag information.) This view should scale well, I have over 40,000 images in Germany alone. :-)

There should be four levels: Country, Region, City, Geolocations Bookmark (I don't think we need all 31 xAL* attributes here...). Of course this implies that the Geo bookmarks also "know" which City they belong to.

I don't really need "search" if I can browse by human-readable locations. But a filter box at the top would still be nice. I'm perfectly willing to discuss and review mockups. :)

Thank you!

* eXtensible Address Language, originally used by Google for Google Maps.

Reproducible: Always

Steps to Reproduce:
Wishlist, therefore no reproducability.
Comment 1 Alan Pater 2015-08-29 19:23:10 UTC
As always, the Metadata Working Group provides guidelines on which XMP properties should be used here, as well as how those properties map to legacy IPTC and to legacy photoshop.

      www.metadataworkinggroup.org/pdf/mwg_guidance.pdf#page=48

Those XMP properties are (in exiv2 format):

Xmp.Iptc4xmpExt.WorldRegion
Xmp.Iptc4xmpExt.CountryName 
Xmp.Iptc4xmpExt.ProvinceState
Xmp.Iptc4xmpExt.City
Xmp.Iptc4xmpExt.Sublocation
Comment 2 Maik Qualmann 2020-05-22 10:54:46 UTC

*** This bug has been marked as a duplicate of bug 180268 ***
Comment 3 Maik Qualmann 2021-02-21 16:22:13 UTC
*** Bug 433391 has been marked as a duplicate of this bug. ***
Comment 4 Maik Qualmann 2021-02-21 16:22:29 UTC
*** Bug 180268 has been marked as a duplicate of this bug. ***
Comment 5 José Oliver-Didier 2022-11-05 19:29:30 UTC
Created attachment 153500 [details]
Current Geographic search options

IPTC Location fields - Country, State-Province, City and Sublocation fields should be searchable.
Comment 6 Jens 2022-11-05 22:34:29 UTC
This bug was not about the existence of Country and City fields, but about automatically (!!!) filling them out when geotagging.
Nobody wants to manually fill out form fields if this can be automated.

And while we're at it: since placing photos on a map (geotagging) will automatically also define which country, region, city, street, etc. a photo was taken in, why not put the data into the IPTC Location fields - maybe even *instead* of polluting the tag tree, not just in addition?
Comment 7 Jonkeren 2022-12-02 09:26:27 UTC
(In reply to Jens from comment #6)
> This bug was not about the existence of Country and City fields, but about
> automatically (!!!) filling them out when geotagging.
> Nobody wants to manually fill out form fields if this can be automated.
> 
> And while we're at it: since placing photos on a map (geotagging) will
> automatically also define which country, region, city, street, etc. a photo
> was taken in, why not put the data into the IPTC Location fields - maybe
> even *instead* of polluting the tag tree, not just in addition?


Indeed, please let Digikam automatically also fill the fields:

IPTC:City
IPTC:Sub-location
IPTC:Province-State
IPTC:Country-PrimaryLocationCode
IPTC:Country-PrimaryLocationName

.... when geotagging.
I guess there should also be some kind of small interface / setting where can be defined "what" will be taken for these values.

In Digikam, we see: 
1. Country
2. State
3. State district
4. City
5. City district
6. Suburb
7. Place
8. Village
9. area

So 9 possible fields; if all are filled // data retrieved. There should be some interface where we can define which of these will be filled to the 4 IPTC fields; i think.
Comment 8 José Oliver-Didier 2022-12-02 14:02:33 UTC
Digikam already has a reverse geolocation lookup functionality with the Geolocation Editor plugin. It only needs to be modified with the option so that the respective IPTC fields are filled in.
Comment 9 Maik Qualmann 2022-12-03 17:12:21 UTC
Git commit 08af94d617c41413e3835c1e40e5948d45e8a09b by Maik Qualmann.
Committed on 03/12/2022 at 17:10.
Pushed by mqualmann into branch 'master'.

first step to write basic locations metadata
Related: bug 410425

M  +80   -21   core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp
M  +6    -0    core/utilities/geolocation/geoiface/items/gpsitemcontainer.h
M  +21   -17   core/utilities/geolocation/geoiface/reversegeocoding/rgwidget.cpp

https://invent.kde.org/graphics/digikam/commit/08af94d617c41413e3835c1e40e5948d45e8a09b
Comment 10 Maik Qualmann 2022-12-03 19:13:55 UTC
Git commit 34e985a2cf9a433db5c0084f7c5d20b3c47d44e7 by Maik Qualmann.
Committed on 03/12/2022 at 19:13.
Pushed by mqualmann into branch 'master'.

write location infos to the database
Related: bug 410425

M  +9    -2    core/libs/database/item/containers/itemgps.cpp
M  +38   -36   core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp
M  +5    -0    core/utilities/geolocation/geoiface/items/gpsitemcontainer.h

https://invent.kde.org/graphics/digikam/commit/34e985a2cf9a433db5c0084f7c5d20b3c47d44e7
Comment 11 Maik Qualmann 2022-12-03 22:48:06 UTC
Git commit 136af4080854ef89023135c016eba87e60056b22 by Maik Qualmann.
Committed on 03/12/2022 at 22:46.
Pushed by mqualmann into branch 'master'.

first step to get country code
We still need a function to convert the two-digit
country code to the three-digit country code.
Related: bug 410425

M  +18   -9    core/libs/database/item/containers/itemgps.cpp
M  +3    -2    core/utilities/geolocation/geoiface/backends/backend-geonames-rg.cpp
M  +3    -3    core/utilities/geolocation/geoiface/backends/backend-geonamesUS-rg.cpp
M  +1    -0    core/utilities/geolocation/geoiface/backends/backend-osm-rg.cpp
M  +8    -1    core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp
M  +20   -6    core/utilities/geolocation/geoiface/reversegeocoding/parsetagstring.h
M  +9    -4    core/utilities/geolocation/geoiface/reversegeocoding/rgtagmodel.cpp
M  +24   -8    core/utilities/geolocation/geoiface/reversegeocoding/rgwidget.cpp

https://invent.kde.org/graphics/digikam/commit/136af4080854ef89023135c016eba87e60056b22
Comment 12 Maik Qualmann 2022-12-04 08:36:06 UTC
Git commit 8c6b332ee8c9dc0465d2fa9532b29f5996c094c5 by Maik Qualmann.
Committed on 04/12/2022 at 08:34.
Pushed by mqualmann into branch 'master'.

add support for country codes
Related: bug 410425, bug 366286

M  +6    -1    core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp
M  +309  -52   core/utilities/geolocation/geoiface/reversegeocoding/rgwidget.cpp
M  +4    -0    core/utilities/geolocation/geoiface/reversegeocoding/rgwidget.h

https://invent.kde.org/graphics/digikam/commit/8c6b332ee8c9dc0465d2fa9532b29f5996c094c5
Comment 13 Maik Qualmann 2023-01-11 22:22:30 UTC
Git commit e0c6777e0efa1b1b6c226a2e01627a52aefc3038 by Maik Qualmann.
Committed on 11/01/2023 at 22:20.
Pushed by mqualmann into branch 'master'.

first step, add country search to advanced search
Related: bug 433391, bug 464165

M  +22   -0    core/libs/database/coredb/coredb.cpp
M  +2    -0    core/libs/database/coredb/coredb.h
M  +1    -0    core/libs/database/item/lister/itemlister_salbum.cpp
M  +4    -0    core/libs/database/item/query/itemquerybuilder.cpp
M  +16   -0    core/utilities/searchwindow/searchfields_createfield.cpp
M  +1    -0    core/utilities/searchwindow/searchgroup.cpp

https://invent.kde.org/graphics/digikam/commit/e0c6777e0efa1b1b6c226a2e01627a52aefc3038
Comment 14 Maik Qualmann 2023-01-29 16:56:53 UTC
Git commit ecd159a519c8ef79e402b9dfca5ba56f80f8023d by Maik Qualmann.
Committed on 29/01/2023 at 16:55.
Pushed by mqualmann into branch 'master'.

add search for province, county and city
Related: bug 433391
FIXED-IN: 8.0.0

M  +2    -1    NEWS
M  +2    -1    core/libs/database/coredb/coredb.cpp
M  +33   -2    core/libs/database/item/query/itemquerybuilder.cpp
M  +49   -1    core/utilities/searchwindow/searchfields_createfield.cpp
M  +6    -3    core/utilities/searchwindow/searchgroup.cpp

https://invent.kde.org/graphics/digikam/commit/ecd159a519c8ef79e402b9dfca5ba56f80f8023d