示例#1
0
 def test(self):
     wp = [(53.477084, 10.259286, 50.22897338867188),
           (53.478151, 10.238244, 5.319664478302002),
           (53.479974, 10.225083, 2.908063411712646),
           (53.483188, 10.213013, 4.66163969039917)]
     route = create_route(wp, 50, 0, 0)
     for elem in route:
         print(precise_coordinate_string(elem))
     route = create_route(wp, 50, 50, 0)
     for elem in route:
         print(precise_coordinate_string(elem))
     route = create_route(wp, 50, 100, 0)
     for elem in route:
         print(precise_coordinate_string(elem))
示例#2
0
def location_string(pos):
    return "(" + precise_coordinate_string(pos) + ")"
示例#3
0
def xp_stop_string(xp_tuple):
    stops = "[" + ", ".join([stop_node(x) for x in xp_tuple[1]]) + "]"

    return "((" + precise_coordinate_string(xp_tuple[0]) + "), " + stops + ")"
示例#4
0
def stop_string(combined):
    return "((" + precise_coordinate_string(
        combined[0]) + "),(" + full_precision_coordinate_string(
            combined[1].coords) + "," + repr(combined[1].id) + ")," + str(
                combined[2]) + ")"
示例#5
0
                chunk_stuff.append(req)
        for xtra in optionals:
            if len(chunk_stuff) >= items_per_box:
                break
            if is_inside_box(xtra[0], chunk):
                chunk_stuff.append(xtra)
        reverse_it = (int(chunk_num / grid_size) % 2) == 1
        eastwest = sorted(chunk_stuff,
                          key=lambda item: item[0][1],
                          reverse=reverse_it)
        result += eastwest
    return result


initial_gpx = """
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0">
	<name>Example gpx</name>
	<trk><name>Example gpx</name><number>1</number><trkseg>
"""

post_gpx = """
	</trkseg></trk>
</gpx>
"""

if __name__ == "__main__":
    hbg = routes_p1.get("hamburg")
    for route_elem in hbg:
        print str(precise_coordinate_string(route_elem[0]))
示例#6
0
def as_3d_coord_array(coordinates):
    return "[" + ", ".join(
        ["(" + precise_coordinate_string(x[0]) + ")"
         for x in coordinates]) + "]"
示例#7
0
    for poke_stop in points:
        intersected = poke_stop.collected_neighbours()
        if len(intersected) > 2:
            print("{},{}".format(str(poke_stop.coords[0]), str(poke_stop.coords[1])))


if __name__ == "__main__":
    print("Loading stops")
    fences_to_use = get_geofences(args.geofence, args.fencename)
    stops_to_check = fences_to_use.filter_forts(pokestops())
    log.info("There are {} stops within fence".format(str(len(stops_to_check))))
    add_altitudes(stops_to_check)

    #for pokestop in stops_to_check:
    #    db_delete_pokestop(pokestop["pokestop_id"])

    point_list = create_pokestops(stops_to_check)

    update_distances(point_list, radius=39)

    print_gmaps_coordinates(point_list)
    result_coords = find_largest_groups(point_list)
    arranged = sort_by_distance(result_coords)

    msg = "["
    for coord in arranged:
        stop_list = [(x.coords[0],x.coords[1],x.coords[2], x.id) for x in coord[1]]
        msg += "((" + precise_coordinate_string(coord[0]) + "), " + str(stop_list) + "),\n"
    print("Traversal route for all pokestops")
    print(msg + "]")