Package sabx10 :: Package osm :: Module zoom
[hide private]
[frames] | no frames]

Module zoom

source code

Handle zoom levels for stops, pois, and turns. It turns out that all three are sufficiently similar that they can be processed generically.

Classes [hide private]
  ZoomItem
Item referencing several non-zoomed items.
Functions [hide private]
 
find_close_item(item_list, check_item, dist)
Find the first item in item_list closer to the check_item than dist.
source code
 
get_zoom_items(items, dist, node_id)
Generate a "compacted" list of items based on a full item list.
source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

find_close_item(item_list, check_item, dist)

source code 

Find the first item in item_list closer to the check_item than dist.

Parameters:
  • item_list (list of Point) - list of Point items to check
  • check_item (Point) - Point to check against
  • dist (float) - threshhold distance to check for

get_zoom_items(items, dist, node_id)

source code 

Generate a "compacted" list of items based on a full item list. This finds all items that are close to eachother, within a distance of "dist", and creates one item that references all of the close items. This is good when a map would show a bunch of hard-to-read overlapping items at a spot, but will now show one single item instead.

Parameters:
  • items (list of Point items) - list of items to compact
  • dist (float) - threshold distance between items
  • node_id (NodeId) - NodeId object to get ids for zoomed items