Automated edits/timshel500
Page content created as advised on Automated Edits code of conduct#Document and discuss your plans. I used an Automated edit page by Kai Johnson as the template for this one.
Updating NYCT Bus Stops and Route Relations
This edit will update stop locations and route relations for buses in the New York City Transit (NYCT) System.
Who
This automated edit will be performed by timshel500. I can be reached via messages to my OSM Profile or to my OSM Community Forum account.
Why
Some OSM bus stop locations are out of date in the five boroughs, making it difficult for navigation apps that rely on OSM to route users on NYCT buses. For a look at how NYCT's bus stop data completion compares with other places around the world, have a look at the MTA's match report produced by Organic Maps' GTFS-OSM Matcher app (scroll down to us-mta-nyc).
What
By importing GTFS data that the MTA releases as free to use, this edit will:
- add NYCT bus stops (
public_transport=platformandhighway=bus_stop) that are not yet on OSM, - delete NYCT bus stops that are no longer used, and
- add route relations between bus stops
How
Using a version of gtfs-osm-import modified for NYCT, OSM and GTFS data will be processed using a java program that does the following:
- Expands GTFS bus stop names (i.e. "W 42 ST/7 AV"--> "West 42nd Street & 7th Avenue") to make it easier to match on OSM stop name.
- Merges GTFS data and existing OSM data wherever possible. GTFS stops can be identified based on "ref" number, name, or location. The program will:
- Look at all OSM stops within 60 meters of a given GTFS stop. First, look for any OSM stop with a matching "ref" number and assign if there is a match.
- If there is no OSM stop with a matching "ref" number, look for an OSM stop with a matching name. This is a little tricky so here are some further notes on how that matching will work:
- When choosing between multiple potential OSM stop matches with matching name, the program will only choose if the distance to the nearest OSM stop unaffiliated with any GTFS is less than 62% the distance to the next nearest unaffiliated OSM stop. In other words, if the GTFS stop is approximately the same distance from two OSM stops, then the match will fail as ambiguous.
- Often, there will be two OSM stops across the street from each other with identical names, and similarly two same-name GTFS stops near each other but not exactly in the same spot; in these cases, the program will find the minimum distance between one of the GTFS stops and one of the OSM stops, assign that GTFS to that OSM, and the other GTFS to the other OSM.
- In some cases, one of the two OSM stops with identical names has been removed from service. To properly match in about 100-200 of these cases, we may remove both existing OSM stops and add one (back) from GTFS to ensure that the remaining stop is located on the right side of the street.
- In cases where the OSM bus stop has neither a ref nor a name, check whether the GTFS stop is within 12 meters of the existing OSM stop that is missing both ref and name. If so, match accordingly and fill missing OSM ref & name from GTFS
- Keeps all existing data for OSM stops with a match and only adds data from GTFS when a field is missing. For example if the OSM stop has a name but no ref number, the OSM name will be kept (even if the GTFS name is different) and the ref will be added from GTFS
- Disuses non-matching NYC Transit stops. That is, find OSM stops with a network value of NYC Transit but without a match in the GTFS and mark them as disused. (Note: this proposal originally suggested deleting the stops but I'm opting to disuse because some of the old stop infrastructure like poles might still be in place, and disusing will make it easier to add that infrastructure back to OSM.)
- Adds GTFS stops that didn't match with any OSM stops to OSM. Note: the location used will generally be taken directly from GTFS. These are not always in exactly the right location (sometimes they appear a bit too close to the curb or roadway), but they generally seem close enough. Since I am not sure that the location is in the right spot, these added GTFS stops will be marked with a 'fixme' tag.
- Checks for cases where an OSM stop to be deleted and a GTFS stop to be added are within 30 m of each other: these may be cases of a failed merge because of errors in OSM data, GTFS data, or both. These cases will be reviewed and by a human and OSM will be corrected by a human to resolve any misspelled names or hardcode any ref numbers to ensure an appropriate match for GTFS, using bustime.mta.info to look up stop information. For example, an existing OSM stop may list one of its streets as "Astoria Boulevard North" but the GTFS data lists the street as "Astoria Boulevard." Human review will determine whether the nearby OSM street is named "Astoria Boulevard" or "Astoria Boulevard North." If the existing OSM stop name is inconsistent with the street name, the OSM stop name will be changed by a human; if the GTFS stop name is inconsistent with the street name, a human will add the GTFS stop's "ref" number to the OSM stop so that the merge succeeds (and the existing OSM name is kept, per #3 above) despite the mismatched names.
- Assigns the following properties for OSM stops missing any of the properties below, or for new bus stops coming from GTFS:
network=NYC Transitnetwork:wikidata=Q1325591operator=Metropolitan Transportation Authorityroute_ref= the bus route(s) using that stop (e.g. M1, B44)public_transport=platformhighway=bus_stop
- Adds route relations using GTFS route and direction data. When adding route relations, it's my understanding that we have to decide whether to locate a stop at its stop_position (where the bus is when stopped) or 'platform' (where the passengers wait). After reading discussions in a couple places, I propose that this automated edit will associate a stop with stop_position when it is available and platform when stop_position is not.
- Produce an OSC file to be uploaded
Preliminary numbers for how the merge might go:
| Case | Count |
|---|---|
| GTFS stops that merged with existing OSM stops | 8,858 |
| GTFS stops added that weren't on OSM before | 3,759 |
| OSM stops that aren't on GTFS and are archived via this edit | 1,266 |
Discussion
While I made an earlier automated edit standardizing bus stop names, this is a more involved edit and I'm very open to all directions of feedback on this automated edit. A couple questions about methods I've proposed above:
- In line with some prior conversations about bus stops that are no longer used, I've proposed deleting NYC Transit bus stops that aren't on GTFS anymore. However, that link was to a convo from a few years ago. Is deleting still the way to go? Would it be better to leave these but tag as disused, abandoned, or something else?
- For GTFS stops that are not yet on OSM, is it OK to just use lat/lon from the GTFS? Or should I go through these one at a time with satellite imagery to ensure they appear roughly in the right spot (on a curb next to the road)?
- Above in "8" I discuss how route relations have to locate a stop at either its 'stop_position' or 'platform' -- does this sound like a good way forward?
- I've been thinking about ways to update this on a regular basis moving forward as the MTA changes stop locations. Not quite sure how to best do that yet, but if you have any thoughts let me know.
This automated edit will be discussed in the local-nyc channel of the OSM Slack.
This proposal will be posted for discussion on the OSM Community Forum.
To allow at least 14 days of discussion prior to implementation. this automated edit will not be performed before October 10, 2026.
Standardizing NYC Bus Stop Names [COMPLETED]
This edit will standardize the naming of bus stops within the NYC Transit System.
Who
This automated edit will be performed by timshel500. I can be reached via messages to my OSM Profile or to my OSM Community Forum account.
Why
Currently, most existing NYC bus stop names adhere to OSM convention but about 100-200 do not. This update will standardize bus stop naming conventions, which will also prepare for expanding the use of ref and GTFS route relations for NYC transit by making it easier to match GTFS and OSM data.
What
In keeping with OSM guidance on names, bus stop names will generally spell out abbreviations like E for East. So even though the GTFS data and bus stop sign say "W 42 ST" the label will be "West 42nd Street." I will include ordinal suffixes like "nd" because a person would expand "W 42 ST" as "west forty second street" not "west forty two street." In NYC, signs for numbered streets generally use the numeric name, i.e. "42nd Street" not "Forty Second Street."
I will also standardize how we indicate intersections: right now it is a mix of "/" and "&" but given that the bus stop signs say "&" and "&" comports better with how we think of an intersection, I will use "&" to name a bus stop at an intersection.
Note that this edit will not adjust unusual capitalization so for example "OLMSTEAD Avenue / SEWARD Avenue" will be changed to "OLMSTEAD Avenue & SEWARD Avenue"
How
Current NYC OSM data will be downloaded. The bbox used will be minLat=40.49; minLon=-74.26; maxLat=40.92; maxLon=-73.70;
Data will then be filtered by highway=bus_stop and network=NYC Transitand processed using java functions that do the following:
- Expand "street types" (St, Ave, Blvd, etc) that occur at the end of bus stop names or immediately preceding "&" or "/". For example this would change "34th St" to "34th Street" while leaving "St Marks" as "St Marks"
- Add ordinal suffixes to numbers that precede "street types" i.e. "West 42 Street" -> "West 42nd Street"
- Expand compass directions i.e. "E" -> "East"
- After checking to ensure "/" is only used to indicate intersections, replace "/" with "&"
This script will output a CSV of changes that will be reviewed by a human and revised as necessary, and a OSC file will be produced. That OSC will contain all tags from the relevant OSM objects. Only the names will change.
Discussion
This automated edit was originally discussed in the local-nyc channel of the OSM Slack.
This proposal has been posted for discussion on the OSM Community Forum.
This Automated Edit standardizing NYC bus stop names has been completed.