Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- longlatCmorn = np.array([p[0] + p[-1] for p in dataCmorn['POLYLINE'] if len(p)>1])
- bins = 1000
- lat_min, lat_max = 41.04961, 41.24961
- lon_min, lon_max = -8.71099, -8.51099
- # create image
- #bins = 513
- lat_bins = np.linspace(lat_min, lat_max, bins)
- lon_bins = np.linspace(lon_min, lon_max, bins)
- H2start, _, _ = np.histogram2d(longlatCmorn[:,1], longlatCmorn[:,0], bins=(lat_bins, lon_bins))
- H2stop, _, _ = np.histogram2d(longlatCmorn[:,3], longlatCmorn[:,2], bins=(lat_bins, lon_bins))
- imgStartmorn = np.log(H2start[::-1, :] + 1)
- imgStopmorn = np.log(H2stop[::-1, :] + 1)
- plt.figure()
- ax = plt.subplot(1,1,1)
- plt.imshow(imgStartmorn)
- plt.axis('off')
- plt.title('Taxi trip start points morn (typeC6d5m)')
- plt.savefig("taxi_trip_startstypeC6d5mmorn.png")
- plt.figure()
- ax = plt.subplot(1,1,1)
- plt.imshow(imgStopmorn)
- plt.axis('off')
- plt.title('Taxi trip end points morn(typeC6d5m)')
- plt.savefig("taxi_trip_endstypeC6d5mmorn.png")
- gmap.plot(longlatCmorn[:,1], longlatCmorn[:,0], 'cornflowerblue', edge_width=10)
- gmap.draw("my_map.html")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement