Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better distribution on thumbnails on the map #14

Open
mnalis opened this issue Nov 22, 2009 · 5 comments
Open

Better distribution on thumbnails on the map #14

mnalis opened this issue Nov 22, 2009 · 5 comments

Comments

@mnalis
Copy link

mnalis commented Nov 22, 2009

When you look at the map at specified zoomlevel, the OSV does not display all of the thumbnails, but just a limited number of them. It is quite ok, but the problem is that it currently just gets first xxx thumbnails in that area or something, which results in very uneven display.
(question: is that the work of find_in_area(bbox) function in photo.rb ?)

For example, if you zoom to Europe, you will see OSV load and display bunch of thumbnails (at approximately the same location) in England, and another bunch in Ireland (probably because there where the first inserted in the database) and none of the thumbnails in Czech or Croatia or other countries that have pictures.

That leads to quite a wrong perception of where there are pictures (and where there are not), and unless user knows where exactly (s)he has to blindly zoom to "empty space" to see pictures there, (s)he will never see them.

the thumbnail selection code should be modified so it avoids thumbnails that would render at (almost) the same location, and prefers those which are more distanced from those already selected for display.

That would not only help with displaying picture distribution more fairly and allowing people to see where the database contains pictures, but would also help with loading less thumbnails in bigger views (for example, when viewing Europe, it could get away with 10 thumbnails in mostly various countries; instead of loading hundred of thumbnails all in the exact same location).

@johnmckerrell
Copy link
Owner

Yes this would relate to the "find_in_area" call. That was designed so that it could be called from an application which would then return each page of results that it needed, but I do agree that some mechanism to get more spread out results would be better.

@mnalis
Copy link
Author

mnalis commented Nov 22, 2009

ok, I've tried doing something, you can (I hope) pull it from http://github.com/mnalis/OpenStreetView

Few things:

  • I am not ruby / rails programmer at all. Just C and perl and few random stuff. So it probably shows. For example, for ":group" i do string concat instead of (more nicely) using "?" like you did for ":conditions" (it does not seem to work in the same way, and this one worked, so I didn't break my head too much :-)
  • the 400/300 constants are not really scientific. We could define exact number of pixels using browser map resolution in pixels, but I do not think it is really that important - the idea was to show the thumbnails if they are spaced more than a few (for some subjective value of few) pixels away on current map resolution. The difference between low 800x600 and high 1920x1280 is not that much anyway, few pixels here or there. We may want to make them even smaller if we prefer less thumbnail overlap.
  • I find it nicer (and more dynamic as time goes) to show last few pictures entered (instead of static "first few"), so I modified that as well.
  • It seems to work on my (very small in amount of pictures, though) test server, but you may want to check and improve it...

Phew, much more text explaining than actual code :-)

@johnmckerrell
Copy link
Owner

I have finally pushed this out, sorry for the delay partly I wasn't sure how to merge it in but it seemed almost worryingly easy. Though it works really well on the whole world view as I zoom into the UK it's not showing anything until just the UK is visible so I'm definitely going to have to take a look at improving it but it's definitely better than what we had before. I'll make a small revision to make this output an option rather than the default but it's good to have, thanks!

@mnalis
Copy link
Author

mnalis commented Dec 6, 2009

Is it showing nothing at all, or just nothing in the UK region ? can you send me Permalink (and what resolution you're running) ?

Now that you've put it up I've seen a behaviour for example on http://openstreetview.org/?lat=52.560099201479&lon=15.362899302788&zoom=4 (at 1024x768) when it shows neighbouring countries, but not UK.

That issue looks like it's because that it sorts by date (descending), and stops when it hits the limit of 100 pictures, the oldest photos (which happen to be in UK) will not be displayed.

Could you perhaps send me a SQL dump of photos table ? I'm having just a few dozen geolocated pictures (and all from Croatia at that) on my test site, which makes it hard to test/fix :(

@johnmckerrell
Copy link
Owner

Nothing on the UK but stuff elsewhere, yes it sounds like it's the order by date part as you say but if the images were a bit more spaced out that wouldn't be such an issue. Here's a URL though I guess it won't work on your screen as yours didn't work on mine:

http://openstreetview.org/?lat=53.196598259124&lon=-6.4779210088407&zoom=5

It's probably largely just down to tweaking the parameters a bit. I'll have a look at doing a database dump tomorrow.

dasty added a commit to dasty/OpenStreetView that referenced this issue Jan 16, 2013
Changing size of grouping rectangle, so exactly FIND_IN_AREA_LIMIT fits
on the screen.

Signed-off-by: Radek Dostal <rd@radekdostal.com>
dasty added a commit to dasty/OpenStreetView that referenced this issue Jan 16, 2013
Changing size of grouping rectangle, so exactly FIND_IN_AREA_LIMIT fits
on the screen.

Signed-off-by: Radek Dostal <rd@radekdostal.com>
dasty added a commit to dasty/OpenStreetView that referenced this issue Jan 21, 2013
Only apply group if amount of amount of returned pictures would be
bigger than FIND_IN_AREA_LIMIT

Signed-off-by: Radek Dostal <rd@radekdostal.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants