Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. longlatCmorn = np.array([p[0] + p[-1] for p in dataCmorn['POLYLINE'] if len(p)>1])
  2.  
  3. bins = 1000
  4. lat_min, lat_max = 41.04961, 41.24961
  5. lon_min, lon_max = -8.71099, -8.51099
  6. # create image
  7. #bins = 513
  8. lat_bins = np.linspace(lat_min, lat_max, bins)
  9. lon_bins = np.linspace(lon_min, lon_max, bins)
  10. H2start, _, _ = np.histogram2d(longlatCmorn[:,1], longlatCmorn[:,0], bins=(lat_bins, lon_bins))
  11. H2stop, _, _ = np.histogram2d(longlatCmorn[:,3], longlatCmorn[:,2], bins=(lat_bins, lon_bins))
  12.  
  13. imgStartmorn = np.log(H2start[::-1, :] + 1)
  14. imgStopmorn = np.log(H2stop[::-1, :] + 1)
  15.  
  16. plt.figure()
  17. ax = plt.subplot(1,1,1)
  18. plt.imshow(imgStartmorn)
  19. plt.axis('off')
  20. plt.title('Taxi trip start points morn (typeC6d5m)')
  21. plt.savefig("taxi_trip_startstypeC6d5mmorn.png")
  22. plt.figure()
  23. ax = plt.subplot(1,1,1)
  24. plt.imshow(imgStopmorn)
  25. plt.axis('off')
  26. plt.title('Taxi trip end points morn(typeC6d5m)')
  27. plt.savefig("taxi_trip_endstypeC6d5mmorn.png")
  28.  
  29. gmap.plot(longlatCmorn[:,1], longlatCmorn[:,0], 'cornflowerblue', edge_width=10)
  30.  
  31. gmap.draw("my_map.html")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement