As I’ve written before, Meerkat is a really fantastic tool for importing GIS information into Grasshopper. Since many municipalities provide GIS information for free, GIS is an accurate and facile format for introducing geographic information to the GH environment. Meerkat can also be used to provide a framework to translate between geo-spatial and rhino-space coordinates, creating a facile way of mapping geographic locations within Grasshopper.

MeerkatDemo_01
First, use the Import Shapefile module to prep your GIS files to be referenced by Meerkat. All this means is connecting a Boolean Toggle to the Import Shapefile module and double clicking it- which toggles it to true, activating the Meerkat interface.

MeerkatDemo_02
Once Meerkat is launched, use the “Add Shape File” button to select the GIS shapefiles you’d like to work with. If this causes Rhino to crash, go into your Components Folder where the Meerkat files are located and unblock the Meerkat component and all of it’s .dll files. This interface is a fantastic attribute of Meerkat as it allows you to crop out any GIS info you don’t want. Use the rectangle at the top of the screen to select the region you’d like to use, then click Crop Shape File(s).

MeerkatDemo_03

And nothing happens… at least that you can see. Meerkat has saved .mkgis files for you that you now need to reference with the Parse .mkgis module. Use a File Path module to select the correct path(s), and then plug that into the Parse .mkgis module. You may want to turn your Boolean Toggle to False, this will prevent you from launching Meerkat the next time you open your script.

MeerkatDemo_04

You’ll notice that by default Meerkat positions the GIS information pretty far from the Rhino space origin. One trick to make the data more manageable is to center your data at 0,0.

MeerkatDemo_05

Use the Area module to get the centroid of the Bounds in Point Space polyline. If you use the Vector 2pt module to calculate the vector between that centroid and a 0,0,0 point (created here by the Construct Point module set to default values), you can then use that vector to center the GIS geometry (Geometry per Shape) in Rhino space. From here you can just use a Polyline Module to create linework from the points.

MeerkatDemo_06

These steps have created a basemap to work with, but now we need to start positioning geo-spatial coordinates. gHowl’s GEO -> XYZ module does this well, but we need to give it more information before it can run. Use the same vector information we used before to center the Bounds in Point Space polyline on 0,0,0. Explode the polyline, and use List Items modules to isolate the 0th and 2nd point of the polyline. These will become the P1_XYZ and P2_XYZ input of the GEO -> XYZ module.

MeerkatDemo_07

From here, you need to massage the Bounds in Lat-Long output a little to feed it to the GEO -> XYZ module. The Bounds in Lat-Long output is essentially a string of text that needs to be broken in order to read as two points, use the Text Split module to break up the coordinates at the space. From here, use the List Item module again to isolate each point, then plug them into the GEO -> XYZ. Make sure you put the 0th point into P1_GEO and the 1st point into P2_GEO. Run whatever geo-spatial coordinates you’d like into the P input of the GEO -> XYZ, and you are mapping with Meerkat.

  • Carlos Sabogal

    Hi Alex,
    So, I got all the steps right. I have a population shape file. It comes with the shapes of the counties + area per square mile and population per square mile. I got the Plines for the geometry per shape. How can start visualizing and extracting the population per square mile. Nathan says that is a simple as applying a legend for these since field values per shape and geometry per shape are under the same branch. I don’t understand that. Can you please hep me.

  • Carlos Sabogal

    here’s a screenshot

    • Hey Carlos-

      I hope all is well at CCA… Nathan’s right (as usual), because the population data and the PLines are in the same branch system, you could do something really simple like extrude the PLines based off of the population values. In this case, just use the extrude curve module on the PLines and feed the population values into a Z vector module and then into the extrude curve module. This would be a really basic start, my hunch is that you wouldn’t stop there…

      Good luck- let me know if you need a screenshot of something similar.

      Alex

  • Carlos Sabogal

    Everything is well. I think I got it. It crashed but i think I was Impatient. I tried a second time but using the split branch to select only one and it worked. Thanks!!!!! I’ll let you know know if I need more help.