OpenStreetMap

About HIFLD

OSM power user SherbetS has been documenting the HIFLD dataset. It is a large corpus of public domain licensed geospatial information about infrastructure around the United States.

Get all the data into JOSM

Download the dataset in GeoJSON format here. Fire up JOSM and open the file. This will create a layer that is just the HIFLD data. If won’t have any fields that look like OSM fields so DO NOT upload this directly.

Next we need to get the OSM data into JOSM. For this demo we will use the data for the state of Wyoming.

  • Click the green download button to open the Download dialog.
  • Click the “Download from Overpass API” tab at the top.
  • In the Overpass text box put something like:
// fetch area “Wyoming” to search in
{{geocodeArea:Wyoming}}->.searchArea;
// gather results
(
  // query part for: “amenity=hospital”
  nwr["amenity"="hospital"](area.searchArea);
  // query part for: “amenity=clinic”
  nwr["amenity"="clinic"](area.searchArea);
);
// print results
out body;
>;
out skel qt;
  • Hit the “Download into new layer” button at the bottom

We now have 2 layers. One with the HIFLD data and one with the OSM data.

Finding unmapped items with the conflation plugin

We will now use the Conflation Plugin to match the nodes in the HIFLD dataset with OSM downloaded elements. Any elements that do not match to an OSM item should be reviewed and additions made. Any matched elements may be reviewed for completeness in OSM but that’s a separate matter.

We will start by selecting elements from the HIFLD dataset that are in our state of interest (“WY” in this case) and add this to the Conflation tool as the “Reference”. This is the set we’re trying to match elements to.

  • Make the HIFLD layer active using the Layers pane right click > Activate
  • Open the find element dialog Ctrl+F
  • Search for all elements tagged as being in Wyoming STATE="WY"
  • Click the “Configure” button on the conflation tool pane
  • Click the upper “Freeze” button on the “Configure conflation settings” pane

Now we need to add the OSM data to the “Subject” section of the conflation tool. This is the set of all the things the “Reference” set can match into.

  • Make the OSM layer active using the Layers pane right click > Activate
  • Open the find element dialog Ctrl+F
  • Search for all elements tagged as being in a hospital or clinic amenity=hospital OR amenity=clinic
  • Click the lower “Freeze” button

Because hospital grounds are typically large I changed the “Distance” parameter in the conflation settings to be “Centroid < 150”. This may need to be tuned based on variation.

Hit “Generate match…” to set the tool to work. It will relatively quickly generate a list of matched and unmatched items.

conflation tool dialog. a list of matched items with the names of various hospitals

conflation tool dialog. a list of unmatched nodes from the HIFLD dataset

Go through the results

All of the matched items may be reviewed for accuracy and perhaps if there is interesting data from HIFLD that is worth adding to OSM (address information, helipad availability etc). However, the most interesting items will be unmatched. This indicates there is a health facility missing from OSM. Here’s a few from this search:

An aerial view of a large building with a red dot showing the location of the HIFLD node. No OSM data present An aerial view of a large building with a red dot showing the location of the HIFLD node. No OSM data present An aerial view of a large building with a red dot showing the location of the HIFLD node. A building outline is present from OSM data

Conclusion

You can now go an map any missing facility as per the usual OSM guidelines.

SherbetS has posted a walkthrough of how they adjust this kind of file to match OSM tagging guidelines. If should help speed up importing process and is worth a read.

Discussion

Comment from wcedmisten on 21 April 2023 at 21:34

Awesome work! I took a look at SherbetS’s walkthrough, but didn’t want to learn how to use QGIS.

Instead, I wrote a script to pre-process the Hospitals GeoJSON into OSM tags where possible. It also uses a python library usaddress to parse address strings, which I think is more robust than the regex approach described in that workflow.

https://gist.github.com/wcedmisten/a6f8b695d4d744c0aedfa2785b5d72f5

After processing the file, I just used the JOSM workflow described in this post to import the data.

Comment from watmildon on 22 April 2023 at 02:34

Lots and lots and lots of good ways to process files into a more OSM shape! If you do thought the import catalog you can find all manner of strategies. Here’s one for an address import up here in the Pacific Northwest.

I am glad it was of use to you. The tooling (JOSM generally, conflation plugin specifically) is extremely powerful but can often be a huge hassle to jigsaw together into a workflow that is efficient.

How much of the HIFLD hospital data did you make it through?

Comment from wcedmisten on 22 April 2023 at 03:36

I got through the state of Virginia today. I should probably document that somewhere…

Comment from watmildon on 22 April 2023 at 03:43

Maybe the HIFLD wiki? Could make a status box for each state similar to what we did for the Milwaukee Import

Comment from SherbetS on 22 April 2023 at 03:55

Okay, I’ve taken a quick look at your recent contributions and python file. I would strongly urge you to go on the OSM Wiki for the HIFLD, and document the process you used to import the data, (execution of the script, any additional steps, visual review, etc.) and add a table with all the tags you converted, what OSM tags you converted them to. There should be some examples I’ve written in the past in the Law Enforcement and Energy tabs.

By the way, thanks for the help. It’s impossible to take on a task of this magnitude alone.

–SherbetS

Comment from wcedmisten on 22 April 2023 at 14:37

Thanks! That page was helpful for how to format the documentation. I added an explanation of my import process and the tag mapping here:

https://wiki.openstreetmap.org/wiki/HIFLD/Public_Health

Log in to leave a comment