SHM ArcView Importer

The SHM ArcView Importer is a tool for generating maps from ArcView Shape files and (with a bit more work) their associated database files. It currently works in LW 8.x. It will sometimes work in 7.x, by LScript has a problem with large arrays in 7.x that makes it a bit of a crapshoot.
Why This is Cool
There is a great deal of freely available ArcView data on the internet. In addition to the basic shapes, (like the US County level data shown in the top view) there is a wealth of other data, from Congressional Districts to Crime (do I repeat myself?), crops, earthquakes, watersheds and copious census data contained in database files that can be used in conjunction with these shape files to produce all variety of maps.
What it Does (and Doesn’t Do) Now
Certainly, one of the hardest problems is solved. Reading and displaying in Lightwave the basic shape files, with separate border shapes is currently working. You should be able to take most *.shp files and read them into Lightwave. There is a good start at database integration as well. Loading the shape file also loads the associated *.db file, and shows the database column headers and a few entries. Named regions (like counties) are given surface names that correspond to their database entries.
So for users you can, for instance, download the Counties 2000 SHP File from the US Census Bureau and use it with the plugin to create the 10 mb (!) LWO I used to create this image .
That’s as far as it goes. Currently, there is no interface for altering surfaces or geometry based on the values found in the database. It would be fairly simple to hard-code certain behaviors for specific files, but coming up with a flexible, multi-purpose interface is the next big challenge.
Downloads
Resources for Users
Resources for Scripters
First, the SHM ArcView Importer is released under the GNU General Public License. So have at it. Let me know if you make changes, and I will be happy to link to them, or archive them here, if you like.
Resources for using the ArcView format are a bit tough to find, but I’ve collected a few. Some reference Java applications and other random bits, but this is what I’ve used so far to get the plugin to this stage.
I’d also recommend Ernie Wright’s BinView, a nice binary file viewer that runs from inside Lightwave. Especially nice for diagnosing bigendian/littleendian issues.
Shape File Resources
ESRI Shapefile Technical Description
DB File Resources
Data File Header Structure for dBASE
The Roadmap
How grandious! Really, this is just the basic direction I was exploring with the software, and some features I’d like to get around to adding one of these days.
- Currently, the software only reads Shape Type: Polygon. There are 13 other shape types supported by the file format
- A User Interface for mapping physical characteristics to individual units based on data from the DB file
- Color
- Extrusion Height
- Lables
- For Color Mapping
- ability to set color ranges for value ranges in the database
- Should be able to set ranges by RGB values, HSV, or apply ranges to specific color channels
- Example: US Elections: Map Democratic vote counts to blue channel, Republican to red channel to get a “Shades of Purple” voting map
- Example: Take the above example, and map voter turn out to S channel, so that the greatest voter turn out has highest Saturation
- A simple Expressions engine for creating custom map effects based on more complex data analysis
- Map Projection Correction
- Ability to remap the data in a variety of different map projections.
A couple of notes I forgot to mention.
When Lightwave builds a polygon, it uses the first three points to determine the direction of the surface normal (which way the polygon is “flipped”).
Unfortunately, the GIS Data has a fairly large number of cases (evidently) where the first 3 or more points in the shape are co-linear, all lined up in a row.
When this happens, Lightwave can’t figure out the direction of the flip, and just chooses one.
What this means, pragmatically, is that of the hundreds of counties in a US map, some will be flipped the wrong direction.
So, the best way to fix the problem is to use an LScript like James Jones DSelect to select the backwards facing polygons, then flip them.
Safety tip: The boundaries are made with two-point polys, and these will cause the select-direction plugins to fail (because two-point polys don’t have a facing direction).
So select all the two-point polys and cut-and-paste them to a separate layer before running DSelect.
These problems should be addressable some day, but who knows when that day is.