Yeah, it’s a pain. That’s exactly why I said: “Overpass’s area
is a true life-saver!”
But you’re right, and it may not be out of reach. A quick search shows that Python libraries exist to check if a point is within a polygon. Perhaps we can convert the OSM district boundaries into a format those libraries can take, and then do it in Python.
It seems this will be necessary for every type of stop except bus stops. They aren’t consistently mapped with ref
in OSM.
This will all wait though - for now I’m going to do just bus stops and I’m using Overpass as a crutch like I said. I’m more interested in getting the PTNA CSV output right.
Edit: I forgot to say I started work on it, you can see it on gtfs2osm-il/ptnaGenerate.py at ptna-import - NeatNit/gtfs2osm-il - Codeberg.org
Nothing much to show yet. The output as of right now:
Running Overpass query: [out:csv(ref;false)];area[wikidata=Q5423411];node(area)[highway=bus_stop][ref]; out;
2490 stop_codes out of get_stop_codes
2548 stop_ids out of stop_ids_from_stop_codes
49472 trip_ids out of trip_ids_from_stop_ids
784 route_ids out of route_ids_from_trip_ids
784 routes out of routes_from_route_ids
[('אגד', 490), ('סופרבוס', 117), ('נתיב אקספרס', 82), ('נסיעות ותיירות', 36), ('קווים', 30), ('גי.בי.טורס', 25), ('מטרופולין', 4)]
Grouped by 308 unique catalog numbers