How to deal with orphan nodes in OSM?

This is a guest post by one of our Map Analyst team interns, Manuela.


While editing the map I stumbled upon clusters of orphan nodes. Basically, orphan nodes have no tags and are not part of a way. One example here:
nodes

Some online tools report these as bugs/issues (e.g. osmose). You should be careful, though. These may have been created with a reason. Before proceeding to deletion, ask yourself:

  • Were these nodes orphan from the very beginning?
  • Is there just one orphan node in a changeset or are there many?
  • Are they arranged in a special way/shape?

If so, they may be GPS traces that could be used for mapping. And still, even nodes from GPS traces should be deleted, there is no reason to keep orphan nodes in the map AFTER you extracted all the needed information from them.

My advice: research! There are many tools to find out the history of an OSM element. To name a few: object history, WHODIDIT, OSM History Viewer, attic data etc.

You’ll probably find yourself in one of the following situations:

  • You’ve found a newbie that creates orphan nodes by mistake
  • The nodes are correct but the user forgot to add the tags
  • A Redaction bot deleted ways without deleting the corresponding nodes (read more here)

Your options:

  • Contact the creator or the used who made the last change via a changeset comment or private message (in a friendly way, of course)
  • Add relevant tags if that’s the case
  • Delete the nodes or leave a fixme tag for other users that may know the area better than you

How to find orphan nodes

Osmose will report orphan nodes clusters as issues:

orphan

In JOSM, orphan nodes (even isolated ones) can be easily found using the Search tool, with the following queries:

type:node tags:0 -child

or

type:node untagged -child

The -child tells JOSM to select only those nodes that are not part of a way.

As if that wasn’t enough already, I’ve created a map paint style that highlights orphan nodes and dims other elements. This will help you analyze the distribution of the orphan nodes without needing to select them and will help you take the decision to delete or no.

This is the default JOSM map paint style, where you can’t really see the orphan nodes that well.
orphan2
This is how the map looks like after applying the new paint style.

If you want to use this map paint style, you can find the script and a step by step guide on the GitHub page:

https://github.com/manuelabutuc/JOSM-Orphan-nodes-map-paint-style/tree/master

Have fun spotting orphan nodes! But remember to delete them only if you are sure they have no reason to be on the map. If you have any improvement suggestions for this map paint style, feel free to comment below or fork the project.

 

Facebooktwittergoogle_plus

HOTOSM recognition by the President of Mexico in Internet Day 2016

On the Internet Day, May 17 2016 the President of Mexico Enrique Peña Nieto invited fifty citizens who called Digital Leaders (#LideresDigitales) to have a dialogue on the future of technology and Internet in Mexico, I had the opportunity of being among these group of citizens. The President talked about various related topics but especially appreciated the efforts of humanitarian mapping conducted by Humanitarian OpenStreetMap in Hurricane Patricia.

Day of Internet 2016- Dialogue with the President of Mexico
día del internet_3
President’s office twitter account

Why the President of México thanked the efforts from HOTSOM in Hurricane Patricia? Here you will find some details so you know what was done.

On October 23, 2015 Hurricane Patricia threatened to touch the states of Colima, Nayarit and Jalisco with winds up to 325 km/h, authorities of Mexico mentioned “It is very likely that this hurricane is the strongest ever in the Pacific side of our country, since it has records ”

Hurricane Patricia Path from NOAA

Contributors of OpenStreetMap and HOTOSM like Rodolfo Wilhelmy, Humberto Yances, Rafael Avila, Robert Banick, Andres Ortiz, and many others (sorry for not mentioning everyone)  in addition to an army of over 500 mappers of Mexico and the world joined efforts to support this area of the Mexican Pacific with data that could be used for the benefit of the population that could be affected. Fortunately, the hurricane lost strength by touching the coast of Mexico causing minimal damage compared to what was expected.

Quick stats:

  • More than 500 contributors mapped 9,000 kms of roads (5.6k miles of road) + 72,000 buildings in 72hrs
  • It was processed 29,608 km^2 pre-event DigitalGlobe imagery to improved coverage over priority areas.
  • It was analyzed INEGI road data to identify missing roads and road names in OSM data.
  • Mexico Open Data was confirmed by authorities to be used in OpenStreetMap.

All these was possible thanks to the great work HOT members, companies supporting OSM project and the local community in Mexico and the World

Contributors mapping the priority area in 72 hours Gif by Mapbox

The event took place in Los Pinos (The equivalence of the U.S. White House) at the moment the Open Data topic was mentioned, Peña Nieto said he knew someone who had supported the alert for Hurricane Patricia was among the guests so I raised my hand to start the dialogue, the President mentioned “… I just want to thank because it’s an example that illustrates very well what we can achieve and I think that you also use open information.” In my participation  I could give my point of view on the need for Mexico not only upload open data to be the first in quantity of released Open Data but emphasize the need of quality Open Data in order to take better decisions based on them. Also I could mention the importance of Open Mapping and collaboration between Governments and Civil Society so more Mexicans are less harmed by disasters (find the video here).

Miriam_DiadelInternet
Fragment of video from President’s office twitter account

In Mexico the OpenStreetMap community is not as numerous as in other countries but in the last two years a group of collaborators we have joined together to promote the project and increase the local community through massive workshops in Universities and courses for Government Authorities and Civil Society. Much remains to be mapped but I believe we are on the right track.

Miriam Gonzalez

@mapanauta

Facebooktwittergoogle_plus

Happy Mapping Hour – Presentation Import Project INEGI MGN (National Geostatistical Framework)

Last April 6th 100% of the Mexico Telenav’s team (Andrés Ortiz 50% and Miriam Gonzalez 50% 😀 ) presented the results of Import Project INEGI National Geostatistical Framework. The meeting point was the Felina bar on the edge of Condesa and Escandon neighborhood.

Andres_presentando
Andres presenting at Happy Mapping Hour
Miriam_presenta
Miriam presenting in Happy Mapping Hour                                                         Image by @Tlacoyodefrijol

More than 20 people booked and came to the appointment. The project was originally announced in May 2015 with much skepticism because this was the first time a project of such magnitude was taking place in Mexico and the OpenStreetMap community in Mexico at that time was very disperse.

Before_import
Before the Import Project there were 69 valid boundaries                               Image by Ruben @Mapbox

Many import projects have been conducted in many parts of the world, such projects have helped (mostly) to create the map of the world that we have today and Mexico was going to be part of them. People with extensive knowledge in imports formed part of the project including Victor Ramirez, Ernesto Carreras, contributors od OpenStreetMap Puerto Rico and Rafael Avila, a HOTOSM collaborator and expert in African countries imports. At the beginning of the project we realized that there were only 69 valid administrative boundaries (although in the image it looks more than 69,  these lacked the tag SOURCE which made them invalids) and the end of the Import project the team had added 2,457 administrative boundaries with tag Source = INEGI MGN 2014 v6.2

After_Import
After the Import Project there were 2,457 administrative boundaries        Image by Ruben @Mapbox

To the #HappyMappingHour diverse OSM contributors atended such as geographers, developers, archeologists and also Armando Aguiar – INEGI IT Services Director  witnessed how the Open Data Inegi released at the end of 2014 has been in benefit of OpenStreetMap. Let me share some statistics:

Quick Statistics:

Node numbers/Ways/ Deleted relations

  • 500K / 2k / 500

Node numbers/ Ways / Added relations

  • 1000K / ~4k / ~1050

Number of hours dedicated :

  • 250+

NUmber of administrative boundaries added:

  • 2,457

 

Now that the map has de MGN boundaries as a reference mappers as Irk_Ley have been investigating the local laws of the states of Veracruz and have been reviewing historical maps of the Map Library Manuel Orozco. These mappers will be verifying and correcting those limits which have differences with the MGN when they have the backup of the documentation of the local law.

Ancient map of the Papatla, Veracruz region

Here you will find the presentation of #HappyMappingHour and if you want more technical details we suggest you check the following blogs and the wiki.

Here also you will find two Blogs from collaborators in the Import Project:

Blog: My experience in OSM during the MGN Import by Pablo Garcia (OSM user: Irk Ley)

Blog: Import of INEGI Mexico municipalities finished by Andres Ortiz (OSM user: Andresuco)

You can contact them directly if you have any questions or comments for them.

What are the next challenges?

Evaluate data from the National Road Network and create a joint project with Mexico OpenStreetMap community to carry out its import. It is also in the radar create a tool where information from OpenStreetMap in Mexico is a kind of “inspector” to send feedback to INEGI about possible shortcomings or errors can be corrected and improved thanks to contributors OpenStreetMap but first we need more discussions with the local community.

Facebooktwittergoogle_plus

Updates to ImproveOSM JOSM plugin for better usability

The team has been working on some nice updates to the ImproveOSM JOSM plugin. I have been taking the new version for a spin and wanted to report back.

In case you need a refresher: ImproveOSM is a suite of tools (currently a web site and a JOSM plugin) that takes the results of a massive data analysis comparing billions of GPS data points with existing OSM data and displays them in a way that makes it easy for any mapper to improve OSM with missing roads, turn restrictions, and one-way tags.

Missing Roads (red), One-ways (orange) and Turn Restrictions (blue) in the clustered view of the ImproveOSM JOSM plugin.
Missing Roads (red), One-ways (orange) and Turn Restrictions (blue) in the clustered view of the ImproveOSM JOSM plugin. This is the Dallas, Texas area. Imagery from Bing.

The improvements are fairly small but gave me a noticeably nicer workflow, so I thought it would be worth sharing.

The first improvement is that you can now right-click on any of the ImproveOSM layers in the layer panel to access the data filtering options for that layer.

Access the data filters using a right-click on the layer panel
Access the data filters using a right-click on the layer panel.

The data filters let you see part of the data for that layer based on various criteria, such as number of trips, confidence level, status and others. The criteria available vary by layer. Here is the filter window for Missing Roads, for example:

Filter window for missing roads

The filters themselves are not new, but you needed to go to the ImproveOSM panel to access them before. I think this is way quicker.

Another thing I really like is the improved visualization for the turn restrictions. The team made it much easier to see the from-via-to flow of the suggested restriction. The from-segment is now green and the to-segment is red. When selected, the info panel will also display more useful information than before:

The new visualization of the missing turn restriction. The 'from' segment is green, the 'to' segment is red.
The new visualization of the missing turn restriction. The ‘from’ segment is green, the ‘to’ segment is red.
The metadata we display for a turn restriction is now more relevant.
The metadata we display for a turn restriction is now more relevant.

The detailed info panel was improved for the other categories (missing roads and one-ways) as well.

Finally, when you are done mapping an ImproveOSM thing, you can now quickly mark the thing as invalid or solved, without having to enter a comment. We realized that this was not a very efficient workflow. You can still add a comment upon closing the issue, but now it’s easy to do it without, by right-clicking on the ‘solve’ or ‘invalidate’ buttons and selecting the appropriate action.

invalidate-context

These small but meaningful improvements made my work with ImproveOSM in JOSM much more efficient. We are always looking for more ways to make ImproveOSM better. If you have used ImproveOSM and you have a few minutes to spare, I would appreciate it if you filled out this survey. Thanks a lot!

Facebooktwittergoogle_plus

Using PostGIS to answer geodata questions

One of the biggest challenges when working with large sets of data is to find the least costly workflow that you have to follow in order to get the most accurate answers.

Let’s say you have a huge dataset composed of all sorts of geometry features (points, lines, areas etc.) and you want to do a bit of cleaning – because messy and redundant information is no fun!

So you might be thinking “Hmmm… which are the areas that have an unnecessary high density of points?”

The same issue can arise when working with OpenStreetMap data. This can be easily solved using PostGIS and a command line tool that we’ve created and using.

Note: The following steps require a Linux environment, Postgresql 9.x, PostGIS 2.x, Osmosis 0.43+, QGIS 2.12.2+

Getting the data

Download an *.osm.pbf file using command line:

 wget https://s3.amazonaws.com/metro-extracts.mapzen.com/san-francisco_california.osm.pbf

This is the metro extract for San Francisco, provided by Mapzen. Geofabrik is also a very good resource for OSM data extracts.

In the same folder, download SCOPE – databaSe Creator Osmosis Postgis loadEr.

wget https://github.com/baditaflorin/osm-postgis-scripts/blob/master/scope.sh

Make sure to set the file to be executable by using

chmod +x scope.sh

Load the data

Using SCOPE and following the instructions on the screen, load the *.osm.pbf into a database.

SCOPE automatically creates the database with hstore and postgis extensions and the pgsnapshot schema.

Play with the data

Now that you have the data set up, you can easily query it using the DB Manager from QGIS and some PostGIS scripts.

Interesting examples

For example, using the find_duplicate_nodes query, we can see that this building (@20.805088941495338, -104.92877615339032), appears on the same spot 23 times!

duplicate_building

The one next to it (@20.8054225, -104.9278152) appears 22 times!

duplicate_building_2

The node density for these areas (@20.4411867, -97.3172739) is too high – 168 nodes!

nodes1

Also, 171 nodes for a small fence segment (@46.7487683, 23.559687)!

fence

the-node-density

Feel free to fork the GitHub repository and modify the code to suit your needs! Also, if you feel insipred, you can suggest a better and shorter name or acronym for SCOPE!

Facebooktwittergoogle_plus

OSM Mapping party – spring edition

 

On the 17th of April we had our first Mapping party event for this year. Our main focus was to improve the map of our hometown by reflecting the latest changes.                                                                                                   Cluj-Napoca is a dynamic city, many new buildings was constructed; POIs, turn restrictions, addresses have been changed and appeared since the last field mapping.

Around 30 map enthusiast show up in Sunday morning for the Mapping party. There were both experienced mappers and newbies present at the event. The event had started with a morning coffee and some instructions regarding data collections.

For data collections we used the following tools:
• Field papers: our colleague Florin Badita had took some time before the event and had created field papers for several city areas

field-papper1

• GPS tracker applications: OSMTracker, OSMAnd, Pushpin OSM and so an
OpenStreetView application 

We have divided the people into smaller groups of 2-3 persons. After each group had chosen an area to map we went out to collect the data.
On the afternoon we headed back to our meeting location to add the collected data into OpenStreetMap.

An outcome overview of our mapping effort is presented on the following images:

FinalEdits

FinalEditsOverview

Facebooktwittergoogle_plus

Improve OSM adds missing roads in Guatemala

In a new data release today, we added about 500 tiles worth of missing roads in and around Guatemala!

Missing roads near Coatepeque, Guatemala
Missing roads near Coatepeque, Guatemala in JOSM. Imagery from Bing.

We are excited to be adding more and more Missing Roads data to ImproveOSM using GPS data from our own users as well as from data partners, like we did in Brazil and in this case.

You will notice that the tiles look a little different from the ones you are used to if you have used ImproveOSM before: they don’t show the individual points. This is because this particular data was processed a little differently. If you use JOSM, you will also see an update to the ImproveOSM plugin to accommodate this change.

While you are looking at the new Missing Roads, perhaps you will also notice some other recent improvements to the ImproveOSM web site. We re-ran all tiles based on new map data from mid-April, and we improved our turn restriction detection so we won’t show a missing turn restriction when OSM already has a ‘only straight on’ restriction.

Happy Mapping!

Facebooktwittergoogle_plus

Turn restrictions – a vital part of any routing system

The best part of using everyday OSM technologies and relying on OSM to make sure that you get “there” on time is that you can directly influence the quality of the experience.

Regardless which OSM technology you’ll be using, to provide you the best experience possible, the routing software has to know as much information as possible about the roads between you and your destination: one-way streets, turn restrictions, speed limits, road closures and much more.

For example, the turn restrictions contribute significantly to the total travel time, and to the correctness of the route altogether, thus, by ignoring them in the traffic network model, essential characteristics of the network might be missed, leading to substandard and unreasonable paths.

Dealing with turn restrictions in OSM

To help us navigate the complexities of properly translating real map scenarios to the ways and points schema of OSM we will rely on JOSM with the turn restrictions plugin installed.

Turn restrictions in OSM are handled by creating a relation

A relation is one of the core data elements that consists of one or more tags and also and ordered list of one or more nodes, ways and/or relations as members which is used to define logical or geographic relationships between other elements. (source)

There is a mandatory requirement when creating a turn restriction relation: it has to consist of minimum three members and must have assigned two tags. (see below example)

structure
The ‘type=restriction’ flags the relation as a turn restriction and ‘restriction=no_u_turn’ indicates the restriction type.

A ‘no_’ type relation can also be represented in map data as an ‘only_’ type relation. The prohibited turn restriction relation is preferred by some routing engines instead of an allowed turn restriction relation.

More details here - https://wiki.openstreetmap.org/wiki/Relation:restriction
More details here – https://wiki.openstreetmap.org/wiki/Relation:restriction; US regulatory signs – http://mutcd.fhwa.dot.gov/services/publications/fhwaop02084/

Members of a turn restriction relation are ways and nodes

One simple case can be a turn restriction relation that consists of three members – two ways and one node. The two ways would represent the beginning (‘from’ role) and end (‘to’ role) of the turn restriction. The node would represent the continuity of travel between two ways and has a ‘via’role.

Way (A) - node (B) - way (C) sequence
Way (A) – node (B) – way (C) sequence in a ‘no_left_turn’ restriction relation.

Another case is where a turn restriction relation can consist of three or more ways. Two ways from this type of relation would represent the beginning and end of the turn restriction and at least one way would represent the continuity of travel between the aforementioned ways (‘via’ role).

Way (A) - way (B) - way (C) sequence in a no_u_turn restriction relation
Way (A) – way (B) – way (C) sequence in a ‘no_u_turn’ restriction relation.

Workflow for adding turn restrictions

The traditional way

Using the embedded relation editor available in JOSM. A slight disadvantage of this method is that you spend a bit more time to manually construct the relation. Click on the image below for how-to video.

traditional_way_vid

The user-friendly way

Using the turn restrictions plugin, that automatically recognizes the type of relation and roles for each member. Click on the image below for how-to video.

user_friendly_vid

Using the aforementioned tools, we have reviewed 2,000 miles of field trip footage and added nearly 2,500 turn restrictions in the LA/Orange county area, where 85% of the turn restrictions that were added to the map are no_u_turns, followed by 11% of no_left_turns, the rest being covered by the other categories.

Hopefully we’ve managed to illustrate how easy is to map turn restrictions in OSM. Now, it’s your turn!

Facebooktwittergoogle_plus

ImproveOSM with your own GPS data – a Field Report

We launched ImproveOSM about 6 months ago as a way to turn the vast amounts of GPS data that Scout users give us into useful and actionable hints mappers can use to add turn restrictions, missing roads as well as wrong or missing one-way streets. The response has been incredible — since we launched, more than 26 thousand hints have been processed, leading to more than 16 thousand improvements to the map worldwide. I think that is a fantastic result, and we will keep working to make ImproveOSM better based on your feedback.
Initially, we just used our own GPS data to generate the hints. But there is no reason why we couldn’t process any GPS data we can get from other sources. So I was really excited when long time Brazil mapper Wille Marcel got in touch with a cool idea. He worked with the Brazilian Environment Ministry, which collects GPS data of the vehicles that work in environmental monitoring. Most of the data are in rural areas where OSM is much less complete. So this was a perfect fit for ImproveOSM’s missing roads tool.After getting the proper permissions from the agency, Wille sent us the GPS data and we started analyzing it.

sparse-missing-roads

We quickly realized that the GPS data is much less dense than what we are used to working with. Some missing roads were only driven once. Our algorithm, tuned to higher density data, initially only detected a few tiles. We decided to loosen the detection threshold significantly for this particular dataset. After a few iterations of tweaking and testing, we ended up withmore than 5000 tiles containing missing roads based on Wille’s GPS data.

overview

The missing roads in Brazil are on ImproveOSM now, so why not go to the web site or fire up the ImproveOSM JOSM plugin and help the Brazilian community out by adding some missing roads?

If you are in a similar position as Wille and know of a source of free and open GPS data for your country, please get in touch with me so we can look at the data and see if we can include it in ImproveOSM.

We are already working with a number of other folks who have lots of GPS data. Soon, the number of missing roads, one-ways, and turn restrictions in ImproveOSM will be much, much bigger. We are also working on a host of new features, so I hope you will stay tuned to the ImproveOSM blog to be among the first to hear about what we have up our sleeves for ImproveOSM and other OSM related projects we are working on. And follow us on Twitter at @ImproveOSM!

 See also Wille’s post about this collaboration (in Portuguese).

Facebooktwittergoogle_plus

Help map some sidewalks for cities in the U.S.

United States cities are built for cars, with very few exceptions. From where I am sitting right now, I see this:

carscarscars

Cars zooming by incessantly at 70kph.

Finding your way in an urban space that is designed this way is tricky – and often dangerous – if you are walking or bicycling. Sidewalks are often not present, crossing streets can be very dangerous or even impossible. OSM has great tagging for bike lanes and sidewalks, but I find that these crucial tags are often missing on ways that need them most: the four or six lane urban arterials that you see in the picture above.

As I was sitting here asking myself how on earth I would get back to my hotel (which is 10 minutes away) safely, I thought to myself: ‘we can fix this problem and make the world a bit safer for those who can’t or won’t drive.’

MapRoulette to the rescue!

I created this challenge highlighting all primary and secondary ways that have nosidewalk tag in Tampa, Florida. (I am actually in Sarasota now, south of Tampa, but I already fixed all the ways there so that would be a boring challenge.) The idea is to look at the aerial image in JOSM or iD, see if there is a sidewalk, and add the appropriate tag. Adding sidewalk=no is actually just as important as adding both, right or left. Here is an example way from this challenge:

exampleway

Even zooming further in there is no sight of a sidewalk:

zoomedin

So let’s add that information:

tagging

And upload!

Create a Challenge for your city

The fun part is that you can easily replicate this challenge for your own city. Here’s what to do.

Overpass Turbo

First you head over to Overpass Turbo and run the query that highlights all highway=primary and highway=secondary that have no sidewalk tag:

overpassturbo

You can use my query as a template, replacing the GeocodeArea with the name of your city.

Once you have the results, export them to GeoJSON. Let’s use a gist:

gist1

gist2

You can now click on the gist link and see the result on GitHub as well:

github

We will need the ‘raw’ GeoJSON content, so click on the ‘Raw’ button and copy the link it leads you to.

Geojson2MapRoulette

Next we’ll use a little tool I created to easily turn the contents of a GeoJSON file into a MapRoulette challenge. To get it, head over to the Github repository and follow the instructions to install the tool.

The tool takes its configuration from a YAML file. The samples directory contains an example for this sidewalks challenge you can use as a template:

# the base URL for the MapRoulette server API to call
server: http://dev.maproulette.org/api
#server: "http://localhost:5000/api"
#server: http://maproulette.org/api

# server API admin credentials
user: devuser
password: mylittlesony

# source file or URL. You can give a list of URLs too, all data will be gathered and added to the same challenge.
source_url: https://gist.githubusercontent.com/anonymous/310005dc1dcf08f5c4a7/raw/74aa0d6a845a20511d0c450d715dab23d2a6c0d6/overpass.geojson
# source_file: ....

# source geojson property key to use as your task identifier (optional, will use random UUID if not given)
# identifier_property = ...

# Challenge metadata, see https://gist.github.com/mvexel/b5ad1cb0c91ac245ea3f for background
slug: sidewalks-sarasota
title: Add sidewalks to major roads in Sarasota
instruction: This way has no `sidewalk` tag. Usually you can see from the aerial imagery if there is a sidewalk or not. Please add the appropriate `sidewalk` tagging.
help: "Help make OSM be a better resource for safe, walkable streets! Many primary and secondary roads in the US are not safe for pedestrians if there is no sidewalk. This challenge highlights all `primary` and `secondary` ways that have no [`sidewalk`](https://wiki.openstreetmap.org/wiki/Key:sidewalk) tagging whatsoever. You can help by looking at aerial imagery and adding the appropriate `sidewalk` tagging. `sidewalk=no` is just as important to have as the 'positive' values. Thanks for helping make OSM better!"

The only items you would need to change are the source_url (use the raw GeoJSON github link you just copied), the slug (use sidewalks-YOURSTATE-YOURCITY or something similar – this will be the challenge URL component in MapRoulette) and the title (change the city name).

By default this configuration will post to dev.maproulette.org. If you want to post tomaproulette.org you would need to get in touch with me to get the credentials.

Once you have the YAML config file in order posting to MapRoulette is as simple as:

$ ./geojson2maproulette.py samples/sidewalks-sarasota.yaml --post --activate
Posting 364 tasks...
server alive: True
Updating challenge...
Reconciling tasks...
Done!

Let me know if you need any help with this or if you want me to create a challenge for you!

Facebooktwittergoogle_plus