Beginning a 3-D Site Model with Data From Grographic Information Systems

http://www.gsd.harvard.edu/gis/manual/arcgis2sku/index.htm

忙,闲了翻译一下

 

These days, ost cities have an infrastructure of information representing building footprints, building height information, aerial photography, and information about the elevation of the terrain. These resources are maintained with coordinate systems that permit them to be composited into a rough three-dimensional model of the city. Though many buildings are not adequately represented by merely extruding their footprints, these models may be a good starting place for understanding the massing of an area.

We can easily use GIS to view this 3d information to get a sense of the relationship of a site and its surroundings, but if we want to begin to fix up the representations of buildings, and add other 3d features such as bridges, we can export our 3d data about buildings and terrain form GIS to a 3d modeling package. This has been made into a very simple process thanks to a plugin for ArcGIS that exports data to Sketchup. From here, data can be exported once more into 3d Studio Max, if one should want to go that way.

 

The Basic Procedure

  1. Understand the data
  2. Clip the terrain and image information
  3. Build a terrain model (TIN)
  4. Install the ArcGIS Sketchup Interchange Plugin
  5. Export vector data to SketchUp
  6. Import aerial to SketchUp
  7. Tips for modeling on terrain in SketchUp

Understand the Data

The LIDAR Survey The people of Massacusetts are blessed with a superlative infrastructure of geographic information, which very effectively collected, maintained and made available byt the Commonwealth's Geographic Information System, MassGIS. MassGIS, in collaboration with the Masachusetts Emergency Management Agency collected a three-dimensional scan of the city of Boston and surrounding towns. This laser scan yielded the elevations of the buildings and trees and the ground in between. The original LIDAR point-cloud was processed in several ways to yield, among other things, a First Return raster of even;y-spaced elevations at a resolution of one-meter per pixel, and a vector database recording the Footprints of each building, with its ground elevation, and an approximation of the height of the roof for each footprint for 400,000 buildings. THis sort of data is state of the art, and although many cities are developing this sort of information infrastructure, we in boston are particularly lucky to have this sneak-preview of what is just over the horizon in the GIS world.

Other Data: In addition to the data from the MassGIS LIDAR survey, we are also going to use an orthometrically corrected aerial photograph of Boston purchased from the Boston Water and Sewer Commission. This photo has a pixel resolution of 0.8 feet per-pixel. Even tough the LIDAR survey provides us with a very good terrain model, we find it actually too detailed for our purposes, so we include a clip from the National Elevation Dataset, from the U.S. Geological Survey, which is much smoother at 30 meters per-pixel.

Data Infrastructure: we should pause here to consider how wonderful it is to live in a society where this sort of information is shared! To learn how to download your own clips from the National Elevation Dataset, see Downloading Terrain Models from the GSD's GIS Manual.

Accessing the Data

For the purpose of this tutorial, we have clipped out a section from each of the layers described above so that we won't all be hitting the server simultaneously.

Download the Tutorial Dataset

Right Click Here to download the tutorial dataset Extract this dataset to a folder named landmark in your C:/temp folder.

When connected to the GSD's local area network, you have access to all of these data, seamlessly across the coverage from Everett in the North to Quncy inthe SOuth and Arlington to the West. This is made possible by our Spatial Data Engine server. YOu can find all of this by double-clicking the file, L:/public/geo/gis_demo/detail2d.mxd. Please don't use the server-based version during lab sessions!!!

Words Highlighited like this may be looked up in ArcMap on-line help.

Explore/Understand the Data

  1. Use the Info Tool to click on a building. revealing its Attributes
  2. Open the Attribute Table Note that for each building footprint we have a Roof and a Gnd (ground) elevation.
  3. Turn off the buildings layer and turn on the various raster layers and click on them with the info tool. Note that the gray-scale rasters record the elevations of places on the ground, or on the tops of builings.

Clipping Data for our study area

Even though our tutorial dataset is more-or-less clipped to include Fenway park and Kenmore square, we are going to go through the process of clipping data here for a couple of reasons: First, because when you are working with data from the server, you must begin by clipping your data to avoid making models of the entire reagion. And second, because having your image and terrain model clipped exactly the same is what enables you to get them lined up again when you get them to SketchUp.

Frame the Data

  1. Use the zoom tool to get a frame on your data just inside the current extent of the aerial phoptograph
  2. Use View->Bookmark to save a bookmark for your curent zoom
  3. Use File-Save As... to create a new folder in the c:/temp/landmarks/user directory, where you replace the term "user" with your username. Save your arcmap document in this folder. This will allow yuou to return to just this frame if you need to.
  4. The Working folder you just created will help you keep your source layers in a neat package.

Create a Triangulated Terrain Model

  1. Right-Click on your NED30 layer in the table of contents and choose Dta->Export
  2. In the Export Raster dialogClick the option to USe Extent of Current Data Frame
  3. Choose your user folder for Location
  4. The default name for the GRID dataset that will be produced is ned301
  5. Choose OK. The digital elevation model will be clipped and addes to your map.
  6. Choose Tools->Extensions and make sure the box next to 3d Analyst is checked.
  7. In your Toolbox panel, choose 3d Analyst->Conversion->Raster to TIN
  8. Choose your new ned301 for the input raster,
  9. make sure that the output tin is being created in your user folder
  10. Change your Z Tolerance to 1 meter.
  11. Click OK and wait for your new tin to be created.

Clipping your Orthophoto

Because our terrain raster has a rather coarse cell-size, the edges of our terrain model are not excatly alighed with the edge of your data frame. But when we get our terrain model into sketchup, we will have to regisdter our aerial photo to it. The easiest way to do this is to make sure that your image is clipped to the exact extent of your terrain model. There is a command that should do this, but it seems to be buggy, so we will painstakingly adjust our map scale so that our terrain model is exactly framed by the map window then we will export the image, clipping it to the extent of the view.

Clipping your Image

  1. Right-click on your new TIN model and choose Zoom-to-Layer
  2. Take a look at the scale in your scale window on the top toolbar. It probably says something like 1:1900. Change it to 1:18500.
  3. Keep tying different scales until you get the edge of the tin to line up with the edge of the window.
  4. SAve another bookmark here and Use File->Save->As.. to save your map again.
  5. Now right click on your Orhtophoto layer and use Data_>Export to save a copy of this image, clipped to the current extent, in your working folder, as a tif format

You now have a nicely clipped datset including a matched triangulated terrain model and high-resolution orthophoto! The next step is to import these, and your buildings into sketchup.

Moving Terrain Models, Georeferenced Images and Extruded Buildings from ArcGIS

The meat of this tutorial will be setting the stage for our modeling and analytical project by importing important contextual information from ArcGIS into sketchup. Then we can do some of the same simple modeling experiments on the site model that we have been developing in GIS. THe next tutorial will discuss the more complicated issues of modeling on terrain in sketchup.

Beginning Resources

Right Click Here, open this archive of tutorial data and extract its contents to a folder in your C:/temp directory. This sample data set contains the basic elements required for this demonstration.

Our goal is to transfer our site context model from GIS into Sketchup. In particular, we will work with the following components:

  • A Shapefile containing buildings with attributes for the roof height and ground elevation for each building.*
  • A terrain model in the form of a Triangulated Irregular Network (TIN).
  • An image representing the land cover which has been clipped to the exact extents of the terrain surface.
  • A polygon representing the boundary of your terrain surface

We will open the ArcMap project contained in your tutorial dataset and examine these layers an their attributes. Then we will install the ArcGIS-Sketchup Plugin and export all of this data to sketchup.

Familiarize Yourself with the Data

  1. In your tutorial dataset, find the ArcMap document, Goat4.mxd within the folder user/terrain/goat4. Open it.
  2. Take a look at the attributes of the buildings layer. Note that it has attributes gnd representing the ground elevation at the lowest point of each building. The attribute, roof represents the height of the roof of each building -- which is the hieght of the building itself plus the ground height. To download a copy of this buildings layer for fileds point, Right-Click Here and Open this Zip file.
       

Install the Sketchup Plugin for ArcGIS

You will find sketchup installed on all of the public computers at the GSD, but because of peculiarities of the sketchup arcgis plugin, each user must install the ArcGIS plugin on the computer and load the special sketchup tool into ArcGIS. The resources and instructions for installing Sketcup and the ESRI ArcGIS plugin are available in the GSD software directory L:/public/software/winapps/sketchup. If you are using a lab machine the only thing you need to do is load the sketchup plugin into ArcGIS.

Loading the Sketchup plugin to ArcGIS

  1. Choose Tools->Customize
  2. Click the Toolbars tab at the top of the customize dialog then click Add from File button.
  3. Find the place on your computer where you installed the sketchup plugin files -- which on public computers is c:/program files/@Last Software/Sketchup4/GIS-Plugin
  4. Choose the file, sketchuptools.dll
  5. You will now have an option in your toolbars menu for the Sketchup tools. Check it and the sketchup toolbar will appear.

Exporting your Site Model Components to Sketchup

So, there is a lot of value in this building data and terrain data that we have in GIS. In this case we have built our own terrain model. In other cases we may want to import a model of the existing condition that we can get for free on the web from the US Geological Survey -- see Obtaining Digital Terrain Models from the Web these raster elevatioin models can be quickly turned into TINs using the Raster to Tin

In this case though, we have a TIN and some building polygons. It is suprizingly easy to get this data into sketchup as 3d buildings and 3d terrain. Accomplishing the same transfer between any other GIS package and any other 3d package is nearly impossible. We hope that the other vendors will figure this out, soon! For reasons that will become clear later, we also want to export the rectangle that defines our site boundary. The following steps will accomplish this task:

Exporting 3d Data to Sketchup

  1. IT IS CRITICAL THAT YOU HAVE THE 3D Analyst Extension loaded before you do this! Choose Tools->Extensions and check the box next to 3D Analyst.
  2. Zoom to your boundary layer so that you can see your eintire model.
  3. Turn off all layers except for buildings.
  4. Use Selection->Clear Selected Features to make sure that nothing is selected.
  5. Now use the select tool to select all of the buildings
  6. Now click the button on your sketchup toobar.
  7. In the dialog that appears you will have a list of layers that includes your buildings click Buildings
  8. Below the layer list there is a set of Feature Class Export Options These are how you tell sketchup the 3d properties of your buildings.
  9. Set your Extrude Distance Field to be the Roof attribute for each building.
  10. Set your Offset Field to gnd
  11. In the bottom panel of the Sketchup Export Dialog, you will find the Add TIN button. Click it and select the TIN that we made earlier in the tiutorial dataset that you downloaded at the beginning of this lab.
  12. Now click the OK button. and leve checked the option to launch sketchup automatically.
  13. If you get an error at this step it is because you didn't load the 3d analyst extension. Go back to step 1!
  14. Now Sketchup will start, probably with annoying tip that you can dismiss.
  15. The viewer looks empty, but if you click the Zoom Extents Tool, a magnifying glass with red spots around it at the bottopm left of your screen, you will see the model.
  16. Use the rotate tool to roll it into a perspective 3d view.

Congratulations, your site model has just passed from two-and-a-half dimensionnal world of GIS into three-dimensional modeling world!

Exploring and Finishing your Sketchup Site Representation

Making the transition from ArcGIS to sketchup means that we have some new interfaces and models for data organization to learn. Our goal in this is to have greater flexibility in creating more realistic 3d geometry, and to have better representation of light and shadow, so it will be worh it. What we learn about Layers, Components, Textures, and Shadows will carry over, to a large degree, to other 3d modeling interfaces we might encounter.

  • First we wil learn about layers and how to organize our data on them.
  • Then we will create a new frame to hold our image
  • Import the image
  • Project the image onto our terrain surface Smooth the terrain Surface
  •  

Taking a Deeper Look at Data Organization in Sketchup

We continually stress that the key to sanity when dealing with computers is to keep your data organized logically. The secret to being able to share information with others is to observe conventions in information management. A few minutes spent dhere, looking at how a Sketchup document is organized will help us understand sketchup and make it behave more predictably. In the introductory sketchup demo above, we learned about making objects, using materials, and creating and using components. Now we will look at a higher order of organization -- Layers and we will learn to make a particular type of projected texture that can be draped on our terrain surface to inform it with meaningful colors.

About Components and Layers

I may as well say up front that this is fairly confusing, yet very important to understand how entities, and components and layers are related. This will help us to control exactly what we are editng, and what we aren't editing, what is visible and what is not visible. I shouldn't need to emphasize how important these concepts are. In this exploration we will begin by looking at the layers that are left to us by the export process.

Using the Entity-Info Tool to Understand Layers

  1. Grab your Select Tool (the arrow at the top left)
  2. Click on one of the triangulated areas on your terrain model.
  3. Notice that the Select Layer Picklist at the top right of your horizontal toolbar says Layer 0.
  4. Now click on part of the area on the river. Your select layer window should now say boundary. Your boundary polygon is on the boundary layer
  5. What layer are buildings on?
  6. Click the Layer Manager icon next to the Select Layer pulldown to bring up the layer manager panel.
  7. Practice turning the visibility of layers on and off. It is very handy to be able to hide geometry when your model gets crowded and you want some elbow room. It is also handy that when a layer is invisivle, it won't be selected if you are poking at something close to things in that invisible layer.
  8. You can choose a layer to be the active layer by punching its radio button. The active layer is where geometry will go if you create it or import it or paste it while that layer is the active layer.
  9. Now, Right Click on the colored face of your Boundary polygon and ask for the Entity Info window. Hmm, its a component instance.
  10. If we wanted to change the layer that this component is on, we could choose another layer in ths Layer Pulldown but don't do this. We aren't quite ready for that yet.
  11. IN the entity info window, click on the statistics tab. This polygon is made up of 4 edges and a face.
  12. OK, close the entity info window for your boundary component.

Confusion with Layers, Groups and Components

A confusing situation can come up where it appears as if a component or a group is on one layer, but turning off another layer makes your group or component disappear. This is because the group may be on one layer, but all of the entities in that group may be on another layer. If you believe that this is happening, you can triple-click on the group or component and use Entitiy -Info to check and set the layers for all of the entities so that they are on the same layer as their group or component.

Coloring your Model

The final step in integrating our site information from GIS is to integrate meaningful colors for our surface. An easy way to do this is to create an image that matches the extents of our terrain model, bring this image into sketchup and position it directly under the terrain model, and project this image as atexture onto all of the faces of our terrain surface.

see goat_4.ai and goat4_crop.jpg. Note: the geometry that comes in from arcmap to illustratore has a clipping mask set. Before you can select individual shapes on any layer, you should right-click and release clipping mask.

 

Import Your Clipped Areial Photo

The next few steps will take us through some more basic editing and layer management in sketchup. At a general level, our goal is to import the image into sketchup and position it precisely under our terrain model, then we can project the image as a texture onto our terrain model.

Import your Aerial and Drape It Onto your Terrain Model

  1. Create a new layer named Image and make it the current layer.
  2. Turn off all layers except for your image layer.
  3. Use File->Insert->Image to find the image Goat4.jpg and insert it into your model.
  4. Click your first corner on the bottom-left corner of your image boundary.
  5. Drag the other corner to the top right corner, and click to drop your image.
  6. Turn the visibility of your image layer on and off to check that it is on the correct layer.

Draping the Image on your Terrain Model

The last step in getting our site model set up is to get the image draped onto the terrain and to smooth the terrain surface. We will begin by making a new layer for our terrain model to get this off of layer zero, which is a special default layer which should be reserved for other things. Then we will explode the image opbject which releases each pixel so that they may be projected onto an irregular surface. Then we will select all the faces of our terrain model, and apply the image texture to them.

Drape the Image on your terrain

For our next trick, we are going to Explode our terrain component into its component parts so that it is no longer a component. Then we are going to Explode the image which has a little different meaning. Doing this causes the pixels of the image to remember their planar orientation, but they become projectable which is very handy as we will see. Then, we use ythe Paintbucket tool's alternate identity -- the eyedropper tool to select the image as a texture, then we trippleclick the terrain, and use the painbucket tool to project our image onto the terrain. Then we will regroup our newly colored terrain component, and double-check that we have all of our entites on the layers that they should be on.

Do the Drape

  1. Right-click your image, and choose Explode Your image may drop behind the boundary polygon at this time and seem to disappear. It is still there, just turn off the boundary layer!  
  2. Grab he Paint Bucket tool hold down the ALT key (beside your spacebar revealing the Eyedropper Tool.
  3. Click on the image to extract its texture.
  4. Triple-click the land surface to select all connnected geometry.
  5. Grab the paint-bucket tool and click on the terrain. The image should now project onto the terrain.
  6. Turn off all of your layers and turn them on one at a time to see that you still have the image, and everything else, safely on all of the apropriate layers.

About Smoothing and Surface Normals

Our terrain is made up of triangular faces. Our concern has always been to control their shape and number. We especially want to keep the numbers of triangles low, and to avoid long, acute triangles. But this comes at an expense of having these large distinct facets that are obviusly not smooth,organic looking terrain. Well understanding how surfaces are shaded according to Surface Normals we can learn a neat trick for making our preserving our anatomically correct, geometrically efficient, faceted model appear smooth!

All three-dimensional modeling tools incorporate the idea of using the normals of a surface to calculate the shading intensity. That is, the amount that a face gets shaded, depends on the orientation of the face relative to the direction of the light source. The orientation of the face s established by finding its normal -- which is a formal geometry term which means perpendicular line. In many programs, the normals of a surface only project from one side, which means you can't even see faces from the other side at all! Sketchup shoots normals from bothj sides of faces to allay the panic and confusion that hits usres when their polygons disappear.

The cool thing about this way of modeling light and shading is that even though you have a flat planar face, ther is no reason you can't trick the shader, by averaging the angles of the normals on neighboring faces. This makes the shading appear smoother! This is something that all 3d pachages do.

Smooth your Normals

  1. In sketchup you can do this on your terrain surface by triple-clicking on it,
  2. and then choose Soften/Smooth Edges. I suggest using the Smooth Coplanar option.

你可能感兴趣的:(image,import,dataset,layer,attributes,Components)