GIS to 3DS Author: Daniel Belcher ( firstname.lastname@example.org )
Instructions for converting/importing GIS building and terrain shapefile data into 3DstudioMax, VIZ, Rhino, etc.
Before you begin: The process of converting GIS building and terrain data into an editable 3D model is not a straightforward task. However, it is possible...and once you understand the process, it becomes a relatively simple task. The basic idea is to use GIS data, including non-graphical data fields like ‘APEX' and ‘ELEVATION,' to create a 3D model that can later be edited with various 3D modeling software. For buildings, the method is to translate the building footprints (from the GIS shapefile), to their appropriate altitude (resting on the ground), then to extrude the footprints to their appropriate height (the apex of the building), and then export it all as a VRML geometry. For terrain, the method is to convert a contour map into a TIN (Triangulated Irregular Network), then to a Raster image, then back to a TIN, and then export it as VRML geometry.
Disclaimer: This may not be the most elegant or efficient manner of conversion out there, but it does the job. Please e-mail me if you know of a better method.
Sample Data: You may want to try the following tutorial using our sample data, to get the hang of the process before you try another site.
PART I - Selecting and Cropping in ArcMap
1. Download the sample data in the archive listed above.
2. Decompress the .ZIP into a convenient location (such as a “temp” folder on the desktop).
3. OPEN ArcMap 9.1 or better.
4. Click the Add Layer button.
5. In the Add Data menu, highlight and select both building_sample.shp and contour_sample.shp. Both of these shapefiles will be added to the Layers Manager (on the left of the screen) and appear in the main viewing window. You may want to drag the building_sample layer above the contour_sample layer so that the buildings appear above the contour lines.
...the you should see something like this appear in the Map window (colors may vary):
6. CROP. You may notice that the area in question is rather large. For most purposes, you will want to crop out an area and throw away the rest. If possible, it is best to divide large areas into smaller “chunks,” so that process of exporting and importing the VRML (see below) is manageable (WARNING: large geometries make very large VRML files). For this example, we will focus on the UW campus (everything east of 15th Ave) and crop out the rest of the neighborhood.
a. Click on the contour_sample layer. Use the selection tool to highlight the areas you want to save into a separate shapefile.
b. Right-click the layer name in the layers browser. Under the ‘Data' menu, select ‘Export Data':
c. Give the shapefile a new, more recognizable name (such as contour_crop, and then save):
When prompted, add the new layer to the current map and remove the old contour_sample layer (right-click the layer name and then Remove)
d. Now click on the building_sample layer. This time, you can select only the buildings that intersect the contour lines. Under the 'Selection' menu, click 'Select By Location':
In the 'Selection By Location' menu, select features from the building_sample layer that 'intersect' the features in the contour_crop layer:
Once the buildings are selected, simply repeat the ‘Export Data' instructions in steps a., b. and c. (above).
Note: if you make mistakes selecting objects, you can change your Selection Method to add or subtract elements within your selection. To change your Selection Method, go under the 'Selection' menu and change the 'Interactive Selection Method':
e. Repeat this process with each layer you wish to work with (if you are doing only buildings and terrain, then you only need to do this twice.) It is important that each layer be saved separately into a shapefile (for this example, terrain in one shapefile, building footprints in another). By this point you should have a map that looks something like this:
7. CLOSE ArcMap. (You may want to save the map, but all you really need are the shapefiles you just created).
PART II - ArcScene
8. OPEN ArcScene 9.1 (or better).
9. As in 4. (above), click the Add Data button. This time, only add the cropped shapefiles (building_crop.shp and contour_crop.shp) to the Scene. You should see something like this:
10. CONVERT TERRAIN TO 3D. We'll begin with the terrain. This process is a bit tricky. The general idea is to convert the contour lines to a TIN (Triangulated Irregular Network) and then to a VRML file. However, simply converting to a TIN with ArcScene produces overly detailed geometries in which every point on every contour is connect to every other contour line. This is unnecessary, but there is a workaround which requires converting the contour to a TIN, then to a Raster format, then back to a TIN, in the process loosing some of the detail, but preserving the terrain characteristics…
a. Verify that the 3D Analyst Toolbar is turned on...
b. Click and highlight the contour_crop layer in the Scene Layers manager on the left.
c. Under the '3D Analyst' Toolbar, under 'Create/Modify TIN,' select 'Create TIN from Features':
d. In the 'Create TIN from Features' menu, check the contour_crop layer, verify that the 'Height source' is set to ELEV, and give the tin a new name (such as contour_tin1 ):
e. The resulting TIN should appear in the Scene. Remove the old contour_crop layer from the Scene (right-click on the layer name and select 'Remove').
f. Click and highlight the contour_tin1 layer in the Scene Layers manager.
g. Under the '3D Analyst' Toolbar, under 'Convert,' select 'TIN to Raster':
h. In the 'Convert TIN to Raster' menu, set the 'Cell size' to a setting that gives a reasonable number of Rows and Columns. There is no hard and fast rule for this, but something that is under 1000 Rows and 1000 Columns is safe. Generally speaking, the smaller the cell size, the more detailed the terrain. Next, give the new raster layer a name (such as contour_rast):
i. The resulting Raster image should appear in the Scene. Remove the old contour_tin1 TIN from the Scene (right-click on the layer name and select 'Remove').
j. Click and highlight the contour_rast layer in the Scene Layers manager.
k. Under the '3D Analyst' Toolbar, under 'Convert,' select 'Raster to TIN':
l. In the 'Convert Raster to TIN' menu, set the 'Z tolerance' to a reasonable setting…again, there is no hard and fast rule for this, but something that is between 5 and 10 ought to work. The smaller the Z unit value, the more points in the TIN. Next, give the new TIN layer a name (such as contour_tin2):
m. The resulting TIN should appear in the Scene. Even though the TIN is less detailed version of the original contour, the features should be accurate enough for terrain modeling. Also, it is possible to apply some smoothing to the terrain surface in 3DstudioMax, VIZ, Rhino, etc., after the conversion process.
n. Remove the old contour_rast layer from the Scene (right-click on the layer name and select Remove).
11. CONVERT BUILDINGS TO 3D. Now on to the buildings. Compared to the terrain, this process should be more straightforward.
a. Right-click the building_crop layer in the Scene Layers manager on the left. From the menu, select 'Properties':
b. In the' Layer Properties' menu, click the 'Base Heights' tab:
c. Under Height, select the second radio button option 'Obtain heights for layer from surface.' Verify that the contour_tin2 (our terrain TIN) surface appears in the path below. This will move the building footprint base heights up to the surface of the terrain:
d. In the 'Layer Properties' menu, click the 'Extrusion' tab:
e. Check the box in the upper-left to turn on 'Extrusion.' Under 'Extrusion value or expression:' enter [APEX]. Apply the extrusion by 'using it' (in this case, [APEX]) 'as a value that features are extruded to.' This extrudes each building footprint up to the stored [APEX] height in the shapefile. Click Apply.
f. Your resulting Scene should look something like this:
12. EXPORT EVERYTHING TO VRML. Once you have the Scene how you like it, you can export it to a VRML file. It is important that you export both the buildings and terrain as separate VRML files. This is a simple process…
a. Export the buildings. Check the box next to the terrain layer in the Scene layers manager to hide the terrain. Only the buildings should be visible.
b. In the File menu, under 'Export Scene,' select '3D':
c. Export the buildings as a VRML file (.WRL extension):
d. Now turn the terrain layer back on (check the box in the Scene layers manager), and turn off the buildings. Now, repeat the Export steps above (a., b. and c.) for the terrain.
NOTE: depending on the complexity of the scene (number of vertices), the conversion to VRML may take some time. However, if you cropped the scene as outlined here, and made sure the 'Cell sizes' and 'Z tolerance' on the terrain conversion (see steps 10.h and 10.l above) are set to a reasonable value, this should not take more than a few moments (depending on the computer you are using).
PART III - 3DStudioMax, VIZ, etc.
13. IMPORT INTO MODELING SOFTWARE. Depending on which modeling software you choose to use, the process for importing the VRML files varies accordingly. In 3DstudioMax and VIZ, you simply choose 'Import' from the File menu, and import each of the .WRL models separately and merge them into one scene. You may prefer to delete the default VRML lighting and cameras.
14. APPLY MODIFIERS. Depending on which modeling software you choose, you may need to apply some modifiers to get the buildings and terrain to display correctly. For example, in 3DstudioMax and VIZ, the imported terrain may have normals that point the wrong direction (you will notice this if the terrain looks like it is upside-down). This is an easy fix, select the terrain geometry and then apply the 'Normals' modifier from the Modifier panel to flip them around. The imported buildings may also require that you apply the 'Cap Holes' modifier to fill in any holes in the geometry as a result of the VRML conversion.
15. SUCCESS! (Hopefully) You've finished the conversion process. You might notice that, as expected, the buildings all form one giant geometry, making it difficult to drag individual buildings around. This is a minor inconvenience, but you can work around this by converting the building geometry to an 'Editable Poly,' and then selecting each building and moving it around within the scene. Best of luck!