Summary: | MapSearch: Merge overlapping markers to clusters | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Michael G. Hansen <mike> |
Component: | Searches-Map | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles, p.edelman, patrick_spendrin, rahn |
Priority: | NOR | ||
Version: | 1.0.0 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 1.0.0 | |
Sentry Crash Report: | |||
Attachments: |
Patch for clustering of markers against r1014109. Work in progress
Screenshot of clustering feature Map clustering, new version Map clustering, supports additional filtering and bi-directonal selections Map clustering, against r1014109 Map clustering, against r1018188 Map clustering, new version bug with none image selected Map clustering, new version Map clustering, new version, zoom to cluster and speed-ups New version, make the map resizable New version, adapted to KDE 4.2.4 |
Description
Michael G. Hansen
2009-08-24 20:50:40 UTC
Created attachment 36413 [details]
Patch for clustering of markers against r1014109. Work in progress
Created attachment 36414 [details]
Screenshot of clustering feature
Michael, I'm very impressioned by your patch. great work. I will review it soon, before beta4 planed at end of this week, to include it in this release... Gilles Caulier Created attachment 36474 [details]
Map clustering, new version
New version:
- some refactoring (will do more tomorrow)
- selecting images in the icon view highlights the corresponding markers
- support for highlighting clusters by moving the mouse over them and pressing shift (currently only one cluster can be highlighted this way at once)
left to do:
- select images when a cluster is highlighted by mouse
- find better colors for clusters and highlights
- select size steps for clusters
- currently the clusters steal some markers from each other, but this is the only easy way to get them far enough apart. Might try a better implementation tomorrow
Created attachment 36502 [details]
Map clustering, supports additional filtering and bi-directonal selections
added:
- selections synchronized between icon view and map, use shift+left_mouse_button to select clusters
- filtering the icon view by clusters: control+left_mouse_button on a cluster hides images from other clusters. Other clusters are grayed out, if you click them, their images become visible as well. Note that this filtering does not get saved in the map searches!
- selections and filtering: selection and filtering is stored for markers, because the clusters are too fragile. A cluster can become partially selected/filtered when it is formed from other clusters. Clicking with control/shift+LMB cycles through partially-all-none.
- the MarkerClusterHolder code is intentionally separated from the rest, so it can be used in other projects
left to do:
- disable selection and filtering in the map on the right side of digikam
- find better colors for clusters and highlights
- select size steps for clusters
- currently the clusters steal some markers from each other, but this is the
only easy way to get them far enough apart. Might try a better implementation
tomorrow
- more code documentation
Excelent job. Continue. Big thanks. Gilles Caulier Truly amazing! Great feature, thanks. One thing I am missing - easy switching between clusters. Now I use Ctrl+LMB to select cluster, Ctrl+LMB to select next one and have to return to old cluster to hide images from old location. Bit awkward - but have no idea how to do this interface-wise :( Bug: select area with several clusters, all are highlighted and images shown. Select one cluster, only images from this cluster are shown. Once again select the original area - all clusters are highlighted but only images from selected cluster are shown. IMO all images should be shown again. Another bug: right side Geolocation panel was affected - when selecting image with geolocation data it should be centered with place where geolocation data points. Now it only adds circle with number and doesn't move viewport at all. Created attachment 36531 [details] Map clustering, against r1014109 - fixes the two bugs reported by Mikolaj Mikolaj wrote: > One thing I am missing - easy switching between clusters. Now I use Ctrl+LMB > to select cluster, Ctrl+LMB to select next one and have to return to old > cluster to hide images from old location. Bit awkward - but have no idea how > to do this interface-wise :( Good point. I now made Ctrl+LMB select clusters on their own. If you click on a cluster, it will deselect the old one. But you can use Shift+Ctrl+LMB to select multiple clusters at once now. Shift+LMB is unchanged. One would probably expect Ctrl to alter the shift-select-behavior, but we are running out of modifier keys... ;-) - add tooltips as a replacement for labels on Marble's placemarks. Tooltips show the filenames, but are only shown for clusters with up to three markers, otherwise the tooltip would get too big. Tooltips are only enabled in the Image Properties Map on the right side, not in the search map. - fix another bug whether the filter was not reset when switching from the map search tab to another tab - partially selected clusters have their stroke circle now dotted, fully selected clusters have solid lines Gilles, if you plan to include this feature in beta4, please let me know if there are any changes you'd like me to make, or a higher revision number to test it with (I am still at r1014109, because I did not want to risk breaking my build). I can probably do some more changes until noon of Saturday. Thank you very much :) Cannot test new version now but I think selecting of clusters one by one (not adding) should be done with Ctrl+Shift+LMB. Awkward but Ctrl+LMB behavior is like in all other places where Ctrl+LMB adds or removes from selection. Another feature which could be handy: use clusters for quick navigation and zooming. Double click (is is possible with Marble widget?) will "decluster" clicked marker and zoom to next level of clusters. Example - you see whole world, with markers in Europe, America, Africa. Double click on Europe marker and continent is zoomed in with visible clusters in regions like Iberia, Balkans, Scandinavia, etc. This would offer quick and easy navigation and zooming. Last stage would be miniature thumbnails placed on map where are individual photos (like in Google Maps). Altough I think this last feature will be available in Marble only in next generation (as was written on some Marble related blog). I don't have GPS and always had to geolocate manually. Thanks to Gilles great kipi-plugin it wasn't hard, just slightly boring. With this feature it is easy to visualize my journeys and have some fun from GPS tags :) Michael, I'm very busy at home, so i plan to delay little 1.0.0-beta4 release, probably next week. So let's go to continue your great work. congratulations in advance Gilles Caulier Michael, though I haven't tested it yet, this sounds like an extremely nice set of features. Thanks a lot!!! Just two remarks, also related to Mikolaj's last comment: When a "cluster" only contains one image, it might be nice that on mouse-over one sees a little thumbnail image (just a few pixels). In principle this could be realized by a few lines of simple kml (though it might be that marble does not support the corresponding elements yet; at least last time I checked it did not work). If that's of interest, I could post an example on how to do that. In addition to using auto-clustering of geo-localized images, there is also another approach: for example for a holiday trip one may select one image which represents the whole trip. This image (with a special marker) becomes visible on a (specified) low zoom level (ie far away). Then for each day of a trip one can define further selected images, which become visible at other zoom levels (ie when zooming in). I am using something like this for quite a while via google-earth with some additional files in each digikam folder and some hand-written python scripts. Having such type of functionality integrated in digikam might be of interest to others as well. (I am aware that this is in a different direction than the clustering, but in combination this would be very cool ...). Best, Arnd Created attachment 36617 [details]
Map clustering, against r1018188
new version:
- patch confirmed to work up to r1018188
- display thumbnails for clusters with only one image
- painting through callback-plugin for Marble, now clusters do not paint over the grid/compass/etc. anymore. If the plugin is not available, painting is done through customPaint as before. The plugin has to be shipped as a separate shared library, currently there is no way to add a plugin from within the application. Torsten of Marble has indicated interest in a patch, I will try to come up with one, but it will take time until we can actually use it.
Mikolaj: I like suggestion for "zooming into a cluster" and will try to integrate it next time. Showing images on the map is available now!
Arnd: I think we could get something similar to your idea by just using the oldest|newest|highest rated|album-thumbnail picture when there are multiple images in a cluster. Oldest and newest should be easy to implement, but will require a configuration interface.
The patch do not compile with KDE 4.2.1 : Generating externaldraw.moc /home/gilles/Documents/devel/SVN/trunk/graphics/digikam/libs/imageproperties/markerclusterholderplugin/externaldraw.h:42: Error: Undefined interface automoc4: process for /home/gilles/Documents/devel/SVN/trunk/graphics/digikam/libs/imageproperties/markerclusterholderplugin/externaldraw.moc failed: Unknown error pid to wait for: 0 returning failed.. Sound like marble API problem. Your patch need to check marblewidget version to see if code can be compiled. Another little problem : moc files inclusion : externaldraw.moc and markerclusterholder.moc are missing Gilles Caulier Works great :) One thing: in geolocation panel on right side when you select one image its thumbnail is displayed, great. But this is small thumb (and this is OK) and over this small thumbnail crosshairs are overlayed. Not big, but big enough to cover image and limit its readability. Also when more that one image is selected crosshairs are making number with count of images barely readable. First I was thinking 'Is it possible to turn off that cross?' but this is useful for zooming to point where center zooming point is. Any ideas how to solve that? Created attachment 36651 [details]
Map clustering, new version
- fix moc-issue
- patch now compiles without marble, with marble from kde 4.2.2, with marble from kde 4.3. I hope compilation with kde 4.2.1 works now, too.
- mouse-interaction does not work correctly with marble from kde 4.2.2, so it was deactivated for that version
Mikolaj:
Yes, the crosshairs does get in the way! I moved the rendering up above the coordinate grid, so that is out of the way. Disabling the crosshairs is not an option, so I don't know what to do.
For the zooming-on-cluster option: It seems that Marble does not currently have a method for zooming into a bounding box, so this will not be as easy. We'll see!
left to do:
- adjust indentation in markerclusterholder-files to digikam coding guidelines, it was reset somehow
- find a way to set a bounding box on Marble
Michael, Just tested. One word: great !!!! By "find a way to set a bounding box on Marble", do you mean to draw the area rectangle corresponding to selection done previously in map search view from the left sidebar ? This rectangle is save in map search virtual folder properties from Database. It will be nice to see this selection as an overlay behind the map. What do you think about ? Gilles Caulier Michael: cannot test now but did you move thumbnail "over" crosshairs (z-index "infinity")? If it is so I think this is OK solution, complete turn off of it could be harmful - problems with zooming. Gilles: Thanks ;-) By "find a way to set a bounding box on Marble", I meant when I have the bounding box around all markers in a cluster in latitudes and longitudes, I don't know how to tell Marble to zoom to that area. I can set the center, but still have to figure out the zoom/altitude. This would be used to zoom in on a particular cluster. The rectangle corresponding to the map search could be visualized, too, it think. I'll add it to my list. We could also zoom into the search area when a saved search is activated, if we get the bounding-box issue solved. Mikolaj: No, I moved it between the crosshairs and the coordinate grid. But maybe it is okay to cover it when there is a cluster in the center. Bug, latest patch: I have two clusters in left panel, select one, enter preview mode. Browsing through this cluster. Change cluster with Ctrl+LMC. Blank screen. In such case I see two possible solutions: exit preview mode and show list of images from second cluster or immediately enter in preview mode with first image from second cluster shown. Mikolaj: Sorry, I don't understand what you are doing exactly. Can you post a few screenshots? I tried, but could not reproduce a blank screen. Which version of Marble do you have? It is not blank screen in Marble area but in main Album GUI. Created attachment 36669 [details]
bug with none image selected
digiKam is in preview mode, previously was selected cluster in lower right
with 4 images, now I selected with Ctrl+LMB cluster in lower left with 3
images. Images are visible in thumbnail list but nothing is shown in main
area.
Created attachment 36777 [details]
Map clustering, new version
new version:
- instant popup of map theme menu
- thumbnails for clusters with multiple images
- thumbnails configurable through map theme menu
- shows selected search area on the map
Question:
Should the map search by updated when the user deletes/moves/rates images? Currently it does not, and also the Timeline-search does not update, either.
Gilles:
We can show the selected search area now. It is stored as a rectangle internally, but when drawn on the map, it can look like a trapezoid depending on the projection. This might be confusing to some users, but I do not know a better solution.
Mikolaj:
Thanks for the new description and the screenshot, I understand the problem now. But I do not know yet how to solve it exactly. When not using geosearch, and you use the mime-type filter, and go for example from "JPEG Files" to "PNG Files" while in preview mode, the problem does not occur. I do not know yet where the clustering code's interaction with the filters is different for the mime-type code.
Arnd:
Does the preview of multiple images come close to what you suggested?
left to do:
- adjust indentation in markerclusterholder-files to digikam coding guidelines,
it was reset somehow
- find a way to set a bounding box on Marble
- update the map search when images in the database are changed
- solve problem with previewed images in the main view when clusters are changed
Michael, all this sounds brilliant, and pretty much like what I had in mind. To comment in a qualified way, I need to get the svn version working properly: after some fiddling around with CMakeLists.txt it compiles fine but currently I cannot change the map theme (using the new small button). As I am not sure if this was caused with my fiddling, I need to further investigate this before applying and testing your patch... Thanks a lot for your work, best Arnd >Gilles:
>We can show the selected search area now. It is stored as a rectangle
>internally, but when drawn on the map, it can look like a trapezoid depending
>on the projection. This might be confusing to some users, but I do not know a
>better solution.
Michael,
I have no idea exactly, but i'm sure that marblewidget has API for that.
I CC marble team (Patrick and Torsten) for more details.
Gilles Caulier
Tested latest patch and there is regression unfortunately: don't see image thumbnails in 1 item "clusters". (In reply to comment #27) > Tested latest patch and there is regression unfortunately: don't see image > thumbnails in 1 item "clusters". You can/have to use the configure the thumbnails through the map-settings menu now. I think the default setting is "off" for single-image thumbnails. Created attachment 37132 [details]
Map clustering, new version, zoom to cluster and speed-ups
new version:
- speedups, especially when selecting/filtering clusters. I have tested it with 6000 images. Filtering is a little slow, but moving/zooming is okay.
- zoom into a cluster using ctrl+rmb on a cluster. This is done by finding the bounding box of the cluster and zooming in on Marble until parts of the bounding box leave the visible area, and then zooming out once. Patch is only tested with Marble 0.8.1, I do not yet have a multiple-kde-versions compilation setup (advice appreciated!)
- new e-mail address on b.k.o in anticipation of an svn-account
left to do:
- adjust indentation in markerclusterholder-files to digikam coding guidelines,
it was reset somehow
- find a better way to set a bounding box on Marble
- update the map search when images in the database are changed
- solve problem with previewed images in the main view when clusters are
changed
Created attachment 37136 [details]
New version, make the map resizable
- added a QSplitter to make the map and the map searches resizable.
Created attachment 37174 [details]
New version, adapted to KDE 4.2.4
New version. Won the battle with the build-system and can now also test against KDE 4.2.4.
- fixes for compiling with KDE 4.2.4. Still no mouse-interaction with the clusters in 4.2.4
Michael, I recommend you to commit your code in trunk for next beta5. Do not close yet this file until all TODO points are not yet fixed... Patrick, Can you help Michael about Marble widget integration, especially how to set a bounding box ? Thanks in advance Gilles Caulier Gilles, I will commit it in the next few days. Michael SVN commit 1030300 by mghansen: Initial commit for clustering of markers support in the GPSSearch and the Geolocation tab. Known issues: - mouse interaction with clusters does not work with Marble<0.8 (KDE 4.2) - when the icon view is in view mode, changing the filtering can lead to no image being shown - the selection on the map is not necessarily shown as a rectangle - zooming into a cluster is a hack CCBUG: 205001 M +12 -0 CMakeLists.txt M +14 -0 digikam/digikamview.cpp M +22 -0 digikam/imagecategorizedview.cpp M +2 -0 digikam/imagecategorizedview.h M +1 -1 libs/CMakeLists.txt M +5 -0 libs/imageproperties/imagepropertiesgpstab.cpp A libs/imageproperties/markerclusterholder.cpp [License: GPL (v2+)] A libs/imageproperties/markerclusterholder.h [License: GPL (v2+)] A libs/imageproperties/markerclusterholderplugin (directory) A libs/imageproperties/markerclusterholderplugin/CMakeLists.txt A libs/imageproperties/markerclusterholderplugin/CheckPluginBuildable.cmake A libs/imageproperties/markerclusterholderplugin/MarbleMacros.cmake A libs/imageproperties/markerclusterholderplugin/externaldraw.cpp [License: GPL (v2+)] A libs/imageproperties/markerclusterholderplugin/externaldraw.h [License: GPL (v2+)] M +601 -55 libs/imageproperties/worldmapwidget.cpp M +38 -6 libs/imageproperties/worldmapwidget.h M +7 -0 libs/models/imagefiltermodel.cpp M +1 -0 libs/models/imagefiltermodel.h M +25 -0 libs/models/imagefiltersettings.cpp M +9 -0 libs/models/imagefiltersettings.h M +143 -18 utilities/gpssearch/gpssearchview.cpp M +14 -0 utilities/gpssearch/gpssearchview.h M +64 -2 utilities/gpssearch/gpssearchwidget.cpp M +2 -1 utilities/gpssearch/gpssearchwidget.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1030300 After this commit, digiKam fails to compile because of the conditional inclusion of markerclusterholder.h and the subsequent unconditional declaration of setCustomPaintFunction with MarkerClusterHolder::CustomPaintFunction. Error msg: In file included from /home/pieter/tmp/digikam-extrainfo/libs/imageproperties/imagepropertiesgpstab.h:40, from /home/pieter/tmp/digikam-extrainfo/libs/imageproperties/imagepropertiessidebar.cpp:58: /home/pieter/tmp/digikam-extrainfo/libs/imageproperties/worldmapwidget.h:118: error: expected ‘,’ or ‘...’ before ‘::’ token /home/pieter/tmp/digikam-extrainfo/libs/imageproperties/worldmapwidget.h:118: error: ISO C++ forbids declaration of ‘MarkerClusterHolder’ with no type Pieter, All compile fine there. Are you tried to clean up all before ? Gilles Caulier SVN commit 1030310 by mghansen: Fixes for compilation without Marble. CCBUG: 205001 M +2 -0 libs/imageproperties/worldmapwidget.cpp M +2 -0 libs/imageproperties/worldmapwidget.h M +2 -0 utilities/gpssearch/gpssearchwidget.cpp M +3 -1 utilities/gpssearch/gpssearchwidget.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1030310 After commit 1030315 (sorry, forgot the CCBUGS line) digiKam compiles fine without Marble. Michael, There is a specific reason to not wrap markerclusterholder.h/.cpp code in Digikam namespace ? Gilles Gilles, yes, I am currently using it for another application as well ( http://github.com/mghansen256/trippy/ ). But we can wrap it in the Digikam version. Michael SVN commit 1030612 by mghansen: Wrap markerclusterholder code in Digikam namespace CCBUG: 205001 M +6 -0 markerclusterholder.cpp M +16 -10 markerclusterholder.h M +24 -23 worldmapwidget.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1030612 SVN commit 1042259 by mghansen: Update clusters if the map is resized or the projection is changed. CCBUG: 205001 M +13 -4 markerclusterholder.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1042259 Revisiting the known issues: - mouse interaction with clusters does not work with Marble<0.8 (KDE 4.2) -> I could not figure it out, and since KDE4.4 is coming up it is not so much of a problem. - the selection on the map is not necessarily shown as a rectangle -> Patrick and I agreed that it is because of the way the earth is shaped, so leave it like it is. - zooming into a cluster is a hack -> We would have to dig deeper into the projection-code to write an alternative, and it works well anyway. - when the icon view is in view mode, changing the filtering can lead to no image being shown -> I can't reproduce this anymore in beta6. If no one protests, I would like to close this report. Michael SVN commit 1056299 by mghansen: Update news. BUG: 205001 M +2 -1 NEWS WebSVN link: http://websvn.kde.org/?view=rev&revision=1056299 |