ni1o1 / transbigdata

A Python package develop for transportation spatio-temporal big data processing, analysis and visualization.
https://transbigdata.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
459 stars 115 forks source link

Example 1-Taxi GPS data processing 运行失败 #44

Closed java2python closed 2 years ago

java2python commented 2 years ago

运行到5大步骤: Aggregate OD into polygons 出错

# Aggragate OD data to polygons 
# without passing gridding parameters, the algorithm will map the data 
# to polygons directly using their coordinates
od_gdf = tbd.odagg_shape(oddata, sz, round_accuracy=6)
fig = plt.figure(1, (16, 6), dpi=150) # 确定图形高为6,宽为8;图形清晰度
ax1 = plt.subplot(111)
od_gdf.plot(ax=ax1, column='count')
plt.xticks([], fontsize=10)
plt.yticks([], fontsize=10)
plt.title('OD Trips', fontsize=12);

报错信息: ImportError: Spatial indexes require either rtree or pygeos. See installation instructions at https://geopandas.org/install.html

版本:

Package                           Version
--------------------------------- -----------
appnope                           0.1.2
argon2-cffi                       21.1.0
attrs                             21.2.0
backcall                          0.2.0
bleach                            4.1.0
blis                              0.7.7
catalogue                         2.0.7
certifi                           2021.10.8
cffi                              1.15.0
chardet                           4.0.0
click                             8.0.4
click-plugins                     1.1.1
cligj                             0.7.2
commonmark                        0.9.1
cycler                            0.11.0
cymem                             2.0.6
d2l                               0.17.3
debugpy                           1.5.1
decorator                         5.1.0
defusedxml                        0.7.1
entrypoints                       0.3
filelock                          3.6.0
Fiona                             1.8.21
geopandas                         0.10.2
huggingface-hub                   0.5.1
idna                              2.10
ipykernel                         6.4.2
ipython                           7.29.0
ipython-genutils                  0.2.0
ipywidgets                        7.6.5
jedi                              0.18.0
jellyfish                         0.9.0
Jinja2                            3.0.2
joblib                            1.1.0
jsonschema                        4.1.2
jupyter                           1.0.0
jupyter-client                    7.0.6
jupyter-console                   6.4.0
jupyter-contrib-core              0.3.3
jupyter-contrib-nbextensions      0.5.1
jupyter-core                      4.9.1
jupyter-highlight-selected-word   0.2.0
jupyter-latex-envs                1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyterlab-pygments               0.1.2
jupyterlab-widgets                1.0.2
keplergl                          0.3.2
keybert                           0.5.1
kiwisolver                        1.3.2
langcodes                         3.3.0
lxml                              4.8.0
mapclassify                       2.4.3
MarkupSafe                        2.0.1
matplotlib                        3.3.3
matplotlib-inline                 0.1.3
mistune                           0.8.4
multi-rake                        0.0.2
munch                             2.5.0
murmurhash                        1.0.6
nbclient                          0.5.4
nbconvert                         6.2.0
nbformat                          5.1.3
nest-asyncio                      1.5.1
networkx                          2.8
nltk                              3.7
notebook                          6.4.5
numpy                             1.18.5
packaging                         21.2
pandas                            1.2.2
pandocfilters                     1.5.0
parso                             0.8.2
pathy                             0.6.1
pexpect                           4.8.0
pickleshare                       0.7.5
Pillow                            8.4.0
pip                               22.0.4
plot-map                          0.3.7
preshed                           3.0.6
prometheus-client                 0.12.0
prompt-toolkit                    3.0.21
ptyprocess                        0.7.0
pycld2                            0.41
pycparser                         2.20
pydantic                          1.8.2
Pygments                          2.10.0
pyparsing                         2.4.7
pyproj                            3.3.1
pyrsistent                        0.18.0
python-dateutil                   2.8.2
pytz                              2021.3
PyYAML                            6.0
pyzmq                             22.3.0
qtconsole                         5.1.1
QtPy                              1.11.2
regex                             2022.3.15
requests                          2.25.1
rich                              12.2.0
sacremoses                        0.0.49
scikit-learn                      1.0.1
scipy                             1.7.2
segtok                            1.5.11
Send2Trash                        1.8.0
sentence-transformers             2.2.0
sentencepiece                     0.1.96
setuptools                        56.0.0
Shapely                           1.8.1.post1
six                               1.16.0
sklearn                           0.0
smart-open                        5.2.1
spacy                             3.2.4
spacy-legacy                      3.0.9
spacy-loggers                     1.0.2
srsly                             2.4.2
summa                             1.2.0
tabulate                          0.8.9
terminado                         0.12.1
testpath                          0.5.0
thinc                             8.0.15
threadpoolctl                     3.0.0
tokenizers                        0.12.1
torch                             1.8.1
torchvision                       0.9.1
tornado                           6.1
tqdm                              4.64.0
traitlets                         5.1.1
traittypes                        0.2.1
transbigdata                      0.4.5
transformers                      4.18.0
treelite                          2.2.2
treelite-runtime                  2.2.2
typer                             0.4.1
typing_extensions                 4.1.1
urllib3                           1.26.8
wasabi                            0.9.1
wcwidth                           0.2.5
webencodings                      0.5.1
widgetsnbextension                3.5.2
xgboost                           1.5.2
yake                              0.4.8
java2python commented 2 years ago

另外咱们有学习群吗? 是否可以加一下?

ni1o1 commented 2 years ago

需要安装rtree,参考https://stackoverflow.com/questions/67021748/importerror-spatial-indexes-require-either-rtree-or-pygeos-in-geopanda-but

java2python commented 2 years ago

安装rtree,然后重启,运行,解决了,谢谢。