View Single Post
Posts: 2,000 | Thanked: 3,345 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#1055
Originally Posted by MartinK View Post
I think I'll just do it with elevation on the third place, to make the design cleaner and more future proof:
Code:
lat;lon;elevation;distance;enabled;name;alert
If elevation is empty, modRana would count the distance in 2D, if it is filled in, it would count the distance in 3D.
Good idea.
Originally Posted by MartinK View Post
Good idea ! You are right that the labels are not really usable at low zoomlevels and this handles the issue quite nicely.

Another possible, but more complicated future solution, would be to group nearby markers and just show a single marker with the label displaying the number of markers in the group. Clicking the label would show a list of the grouped marker or something similar.
Thank you. What about adding to each POI (or to each category of POI) additional options, such as zoom levels, or speed levels, or distance from POI, at which they will be displayed? Then some POIs, like bus stop, or bench, or shop, will disappear if you zoom out and look at the country, not at the city.

Originally Posted by MartinK View Post
Well, why not.

It would be good to add and "icon" column to the database so that POIs can have both an icon and a full description, but this should work in the meantime.
I was just a bit bored that all the different POI have the same appearance.
Originally Posted by MartinK View Post
Oh, I've finally got it ! Like this, you know how accessible the points are from your position, with you current speed ? Nice idea !
It's probably nice, but it's a bit confusing, and requires adding some options into the interface.
Originally Posted by MartinK View Post
Unfortunately yes, modRana just draws all points that were designated as visible, even if they are outside of the viewport. Also, I think the most costly is actually not the drawing but the calculations needed to compute the screen coordinates from the geographic ones and the distance, which currently happen every time the screen is redrawn.

Therefore, just looking what points should be visible doesn't help as you still have to iterate over all the points and check if they are visible, would not help due to all the unnecessary comparisons and coordinate conversions.
Well, if the viewport is remembered somewhere in geographic coordinates, it's possible to compare POI with viewport without converting geocoordinates of POI into screen coordinates. But I see the point: it's better not to have POI visible until it's needed, because the computations will be happening either way.
Originally Posted by MartinK View Post
Of course, there is place for optimizations (the basic idea is to somehow reduce the number of points you have to work with at a time), the first one from the top of my head :
  • calculate the bounding box of the current viewport in screen coordinates (I think a bounding box represented by geographic coordinates might not actually be a rectangle)
  • then calculate a "border" bounding box, say 2x times larger
  • check what markers are in the "border" bounding box
  • as long as the viewport bounding box is inside the "border" bounding box, you can ignore markers that are outside
  • once you detect that the viewport bounding box is outside of the "border" bounding box, you recalculate a new "border" bounding box and check what markers are contained within

I'm sure there are also other ways how to optimize this.
Interesting idea. Is it possible to somehow make it so that POIs are redrawn only when the map is dragged, not every second?

Originally Posted by MartinK View Post
I don't understand what you mean, can can you clarify ?
Well... I meant that there might be only one-two-four POIs in the viewport, and about forty-fifty POIs altogether (visible, but outside the viewport), and redrawing all the POIs, even outside the viewport, sounds excessive.
Originally Posted by MartinK View Post
I'm using it for quite some time already, without issues. Still, I remember the Saera developer mentioning some issues with the camera UI in CSSU.

Anyway, thanks for the changes ! I'll check them out & integrate them to the upstream source code in the coming days.
Thank you for replying. But don't integrate everything, or the program might bloat... It's not an actually useful or necessary feature, except for hiding the POIs labels.

If the conversion of geo coordinates into screen coordinates depends only on zoom, and not on current position/viewport, then screen coordinates could be permanently stored within POI, changed only when POI's geo coordinates are changed, and retrieved from here when POI is drawn, instead of being recalculated each time.
 

The Following 3 Users Say Thank You to Wikiwide For This Useful Post: