An Erroneous Basemap Label, and how OpenStreetMap and the Community Helped us Fix it

Chris Whong
NYC Planning Tech
Published in
4 min readNov 21, 2017

NYC Planning recently launched Community Profiles, a site that compiles indicator data about NYC’s 59 community districts into an organized report with maps, charts, and links to relevant resources. A few weeks after launch, someone reported a bad neighborhood label showing up in the Bronx. The neighborhood of Westchester was had a label that read “Westchester County”. None of us were sure why, but we logged the problem in a github issue and began to investigate.

On to the tech. In traditional web mapping, the basemap is usually a raster tileset, which chops the earth up into little square images which are then stitched together in the browser. The basemap is loaded as a generic background, and the relavant data for the web map (markers, polygons, etc) are overlaid on top of it. Community Profiles uses MapboxGL, a frontend web mapping library that is vector-based, so it renders what we would normally think of as the basemap right in the browser (using a technology called vector tiles). In this case, we are consuming a vector tile service published by Mapbox, which includes everything you need to make a basemap: roads, parks, points of interest, neighborhoods, political boundaries, etc. Somewhere in the process, the neighbhorhood of Westchester was picking up incorrect label text.

The service we are consuming from Mapbox is based on OpenStreetMap (OSM). Known as the wikipedia of maps, it’s an open spatial database covering the entire world, and anyone can create and edit the data. Mapbox imports OpenStreetMap data on a regular basis and updates their vector tiles so everyone using them always has the freshest data. If you go to the OpenStreetMap site and explore the map, you’ll see a point feature for Westchester right where it shows up on our basemap! We investigated here, and saw that the name was correct, so we were still a bit stumped. Was there an algorithm somewhere that was appending “County” to the label?

We took to twitter to see if anyone had a suggestion, with a link to the github issue where we had been documenting the problem. Keith Jenkins, a Spatial Developer and GIS Librarian at Cornell, investigated and found the probable source of the error, a bad link to wikidata:

Wikidata, like OpenStreetMap, is another crowd-sourced information resource where anyone can create and edit structured data about things. Keith discovered that the OpenStreetMap record for Westchester contained a link to the wikidata entry for Westchester County. This incorrect association eventually made its way into OSM-derived products like Mapbox’s Vector Tiles. We had overlooked this link when we first inspected the OSM record, but a “help me out” tweet aimed at the mapping community caught the attention of someone with more experience in the OSM world who was happy to assist.

…a “help me out” tweet aimed at the mapping community caught the attention of someone with more experience in the OSM world who was happy to assist.

So now that we knew the problem it was time to fix it. There is no wikidata entry for Westchester the neighborhood, but wikidata links are not a requirement for OSM records. We deleted the bad link using OSM’s editor, in a process that took about 15 seconds. The next step was to wait and see how long it would take for the change to show up in Mapbox’s vector tile service.

We made the change on a Friday night, and by Monday morning the label was fixed in all of our web maps (and probably yours too if you use OSM-derived products)! We were able to make the edit on our own and watch the change magically appear in downstream OSM products. Our problem didn’t get lost in email threads with everyone trying to find the person who could help. Thanks to open technology, we could help ourselves. We wanted to share this little anecdote with the world, as it’s a testament to open data, open tools, open workflows, and the power of community. It’s why NYC Planning Labs is open by default, and why we support more open processes in local government.

--

--

Chris Whong
NYC Planning Tech

Urbanist, Mapmaker, & Data Junkie. Outreach Engineer at Qri.io