def _calculate_image_size(bbox, zoom_level):
     meters_per_pixel = geo_helper.meters_per_pixel(zoom_level, bbox.bottom)
     width_meter = bbox.node_left_down().get_distance_in_meter(bbox.node_right_down())
     height_meter = bbox.node_left_down().get_distance_in_meter(bbox.node_left_up())
     height = int(height_meter / meters_per_pixel)
     width = int(width_meter / meters_per_pixel)
     return width, height
Esempio n. 2
0
 def _calculate_image_size(bbox, zoom_level):
     meters_per_pixel = geo_helper.meters_per_pixel(zoom_level, bbox.bottom)
     width_meter = bbox.node_left_down().get_distance_in_meter(bbox.node_right_down())
     height_meter = bbox.node_left_down().get_distance_in_meter(bbox.node_left_up())
     height = int(height_meter / meters_per_pixel)
     width = int(width_meter / meters_per_pixel)
     return width, height
Esempio n. 3
0
def test_meter_to_pixel(node1):
    meter_per_pixel = geo_helper.meters_per_pixel(19, node1.latitude)
    assert meter_per_pixel > 0