NYC Taxi Example Slightly Reworked but inoperable
See original GitHub issueCan you tell me if this is a coding problem or an issue? I seem to always have my heat map show up near NULL Island. I figured it was a projection problem, so tried to work this per the gv.Points method as well and reproject the data (like some NYC taxi examples). Have I misapplied the code or did I find a new projection issue? Thanks.
import param, parambokeh
from colorcet import cm_n
from holoviews.streams import RangeXY
from bokeh.tile_providers import STAMEN_TONER
#url='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{X}/{Y}.jpg'
#url='https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}.png'
#url='http://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png'
url=STAMEN_TONER
tiles = gv.WMTS(url,crs=crs.GOOGLE_MERCATOR)
opts = dict(width=1000,height=600,xaxis=None,yaxis=None,bgcolor='black',show_grid=False)
class AirTraffic(hv.streams.Stream):
alpha = param.Magnitude(default=0.75, doc="Alpha value for the map opacity")
colormap = param.ObjectSelector(default=cm_n["fire"], objects=cm_n.values())
def make_view(self, x_range, y_range, **kwargs):
map_tiles = tiles.options(alpha=self.alpha, **opts)
points = hv.Points(ddf, ['lon', 'lat'])
taxi_trips = datashade(points, cmap=self.colormap,
dynamic=False, x_range=x_range, y_range=y_range, width=1000, height=600)
return map_tiles * taxi_trips
explorer = AirTraffic(name="Russell Traffic")
parambokeh.Widgets(explorer, callback=explorer.event)
hv.DynamicMap(explorer.make_view, streams=[explorer, RangeXY()])
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Taxi Complaint · NYC311 - NYC.gov
Route complaints; Being discourteous or rude; Not displaying a license, or displaying someone else's license; A dirty condition or bad odor in the...
Read more >Analyzing 1.1 Billion NYC Taxi and Uber Trips, with a ...
The New York City Taxi & Limousine Commission has released a staggeringly detailed historical dataset covering over 1.1 billion individual ...
Read more >Grand Theft Auto III - Wikipedia
Set within the fictional Liberty City (loosely based on New York City), the story follows Claude, a silent protagonist who, after being betrayed...
Read more >New York taxi details can be extracted from anonymised data ...
FoI request reveals data on 173m individual trips in US city - but could yield more details, such as drivers' addresses and income....
Read more >Alleged Nintendo gigaleak reveals eye opening prototypes for ...
There's also this slightly broken Super Mario Kart build with no ... Manage cookie settings No idea but source code is personal -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would suggest projecting the points ahead of time, with:
and then datashade that.
Hi Tyler! Based on your plot above, datashader does seem like what your data deserves; just about any other way of showing that data will obscure all the detail that you can see there.
Ordinarily, the tiles shouldn’t affect the display speed measurably. But the tiles only support one projection (Web Mercator), and so if you overlay on tiles then your points have to be reprojected (expensively) before datashader can do its aggregations, every time you compute a plot. So for interactive use you should probably project your points all at once, making subsequent datashading on a tile background much quicker. @philippjfr can probably suggest a more convenient way, but what I use for reprojecting is the simple
lnglat_to_meters()
function in datashader.util.