OpenMetroMaps / mapindex

A comprehensive index of metro maps
0 stars 0 forks source link

fetch transit map URLs automatically from official apps #2

Open derhuerst opened 4 years ago

derhuerst commented 4 years ago

Most of the official German transit apps query a list of transit maps from their respective backends. Because most of them are just re-packaged versions of the 2 largest providers, the response structure is mostly the same.

We could compile a list of these endpoints (a list of lists) and fetch their reported transit map URLs.

sebkur commented 4 years ago

Is there a list of all the official apps somewhere?

derhuerst commented 4 years ago

I don't know any list, but these should give you most of the apps:

sebkur commented 4 years ago

Do you think we would need a copy of each app's APK and reverse engineer it to find the backend URLs that each app uses to find out about the maps?

derhuerst commented 4 years ago

For all the HAFAS-based ones, you can just write a script using @juliuste's incredibly useful config file extraction tool:

#!/bin/bash
set -e
set -o pipefail

app_id='de.hafas.android.vbb'
curl 'https://hafas-bohrer.juliustens.eu/'$app_id | grep NETWORKMAP_SERVER_URL

Edit: It seems though that some apps don't have a NETWORKMAP_SERVER_URL config.

sebkur commented 4 years ago

Oh wow, that is indeed incredibly useful!

A bit of a downer is that the linked JSON file (such as https://fahrinfo.vbb.de/networkmaps.json) references a ZIP-file for each map instead of the original PDF. It appears that is a file format with a hierarchy of PNG image tiles optimized for display in the mobile app. Still very interesting though.