OSM + Rhino + Grasshopper + Elk
This post will walk you through a simple workflow of bringing OSM data into Rhino using the plugins Grasshopper and Elk. The general workflow you will get used to is roughly summarized as follows:
OpenStreetMaps → Rhino → Grasshopper → Elk
This will get you to a good starting point for having a base layer of GIS data that is available from OpenStreetMap. Keep in mind that OpenStreetMap is OPEN SOURCE. Inherently, that means that there is a large community of individuals contributing data to this GIS resource and creating the repository 24/7/365. Through your own data mapping exercises, you can already begin to appreciate the implications of the open data gathering process, both in data richness and in challenges.
THE WORKFLOW
1. Go to OpenStreetMap. This is the website where you will acquire the base data file that you will use in Rhino + Grasshopper + Elk.
2. REMINDER:
- Rhino = 2D\3D modelling
- Grasshopper = parametric design\analysis\awesome plug-in for Rhino
- Elk = animal with antlers and GIS plug-in for Grasshopper
3. Once at openstreetmap.org, use the map to find the area of interest for which you want to grab data.
4. Click on “Export” at the top.
5. On the left, find and click on some blue text that says “Manually select a different area”.
6. Change the size of the area of interest box in the map navigation box to suit your needs.
7. Once the size is set, click on the blue “Export” button on the left.
8. You will get a file download called “map.osm”.
9. Create a working folder wherever you keep your lcabcn2014 data. Please use the same naming protocol that I’ve used in the sample folder that I’ve uploaded.
YOU MUST HAVE A MINIMUM OF A RHINO FILE, GRASSHOPPER FILE, AND OSM FILE IN YOUR WORKING FOLDER.
10. Open a Rhino file. Save it with the naming protocol indicated.
11. Type “Grasshopper” into the command line.
12. Save the new Grasshopper file in the same location as the OSM and Rhino files using the naming protocol indicated.
13. Navigate to your Elk panel.
14. Place a GenericOSM, Location, and Panel component in the Grasshopper definition window.
15. In the Panel you’ve created, enter the file path for your OSM file.
16. Connect the Panel to the P input of the location component.
17. Then connect the O and the X output of the Location component to the O and the X input of the GenericOSM component.
18. Bring in a Polyline component. Connect the P output of the GenericOSM component to the V input of the Polyline component.
19. At this point, you are missing one piece to make the definition visualize data. You should have an error in the GenericOSM component. Hover over the bubble. There error should mention that “K” has collected no values.
20. In order to use the definition, you must have an understanding of the data structure of an OSM file. Within the GenericOSM component, there is a K and V field. K refers to Keys and V refers to Values. Keys and Values are indicators within OSM files that allow you select different types of data from the OSM file to be visualized.
Create a Panel and connect it to the K of the GenericOSM component. Then, within the Panel, type in “highway”. If you spell highways incorrectly, it won’t work. If you use the wrong capitalization, it won’t work. If you don’t use the exact Key that is in the OSM file, it won’t work. You can go through the same process for V (values) to get subsets of data from each K (key).
CONGRATULATIONS! You should now have displayed all of the highway data in your OSM file. Bake the Polyline component. The highway data is now in the OSM file.
Try changing the key that you’ve typed in the Panel plugged into K of the generic OSM to explore the other data in your file.