Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key error "stops" in gtfs-parser, even target folder looks not missing stops.txt #75

Closed
bordoray opened this issue Jan 25, 2024 · 6 comments

Comments

@bordoray
Copy link

bordoray commented Jan 25, 2024

今日はQGISのGTFS-GO拡張機能の使用に関するお助けをお願いしたく思います。現在、ファイルの処理中に問題が発生しています。提供されたフォルダが完全ではないというエラーメッセージが表示されており、これまでアプリケーションを使用する際にこの問題に遭遇したことはありませんでした。
この問題を解決する手助けをいただけますでしょうか?以下が私が受け取っているエラーメッセージです:

[エラーメッセージをこちらに挿入]
どのような情報でも大変助かります。お手数をおかけしますが、よろしくお願いいたします。

2024-01-03T15:05:46     WARNING    Traceback (most recent call last):
line 239, in execution
             gtfs = gtfs_parser.GTFS(extracted_dir)
             File "C:Users/I46674/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsGTFS-GO-mastergtfs_parsergtfs_parsergtfs.py", line 20, in GTFS
             tables["stops"] = tables["stops"].astype({"stop_lon": float, "stop_lat": float})
            KeyError: 'stops'

Cela m'indique que le dossier fourni n'est pas complet, bien qu'il le soit.
Je n'avais jamais rencontré ce problème auparavant lors de l'utilisation de cette application.
Pouvez-vous m'aider à résoudre ce problème ? Voici le message d'erreur que j'obtiens :

2024-01-03T15:05:46     WARNING    Traceback (most recent call last):
line 239, in execution
             gtfs = gtfs_parser.GTFS(extracted_dir)
             File "C:Users/I46674/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsGTFS-GO-mastergtfs_parsergtfs_parsergtfs.py", line 20, in GTFS
             tables["stops"] = tables["stops"].astype({"stop_lon": float, "stop_lat": float})
            KeyError: 'stops'

Merci à tous pour vos conseils.

@bordoray bordoray changed the title Key error "stops", even target folder looks not missing stops.txt Key error "stops" in gtfs-parser, even target folder looks not missing stops.txt Jan 25, 2024
@partytax
Copy link

partytax commented Apr 16, 2024

I have the same issue. Believe it may be related to the way the plugin is extracting files from the zip archive. When I look at the folder it creates, it's empty. If I extract manually, it is full of standard GTFS files for stops, routes, etc.

Error

2024-04-16T11:05:16     WARNING    Traceback (most recent call last):
              File "/home/nathan/.local/share/QGIS/QGIS3/profiles/Nathan/python/plugins/GTFS-GO-master/gtfs_go_dialog.py", line 239, in execution
              gtfs = gtfs_parser.GTFS(extracted_dir)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/home/nathan/.local/share/QGIS/QGIS3/profiles/Nathan/python/plugins/GTFS-GO-master/gtfs_parser/gtfs_parser/gtfs.py", line 20, in GTFS
              tables["stops"] = tables["stops"].astype({"stop_lon": float, "stop_lat": float})
              ~~~~~~^^^^^^^^^
             KeyError: 'stops'

File

GTFS_GLTC.zip

Versions


QGIS version
3.22.16-Białowieża
QGIS code branch
Release 3.22
Qt version
5.15.8
Python version
3.11.1
GDAL/OGR version
3.6.2
PROJ version
9.1.1
EPSG Registry database version
v10.076 (2022-08-31)
GEOS version
3.11.1-CAPI-1.17.1
SQLite version
3.40.1
PostgreSQL client version
15.1 (Debian 15.1-1+b1)
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.13.3
OS version
Devuan GNU/Linux 5 (daedalus)




Active Python plugins
QuickOSM
2.2.3
Qgis2threejs
2.7.3
GTFS-GO-master
3.2.2
MetaSearch
0.3.5
processing
2.12.99
sagaprovider
2.12.99
db_manager
0.1.20
grassprovider
2.12.99

@partytax
Copy link

On further inspection, it appears that GTFS zip archive contents are being successfully extracted to a location in /tmp and that location is provided to the GTFS parser. Looking into GTFS parser now.

@partytax
Copy link

@bordoray

Votre fichier zip GTFS contient-il un deuxième dossier contenant les fichiers txt ?

Lorsque j'ai apporté quelques modifications rapides au script du plugin pour inclure le nom du deuxième dossier, le plugin a bien fonctionné.

Je dois déterminer si la société de transport de ma ville a mal emballé les données GTFS. Si c'est le cas, ce plugin n'a peut-être pas besoin d'être corrigé.

Jusqu'à ce que nous ayons trouvé la solution, vous pouvez envisager d'extraire le fichier zip manuellement, de récupérer les fichiers txt dans le deuxième dossier et de le zipper.

@partytax
Copy link

https://gtfs.org/schedule/reference/#file-requirements

"All dataset files must be zipped together. The files must reside at the root level directly, not in a subfolder."

Traduction de l'anglais vers le français:
Tous les fichiers de l'ensemble de données doivent être compressés ensemble. Les fichiers doivent résider directement au niveau de la racine, et non dans un sous-dossier.

@bordoray
Copy link
Author

bordoray commented May 8, 2024

@partytax Thanks for checked it !
This issue came from another user, I will follow your comment to him.

@Kanahiro
Copy link
Member

Kanahiro commented May 8, 2024

fixed on v4.0.0

@Kanahiro Kanahiro closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants