Deprecated OpenMobility Replaced With Mobility Database #2631
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#2631
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "gtfs-source-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Open Mobility Data is no longer regularly updated/maintained and its API will soon be depreciated. It is the perfect time to replace it with its modified GTFS-feeds aggregator, Mobility Database. Updated the current code to support Mobility Database.
Signed-off-by: Fardeen Faisal fardeenfaisal.fs@gmail.com
@ -4,3 +4,4 @@
- Mobility Database (https://mobilitydata.org/)
Crawls all the urls, loads feed zips and extracts to the specified directory."""
import argparse
You use Pandas lib to parse CSV file. It adds extra dependency. While there is default Python 3 library csv.
@ -12,3 +13,4 @@
import csv
import time
import zipfile
Why do you use short URL instead of a full URL
https://storage.googleapis.com/storage/v1/b/mdb-csv/o/sources.csv?alt=media
?@pastk can you please also take a look, as a python-expert? :)
@ -12,3 +13,4 @@
import csv
import time
import zipfile
The link to the CSV file on their website used a link shortener.
The link target could potentially change when they go from v1 to say v2. The link shortener's target URL will probably be updated and feels like a better option. I can change it if there is an issue with it.
@ -4,3 +4,4 @@
- Mobility Database (https://mobilitydata.org/)
Crawls all the urls, loads feed zips and extracts to the specified directory."""
import argparse
Pandas is currently being used by another file in the project (/search/search_quality/scoring_model.py), so I was of the opinion that the module will already be installed to run the project, i.e. not an extra dependency.
I will look into a csv module alternative.
@ -4,3 +4,4 @@
- Mobility Database (https://mobilitydata.org/)
Crawls all the urls, loads feed zips and extracts to the specified directory."""
import argparse
Our general rule: fewer dependencies are better than more. We introduce new 3party dependencies ONLY if there is no other comparable way to solve the problem.
@ -12,3 +13,4 @@
import csv
import time
import zipfile
It creates an additional HTTP round-trip to resolve the shortener. I would document in the comment the original web page where you get that shortener, and use the resolved URL. If the scheme changes, we'll need to update the parser too.
Please use consistent code formatting everywhere.
@ -12,3 +13,4 @@
import csv
import time
import zipfile
@ -4,3 +4,4 @@
- Mobility Database (https://mobilitydata.org/)
Crawls all the urls, loads feed zips and extracts to the specified directory."""
import argparse
I have changed the code to work with the default csv module :)
There could be temporary network errors, so I would avoid recommending URL update.
One interesting practice is to use single quotes for verbatim strings, and double quotes for strings with variables inside. It helps to read the code.
Another possible option is to always use double quotes like it's done already in the file (except in 'wb' above).
Why it was required before? What happens now if it is specified or not specified?
As per the earlier implementation, Transit Land API key was always necessary. This gives the flexibility to just crawl Mobility without the hassle of generating a Transit Land API key.
If the --source is set to 'all' or 'transitland' : the key is required. If it is not specified, line 255 will return an error.
If the --source is set to 'mobilitydb' : the key is not required and it will crawl just Mobility DB. Specifying the Transit Land key wouldn't matter since it is not being used.
Good! Let's merge it.