Beispiel #1
0
                ox = int(xscale * (orig.longitude - min_lon))
                dy = height - int(yscale * (dest.latitude - min_lat))
                dx = int(xscale * (dest.longitude - min_lon))
                cv.Line(lines, (ox, oy), (dx, dy), (255), 1, cv.CV_AA)

        # save the lines
        cv.SaveImage(prefix + "raw_data.png", lines)
        print("done.")
        # print "Intensity map acquired."
        sys.stdout.write("Smoothing... ")
        sys.stdout.flush()

        # # create the mask and compute the contour
        cv.Smooth(themap, themap, cv.CV_GAUSSIAN, gaussian_blur, gaussian_blur)
        cv.SaveImage(prefix + "kde.png", themap)

        print("done.")
        print("\nKDE generation complete.")


if __name__ == '__main__':

    k = KDE()
    trips = TripLoader.load_all_trips_from_db("2019-00-01", "2019-08-01")
    k.create_kde_with_trips(trips, 20, 17)

    # trips_path="../trips"
    # prefix="../temp_20190000-20190500-20200000/"
    # trips = TripLoader.load_all_trips(trips_path)
    # k.create_kde_with_trips(trips, 1,17)