As a first step in the automatic creation of the pmtiles, we will create a GCP function with an HTTP trigger.
The GCP function will do this:
- Obtain the feed and dataset stable ids from the http payload
- Download the useful unzipped files to the local file system (stops.txt, shapes, txt, etc)
- Create a routes.geojson and a stops.geojson (with python script)
- Run tippecanoe on these files.
- Create routes.json (with python script)
- Upload the resulting pmtiles and json files to the bucket
- Cleanup files locally
Based on poc scripts create the logic that would generate and save the PMTiles files for both routes and stops in GCP.
Generate PMtiles directly from DB According to #912 (comment) we will not store pmtiles information in the DB. We will instead build the path to the pmtiles from the feed name.
Requirements:
For routes: The routes geojson file needs the properties route_short_name, route_long_name, route_id, route_type, route_color, route_text_color [all strings], agency_name
For stops: The stops geojson file needs the properties stop_id, route_ids (a list), route_colors, stop_code, stop_name, wheelchair_boarding, location_type, stop_lat, stop_lon
Save the routes.json file to use in route filtering. routes.json is a simple conversion of routes.txt.
Note: If the feed contains no shapes.txt file, don't process the routes.pmtiles According to #1255 (comment), we will generate the routes for datasets without shapes.txt.
To consider: If the feed already has some pmtiles and we need to generate pmtiles fora new dataset for the feed, we should consider deleting the pmtiles for the old dataset to reduce the disk space used.
Also to consider: If #911 is done, it will give us access to the gtfs txt files directly without having to unzip them.
As a first step in the automatic creation of the pmtiles, we will create a GCP function with an HTTP trigger.
The GCP function will do this:
Based on poc scripts create the logic that would generate and save the PMTiles files for both routes and stops in GCP.
Generate PMtiles directly from DB According to #912 (comment) we will not store pmtiles information in the DB. We will instead build the path to the pmtiles from the feed name.
Requirements:
For routes: The routes geojson file needs the properties route_short_name, route_long_name, route_id, route_type, route_color, route_text_color [all strings], agency_name
For stops: The stops geojson file needs the properties stop_id, route_ids (a list), route_colors, stop_code, stop_name, wheelchair_boarding, location_type, stop_lat, stop_lon
Save the routes.json file to use in route filtering. routes.json is a simple conversion of routes.txt.
Note: If the feed contains no shapes.txt file, don't process the routes.pmtiles According to #1255 (comment), we will generate the routes for datasets without shapes.txt.
To consider: If the feed already has some pmtiles and we need to generate pmtiles fora new dataset for the feed, we should consider deleting the pmtiles for the old dataset to reduce the disk space used.
Also to consider: If #911 is done, it will give us access to the gtfs txt files directly without having to unzip them.