1

I am accessing the twitter streaming API. I generate a map using Basemap in python. I want only certain parts of the map to change with time (for eg. every second). Is it hard to do? Do I need to leave Basemap and look for something else? Please help!

4

2 回答 2

1

You can send an ajax request and update the html contents dynamically.

于 2012-06-18T02:45:54.370 回答
1

一种可能的做法:将地图分成瓦片,分别对待;使用 Basemap 仅生成包含新数据的地图图块,然后使用 Ajax 仅更新网页上的该图块。

当然,根据地图上数据更改的性质,这种方法可能适合您,也可能不适合您——gerrymandering 是不可能的。

您需要编写逻辑来了解新数据属于哪个切片,然后使用底图为该时间创建一个新图像,然后智能更新切片图像。您还必须使用边距和填充(在 matplotlib 和 CSS 中)来干净地将瓷砖拼凑在一起。

...

当方法变得如此复杂时,应该重新评估是否有更好的工具可用。底图听起来不太适合您需要做的事情。

于 2012-06-19T03:00:07.893 回答