Importing OSM data into Grasshopper with Elk



Elk is a set of tools to generate map and topographical surfaces using open source data from and Shuttle Radar Topography Mission (SRTM) data from USGS.
Uses Tool(s) Grasshopper


Step 1 - Install Elk

Elk is a plugin for importing Open Street Map files into Grasshopper. The download for this plugin can be found Here

the Components Folder
  • Once you have downloaded elk.gha, open Grasshopper in Rhino.
  • In the top left Grasshopper file tab, open the Special Folders/Components Folder, and move elk.gha into that folder.
  • Close and restart Rhino.

Step 2 - Bringing the OSM (.osm) file into Grasshopper

The next step is to link your .osm file to the current Grasshopper file. This link will not update to any changes that you save in JOSM, so you will have to re-link the file anytime you've made changes to the map.

the 'file path' component
  • In the main Grasshopper window, find the 'file path' component, located in the Params\Primitive tab, or by typing 'path' into the keyword search.

assigning a file path
  • Right click on the path component and select 'set one file path', and then assign your .osm, which should turn the component green.

Elk 'Location' component
  • Once the file has been linked, you'll need to navigate to the Elk toolbar located in the Grasshopper 'Extras' tab. Create a component called 'Location', and connect the path component to the 'P' parameter on the left side of the location component.

Elk 'GenericOSM' component
  • Create a 'GenericOSM' component from the Elk tab, and connect the Point data 'O' and OSM data 'X' parameters from the right side of the location component to their respective inputs on the GenOSM component.

Step 3 - Getting to your data

retrieving data
  • In order to access the data from the imported .osm file, you need to use the tags that you created in JOSM. A lot of the information gathered from Open Street Map will already have tags associated with it, but is not necessarily what you'll want things to be called, so feel free to change these prior to importing.
  • We can call out the needed data by creating a panel, and inputting the desired tag. This will filter the wanted points from the point data, but will not output polylines, so you can create these in Grasshopper with the 'Polyline' component.
  • In order to grab multiple tags at once, you can input more than one into the panel. However, there seems to be a bug in the current component, so rather that switching to a multiline data option in the panel, leave it as is.