Bug 178911 - map search returns photos from what you see on the map and not the area you select
Summary: map search returns photos from what you see on the map and not the area you s...
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Torsten Rahn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-27 19:27 UTC by Salvatore Brigaglia
Modified: 2009-01-01 19:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
return the right latlonbox (3.28 KB, patch)
2008-12-29 16:07 UTC, Arnd Baecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Brigaglia 2008-12-27 19:27:24 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

The map search is supposed to return pictures taken on the area you select using CTRL + mouse drag. You can select an area doing so but pictures found as a resuld are from the entire map visualized at the moment you performed the search.
e.g.:
I have pictures taken in annecy (France) and winchester (England). If i perform a search in the area of london when the entire europe is visualized also pictures from annecy are visualized as result.
If i zoom in to see only great britain and perform a search oved Belfast, pictures from winchester are visualized as result.
Comment 1 Arnd Baecker 2008-12-29 12:12:18 UTC
I also observe this behaviour.
On the konsole I get for different selection regions:

Selection region: ( 120 ,  123 ) ( 202 ,  191 )
West:  8.88512  North:  57.8784  East:  11.2337  South:  56.5583

Selection region: ( 18 ,  6 ) ( 226 ,  247 )
West:  8.88512  North:  57.8784  East:  11.2337  South:  56.5583

Ie, the lat-lon-box corresponds to the entire visible region.

This output comes from marble, where the conversion from 
the selection region should be performed in 
void MarbleWidget::setSelection(const QRect& region)

Looking at the code, d->m_map->viewParams()->viewport()
is used and the selected region (region.topLeft(), region.bottomRight() )
is not used.

So IMO, this bug should be transferred to marble.
Comment 2 Patrick Spendrin 2008-12-29 14:41:42 UTC
this bug is due to AbstractProjection::latLonAltBox() not using the QRegion parameter. I transfer this to marble because of that.
Comment 3 Arnd Baecker 2008-12-29 16:07:39 UTC
Created attachment 29729 [details]
return the right latlonbox

The attached patch tries to return the right lat-lon-box for 
a selection with the mouse.
With this the geographical search from within digikam 
seems to work correctly.

As GeoDataLatLonAltBox AbstractProjection::latLonAltBox 
appears to be called also on other occasions, the patch needs 
review (especially, because on block of code has to be commented out).
Comment 4 Torsten Rahn 2008-12-29 19:21:31 UTC
Great. Next to the Oxygen style thing (now fixed -- at least with KDE 4.2) this was the other remaining bug remaining from the previous "big" one.

And yes I think this patch brings us closer to the "real" solution. Without looking at the whole issue closely I think that (IIRC) the whole algorithm uses the center point of the screen and the related coordinates as a reference point for the selected region. Arnd: could you check this? (I'm not entirely sure, so I might be wrong about it)

Otherwise: feel free to commit this patch and thanks for taking care of the issue! :-)
Comment 5 Arnd Baecker 2009-01-01 19:57:25 UTC
Updated patch has been committed to svn:
r904264 marble/trunk/KDE/kdeedu/marble/src/lib/Projection/AbstractProjection.cpp: Make latLonAltBox respect the given screen region.
(Thanks to Torsten and Patrick for their help!).

With this the original issue, that the selected rectangular region
is not respected for a geo-search in digikam, appears solved
(i.e. I mark this bug as fixed).