OpenStreetMap

Background

One major downside to fully using Open Street Map as a complete alternative to other map services (at least in the US) is the lack of address data. I strongly believe this is tied to the slow tedious process of adding addresses. I myself have spent many hours adding addresses a variety of methods beginning with driving by with a dash camera in my car and reviewing video feeds later. I then discovered the massGIS L3 parcel data overlay in JOSM and began

  • Selecting all buildings in a town adding city, state, postcode to them
  • Selecting the houses on a street , adding the street
  • Going through the street to add the housenumbers
  • And repeat for other streets uploading changes at the end of the day
  • When I was done for each town, I would remove the city, state, and postcode from buildings that had no housenumber associated with them (I.E. garages or sheds on peoples properties that got captured in the first step).

While this last method was considerably faster, I still thought at a minimum there must be a way to add all these addresses to OSM as individual address nodes. After some research and a preliminary testing I was able to create a few scripts to convert the data into an osm file that could be opened with JOSM.

[UPDATE] As I was rightfully pointed to the import guidelines wiki, I am rewording this post as a proposed method and proof of concept to gather general thoughts before implementing.

High level overview

This section lists the high level overview of the process I would like to gather thoughts on. For more details see below

  • Download the scripts L3ToOSM scripts
  • Download MassGIS ESRI shapefile for the town
  • Export shapefile database to csv
  • Run script to convert to OSM importable file
  • Import into JOSM for editing and merge address data with buildings
  • Remove temprary address nodes
  • Uploading to OSM
  • Validation and error checking

Detailed Steps

Below are detailed steps describing the process for importing address nodes into JOSM that I would like to gather thoughts on.

Download the scripts L3ToOSM scripts

Head over to my github project to download the project and read the README for software dependencies. [UPDATE] Perhaps an OSM file containing the address data as nodes could be provided instead for aiding in address additions for local folks. This would allow for skipping down to the import into JOSM step.

Download MassGIS ESRI shapefile for the town

  • Download L3 parcel data from the MassGIS website - the zip file to download is under the ESRI Shapefiles column named something like L3SHP_MXXX.zip
  • Unzip the file to a temporary location on your computer.

Export shapefile database to csv

  • With Libre Office Calc (or Microsoft Excel - untested) open the unzipped directory and look for a file named MXXXAssess.dbf (Should be the largest filesize)
  • A popup will ask what character set to use - i selected the first one Western Europe (DOS/OS2-850/International) though you can select Unicode(UTF-8) as well.
  • Delete the columns so you are left with state_plane(LOC_ID),Housenumber(Addr_Num),street,city,zipcode
  • Click file -> save as
  • Choose a directory to save the csv file (it may be best to use the same directory the scripts are in)
  • Make sure to select the Text CSV (.csv) file format
  • Click save -> In Libre Office you may get a warning asking if you want to use ODF format, just click “Use text CSV Format”
  • IMPORTANT: In the “Export Text File” box, make sure to change the “Field delimiter” to a colon “:” and click ok to save it.

Run script to convert to OSM importable file

  • Open a terminal and cd into the directory where your script and csv file is saved.
  • run the script with the following arguments: l3ToOSM.sh "" Where STRING_TO_SEARCH is captured in quotes and is data that will be added to a note for each address to be used for deleting address nodes after they have been merged with buildings. This is to prevent duplication of data and it is better to have address data tagged with a building than floating around as a single node. Make sure this is unique (ex: xunilOSMassAddressUploadDeleteMe) NOTE: For now this script only works for Massachusetts L3 Parcel data and in the mainland, not the islands like Marthas Vineyard etc.. For more information read about the [State Plane Coordinate System](https://en.wikipedia.org/wiki/State_Plane_Coordinate_System) specifically the state plane zones.
  • The script is very fast and should complete within a second or less. Please note that the street data in the L3 database shortens the names. Ex Road would be RD and Street would be ST. I have added logic into the script to handle this, however it may be possible that I could have missed an abbreviation or two. See the below section on Validation and error checking on how to handle this.

Import into JOSM for editing

  • The script should have created a new file named MXXXAssess.csv.osm. This file will contain all the address nodes from the L3 parcel database file.
  • Download a section of the town from OSM
  • Open JOSM and click File -> Open
  • Select the file and click open
  • You should now see all the address nodes for the town in question.
  • Click on the address layer and make it the visible layer
  • Select the address nodes that correspond to the section of town you downloaded from OSM
  • Press CTRL+Shift+M to merge the selection to Layer1 or whatever layer contains the OSM downloaded data.
  • Add the L3 parcel data as a background as this makes it easier to tell what buildings to merge the address nodes with
  • Optional: Add a filter to hide any buldings that have addresses associated with them. I use “addr:housenumber”=* building=yes
  • Select an address node and press CTRL+C to copy the node
  • Select a building to merge the address data with and press CTRL+Shift+V to merge the two
  • Repeat the last two steps until done for the day and ready to upload
  • I occasionally check the address data to make sure it is in line with the L3 parcel background data and street names as good habbit.

Uploading to OSM

  • Prior to uploading to OSM it is very important to remove the address nodes to prevent them from being duplicated on the map
  • IMPORTANT: If you created a filter to hide building with addresses, temporarily deactivate it
  • Click edit -> search
  • In the search field look for type:node note=”xunilOS ImportAddrPleaseDeleteMe” Where note=”” is what you eneterd in the STRING_TO_SEARCH argument.
  • Verify only the address nodes are selected and press delete.
  • Click edit -> search again to remove the note field that was also merged with all the buildings you added address data to.
  • In the searchfield enter note=”xunilOS ImportAddrPleaseDeleteMe” Where note=”” is what you eneterd in the STRING_TO_SEARCH argument.
  • In the properties window on the right select the note property and delete all the notes containing the STRING_TO_SEARCH argument.
  • Finally upload the addresses and resolve any errors that the validator may find.

Validation and error checking

After uploading to OSM, it is important to review the work to see if address data could be incorrect in case it was not caught prior to uploading to OSM. Ex a street name was not found etc.. The OSM inspector website is a great tool for such a task.

  • Go to OSMInspector and click addresses under the view dropdown.
  • Zoom to the town you would have been working on and resolve any errors that can be found. Typically this may include a misspelled street name etc..

I appreciate any comments or concerns.

Discussion

Comment from SimonPoole on 23 May 2015 at 17:57

While for once this seems to be a technically competent import, you seem to have ignored essentially all non-technical prerequisites http://wiki.openstreetmap.org/wiki/Import/Guidelines

I would, very strongly, recommend that you immediately catch up on the stuff that you haven’t done up to now.

Comment from xunilOS on 23 May 2015 at 21:09

Hi Simon,

Thank you for your thoughts and the link.

Perhaps my post is being missunderstood or I am missreading the import guidelines. The data I was using is derived from the same data source as the massGIS L3 parcel import https://wiki.openstreetmap.org/wiki/MassGIS and the wiki page states that it can be used as long as it is sourced.

The idea behind my method was to simply assist in the addition of address data (still manual) and not be an automated bulk import.

In the past, I simply added the background layer of the L3 parcel data in JOSM and added address information one by one to each house within a parcel. Using my method above, I have made it easier to copy this same data into a buildings attributes by placing the address data into a temporary node that will be copied, merged with the building, then deleted. The data is coming from the same source and in the end the address data will be the same if either method is used only quicker with the temporary nodes.

Do you think this would still fall under the bulk import bucket as I am only working on a section of a town at a time? Either way I have joined the imports-us mailing list and will gather thoughts on that list as well.

Thank you for your feedback. In the meantime I will hold off on using this method before I have gathered general concensus from the mailing list.

Frederick

Comment from SK53 on 24 May 2015 at 11:28

Virtually all the MassGIS imports have suffered from major and significant problems. Firstly the import of streets did not join ways at boundaries. As the import was on city/town boundaries rather than county elsewhere making MA routable was extremely tedious.

Current parcel boundaries do not seem to be massively accurate. For instance this playground in Yarmouth Port is not contained within the two forks of Playground Lane and Old Church Road. It’s a while since I last visited, but Google StreetView & Bing aerial imagery confirm that the MassGIS boundary shown on OSM is inaccurate. A little to the East beyond the end of Damaris Drive there are multiple overlapping polygons for wetland & conservation areas: very difficult to work out what they are doing. I’ve tidied some of these up using aerial imagery/memory in the vicinity of Bass Hole/Grey’s Beach, but my impression is many of these polygons are more general than we expect with OSM.

Another area with problems in the past was the Hyannis Transportation Centre. Most buildings had been imported, but as they were imported some considerable time after the roads; the new road network was not in place. I added this (and fortunately Lars Ahlzen has done more) when trying to put the P&B bus route in.

The significant problem with these imports is that everything looks complete, but in reality it requires considerable revision, checking against current status, and judicious removal of useless data (see the large number of tags on the playground above). Very large numbers of highway=residential are nothing of the sort, but most likely driveways to properties (certainly along the Kings Highway in Barnstable, Yarmouth Port, & Dennis places I’m reasonably familiar with).

A side effect of this is if one looks at POI density in the Upper Cape, it is woeful. Only 28 restaurants mapped in the Barnstable admin division, which includes multiple popular holiday resorts including Hyannisport. (Only 1 in Rockport, 4 in Gloucester, 1 in Plymouth, 8 in Harwich, and NONE on Nantucket, etc). It doesn’t help that GNIS nodes are often inaccurately placed (such as Friends Meeting House on Nantucket which is several streets away from its actual location), and close to its likely location MASS GIS buildings sit on top of MASS GIS roads.

All in all these are reasons why I would be extremely cautious about further mass imports of data for Massachusetts. I cant be certain, but my basic feeling is that at least POIs would be better represented in the absence of these imports. Adding housenumbers would give further weight to the appearance of a complete and detailed map: but in practice in places I know, OSM is much less useful than it could be.

Alternative processes would be to put your data set up somewhere so that local users could use this as the basis for mapping (e.g., as a tiled layer or similar), or simply make it available in such a way that it can be integrated with OSM data at the data consumption stage, so that applications can use it (in practice geolocated address nodes may be all that is needed)

Comment from xunilOS on 24 May 2015 at 12:28

It certainly does sound like importing massGIS data was a very tedious process. The difficulty I had with adding the nodes as a separate layer was that I could not select the address node to merge.

I do like your idea about providing the data for local users which would be very useful. Essentially the output I am currently able to produce is an xml file that can be opened into JOSM containing all geolocated address nodes for a specific town. Is this what you had in mind?

Example xml for address nodes:

<?xml version=’1.0’ encoding=’UTF-8’?>

Comment from jremillard on 1 June 2015 at 22:38

SK53 I have yet to see any evidence that imports discourage real mapping. If you mapped locally, you would know that the playground you pointed out as being off was from the open space import in 2009, and not from the L3 parcel database, which is quite accurate. Measuring map quality from POI’s in MA is a very narrow evaluation criteria. Again, if you were local, you would know that many mappers in MA are outdoor enthusiasts, our hiking and biking trail network in the state is hands down the best and most complete source available.

Log in to leave a comment