EnjShape is a pure Ruby plugin for Sketchup that allows you to import ESRI Shapefiles.
Download:
enjshape.zip
browse source
Usage:
1) Make sure enjshape.rb and the enjshape directory are in your Sketchup plugins directory.
For me this is:
Windows -
C:\Program Files\Google\Google SketchUp 6\Plugins
Mac OS X -
/Library/Application Support/Google SketchUp 6/SketchUp/plugins
2) Go to Preferences -> Extensions and activate the plugin ENJ’s Shapefile Importer
3) Go to Plugins -> EnjShape -> Import Shapefile
4) Open a Shapefile!
Functionality:
Currently supported Shapefile types:
Point
Arc (PolyLine)
Polygon
If your shapefile is in WGS84 (LatLong) it is converted to inches (but still georeferenced)
Polygons must be “flattened” or planar in Sketchup, so we project the data onto the XY plane by setting Z value to 0 after being converted to inches. You have the option to do this to other shapetypes.
If your shapefile is already projected to a 2d coordsys you can just specificy whether the units are in feet/meters
Shapefile -> Google Earth
1. Open Google Earth
2. Open SketchUp
3. Import (latlong) shapefile into SketchUp using EnjShape
4. Use the “place model” tool to put the model in Google Earth
5. Click on the model in the Google Earth navigation to zoom to the model
6. In SketchUp click the “get current view”
7. Now you can use the “toggle terrain” tool to accurately edit the imported shape for use on Google Earth
Testing:
I don’t have use cases for a lot of the shapetypes. They are implemented according to the shapefile spec, but may have bugs. If you run into one please contact me and give me sample data so I can debug.
Polygons with holes aren’t implemented yet.
Push/Pull from dbf field is implemented but not very well tested.
Also I don’t have much experience with SketchUp, so if things could be better with grouping/naming or something I’d like to hear about it.
Example:
I imported the footprints for my campus, then manually (and randomly) push/pulled them to demonstrate.
campus.kmz
Shoutouts:
Props to SwaJime for swa.rb which taught me a lot and gives the latlong converting functionality through his LLAtude class.
Thanks to the one who pointed out I could write this myself instead of waiting.
-Ian Johnson
enjahova -at- gmail.com