Creating AutoCAD Text from Geospatial Datasets

In this tip, I’m going to convert attribute information from a data set in ESRI Shape format, and create a text label from that attribute. There are a couple of techniques, but in this case, I’ll show a quick and easy technique to create AutoCAD text labels from a connected shape dataset using an FDO connection.

Start with a new drawing, assign the coordinate system and create a connection to the data set to label.

Add the data to the map, and the dataset will show up in my Display Manager.

Once the data connection established, create a style and hit the feature label option. This will open the Style Label dialog box where all the settings are to get the labels to look the way you want.

 

Going down the dialog box, set the Multiline Option (the Advanced Placement option will set the text to follow the line, which you may want for certain conditions, but the text can end up in separate text entities for every letter – that may be ok – it depends on what you are looking for).

The next item is to identify what property (attribute item) you want to use for your label. If you have an attribute that is exactly what you want, you can set it and be done. In some cases, you may want to modify the value or even combine several elements of the text. To add pipe sizes, take the size and add an inch symbol (the double quote) – so an 8” line will read 8”. You could add material so the label reads 12” PVC, or if doing street names, you might want to combine the street number, direction, name and type to get a complete street name. To modify this, select expression here. This will open the Map Expression Builder dialog box.

There are a lot of options for creating text labels from data, calculations, or other elements. In this case, I want to place some text elements together. The function to combine text is concatenate, which I can find under the text functions under Concat.

Selecting the function places the text and format in the expression window. The function works on the elements contained in the following parenthesis, and the bracketed text property are place holders for the text elements. To get the pipe size and combine it with an inch symbol, replace the first Text Property with the value for the size, and the second with the “ symbol (surrounded by single quotes to show it’s a text value – ‘”’). You can continue to add pieces of text until you get the desired label. To add attribute values, such as the size, use the Property menu and the list of attributes will be there sorted by the type of field. I’ll select the size, and complete the expression – Concat ( SIZE , ‘”‘ ). For street names, an expression might be concat( ST_DIR, “ “, ST_NAME, “ “, ST_TYPE) where the “ “ is used to add spaces between the fields.

You can use any combination of data fields and other elements to create a label with this expression process.

Once the expression is set, you can set the display parameters such as size, color and font. Remember with the size, Map Space is scale relative to the model and set the height to a specific value, while device space is relative to the monitor, or view, and will change the physical height based on the zoom scale.

Once the labels are set how we want them, we can go to the Display Manager and select Save Current Map to DWG from the Tools menu.

After saving to a new drawing file, we can open the file and the labels are now standard AutoCAD text items along with the roads. The process actually takes more to write about than to actually do.

Next post, I’ll go the other direction. I’ll show how to grab labels and turn them into attributes.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Getting Your Results – Using Network Topologies

One of the important tools that AutoCAD Map 3D includes is the capability to work with topologies. It can create and manage them, and more importantly, do analysis from these topologies. Basic training classes, and all of the books I’ve seen, show how to create, manage and perform analysis with topologies.  One thing that is absent, is how to take advantage of and access the results after the analysis – it’s the cause of a lot of questions from people I work with.

Before I get on to working with the results, I want to give some background of topologies, and how AutoCAD Map 3D manages them.

Topology is a technique for managing spatial relationships between objects. It is a particularly useful technique for managing networks of objects, such as utilities or streets. The relationships allow you to trace up- or downstream to answer questions, such as:

  • What customers will be out of power if this line is down?
  • What is the likely source of contaminant (common point upstream) when there are a series of sites that are showing high levels of contaminants?
  • What is the shortest route between two locations?

The relationships are created by maintaining unique identifiers for each point or junction and line in data tables. These identifiers are called Primary Keys. The lines will also contain fields to include the identifiers of the points from each end of the line. These are called Foreign Keys. By searching for lines that have a specific point identifier, you can find all the lines that connect to a point, and go from point to associate line to associated point to associated line, etc, much like a monkey swinging from one vine to the next.

Consider the example below.  Here is a collection of lines and points. There is graphic representation of the network, and a snapshot of the data tables from the network. Look at point # 2364.  It appears to be the end of

that particular network stream. We look for all of the lines that have either a start point or end point value equal to 2364, and we find that line # 6888 has 2364 as an end point. We then look at the other point value and find it is 2359 (the start point and end point allow a topology to show direction as well as just connections), so we search the line table for other lines that have that value. We will find line #’s 6887 and 6921. We can then continue in this process until we get the results we are looking for.  For a best route, we will evaluate the potential sets of lines that provide a connection between the two points, and use some criteria to determine the best (usually the shortest lengths) set or route.

AutoCAD Map 3D provides tools and the data structures to create and manage topologies, as well as topology analysis tools. Within the Task-based Workspace, the topology commands can be found on the Object Map ribbon on the Topology panel.   The only thing required to create a network topology is a clean network of lines (clean means that the end of one line exactly meets another line – their coordinates should match). Map 3D will create points (called Nodes) at the junction points if they don’t exist in the data.

Once a network topology is created, Map 3D will create Object Data to manage to topological relationships. The nodes will get a table called TPMNODE_topologyname (where topologyname is the name of the topology). You can use the Edit Object Data command (The Object Data panel of the Object Map ribbon) to select a node and review the table information. The ID field is the critical element (the resistance values can be used to manipulate the analysis – for example, the resistance on a point could be a time factor for an average stop at a stop sign so route can be qualitatively compared including stops, turns, etc).

You can also see the values of the object data by selecting an object and reviewing the Properties (on newer versions of map 3D).

The lines (Map 3D calls them LINKS) will get their own set of Object Data, called TPMLINK_topologyname. The line (or link) object data will include additional fields. The critical elements are the Start_Node and End_Node fields, which are how Map 3D manages the topology relationships.

 

The purpose of creating and managing topology is to perform analysis, and the tools are also available on the Topology panel of the Object Map ribbon.  The three network analysis tools are Shortest Path, Best Route and Flood Trace.

When completing the analysis, you have the option of highlighting the results with a color (it will go away with the next redraw), or save to a topology. You will give the results a name (my example attached was a flood trace, and I named the resulting topology FloodResults).

 

Once the topology is created, I can always re-highlight the topology, but it goes away with each redraw. That makes it a bit difficult to use for further analysis or to even print the results.

The easy way to work with them at this point is to save the drawing with the result topology (or topologies) and open a new drawing. In the new drawing, use the Map 3D drawing attach tools to connect to the results drawing.

In the Map Explorer of the Task Pane, the topologies from the attached drawing will be visible in a greyed out icon. This means the topology hasn’t been loaded into the current drawing.

Right-click on the result topology and select the Load Topology option under the Administration menu.

This will open a dialog box with the option to Create objects when loaded. Selecting this will recreate the topology objects in the current drawing, essentially making a copy of the topology data from the original file.

You may have to Zoom Extents to see the newly created data.

At this point, we now have just the objects and topology from the result topology we created. We can save this and have it available for future applications and uses, such as printing route maps or performing buffers, etc. In addition, the objects will have not only the object data from the results topology, but it will also have the data from the original topology and any object data from the original objects.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Some new AutoCAD Map 3D Installation Help

Katie Jacques from Autodesk has posted an item on the new Installation & Licensing forum listing some new videos for installing Map 3D 2011. It covers network and stand alone installs, creating deployments and post install tasks. So if you’re planning your upgrade, it could prove to be quite helpful.

Check it out!

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Autodesk Opens New Support Page

Pete Kelsey shared the link to the new page on his blog.  This new site is all about installation and licensing. It includes documentation, troubleshooting helps, videos and more. It should be a great resource.

Check it out.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

More Map 2011 info

Katie Jaques, the GIS Technical Lead in Product Support for Autodesk, is sharing some details on the new AutoCAD Map3D 2011 release - new FDO providors, and one I’m really looking forward to – Windows 7 compatibility. I made the move a few weeks ago, and I’d like to get out of the Virtual XP mode.

Check it out.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Hello, Map 3D 2011, What’s Up?

The new 2011 version (or is that “oh-eleven”) of AutoCAD Map 3D has some unique new features.

Groups_DrawOrder

Group Draw Order

Some are not visible, such as Autodesk reworking the memory usage and making it more efficient, to visible items, such as moving the Group and Display Order toggle to it’s own place on the Task Pane.

The most substantive impact came with the incorporation of the tools to read LIDAR, or point cloud data. Subscription users got a sneak peak at this with the Subscription Advantage Pack (SAP) late last year. I commented on this in my blog right after last year’s AU.

pointcloudribbon

Point Cloud Ribbon

PointCloudTaskPane

Point Cloud Task Pane

Now the tools to display and work with point clouds are built right into the ribbon, and have been combined into the Data Connect button on the Task Pane (in the SAP, you had to go to the tools button to work with indexes before you could add point cloud data from the Data Connect button).

When I first tried to use the add point cloud data option, I struggled with adding it because I didn’t realize I had to first go to the tool bar to generate an index first. Now it’s a little more intuitive.

multcoordtrack

Multiple Coordinate Tracking

One of the primary applications driving the use of Map 3D was the capability to manage projections and coordinate systems. You can establish a coordinate system for your current drawing and bring in drawings or data sets from other coordinate systems and Map 3D will project them into the current drawing’s coordinate system. Along with this is the useful capability to “track” coordinates. The Track tool allows you to identify (or digitize) the location of the cursor in a different coordinate system. For example, I may want to get the latitude and longitude of radio transmitters for a FCC permit, but my mapping data is in a UTM system. I can use the tracking tool to capture the latitude and longitude without having to reproject the data. Likewise, if someone gives me a location from a GPS that is in lat-long and I want to add it to my UTM-based map, I can use the tracking tool to place the point. Well, in 2011, the tracking tool has been expanded to add multiple systems. You cann add additional “trackers” to the dialog box to get several on there as once. This can be really helpful to some of us working in several coordinates all the time (such as UTM, State Plane and Lat-Longs).

One new set of features dosen’t really extend the software, but may make it easier for users to take advantage of the tools. There are a number of new “assistance features.” Right on the startup screen, there are links to videos for several tasks available.

Welcome Screen Helps

Welcome Screen Helps

That’s a short list. There’s a number of others, such as the ability to add grids and graticules, better overlay analysis (can handle a significant higher volume of features), and adding more capability to the Workflow tools (you can now add AutoCAD commands to your workflows).

So there’s some great reasons to look forward to making the transition.  Not to mention all of the new AutoCAD features – Isaac Harper blogs about them here. See you on the other side!

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Try Out a Map Book

On the TasMapBookTabk Pane of AutoCAD Map 3D, there is a series of tabs. I spend a lot of time demonstrating and talking about the first two, but I don’t spend much time on the third one – Map Book. The Map Book tab is simply a set of tools designed to help users generate an easily reproducible set of printed maps. It will generate a standard AutoCAD Sheet Set, but will include some tools specifically designed to simplify setting up a grid-based Sheet Set, complete with a key map and navigation features.

 

 

 

 

MoreMapBooks

You can also have a number of Map Books defined. You may want different books for different utilities, or you may have different scales needed for different map sets. Moving back and forth is just a matter of selecting the appropriate map book at the top of the task pane.

 

Before creating a new map set, you need to make some decisions. You will need a template drawing file with a layout defined with a title block, and if desired, the adjacent navigation blocks, main, key view and legend viewports. There are a number of templates to use as examples that come with Map. You can find them with the other templates in \Documents and Settings\\Local Settings\Application Data\Autodesk\ AutoCAD Map 3D 2010\R17.2\enu\Templates. These templates may net perfectly suit your specific application, but they can give you some ideas.

PlaceholdersToolYou can open one of these and use the Identify Template Placeholders command from the Tools button to look through the settings.

 

Once you have everything ready, you can use the New button to start a new map book. As with most things Map, you will get a workflow-based dialog box. Go through each section of the dialog before closing the dialog or hitting the generate button.

First, you’ll set a name in the Source. You will select Map Display if you’re plotting objects from the Display Manager (primarily FDO connections) and Model Space if you’re selecting AutoCAD Objects. Remember, you can add Objects from model space into the map display.

Your next step is to select the template drawing file, with the Layout and Title Block you’ve setup. At this point you can add the links to adjacent sheets. You will also set the scale here.

TilingNext, you will set up your map grid using a Tiling Scheme. You can set the grid based on the size of the map (area), by the number of sheets you want, or by selecting a premade grid made from existing closed polylines. You can also set a map overlap, so that you can have a strip of surrounding area. You do that with a percentage.

 

 

 

If you want to create an overlap, and still keep scale maps (I’m not sure who wouldn’t), a friend of mine, Jeremiah McKnelly wrote a great tip for getting true scale map books with an overlap. Check it out here.

NamingThe next step is to set a naming scheme for your grid. You have several options based on numbers, letters, or you can even use data from the drawing using the expression builder.

Next you can define your key drawing. You can use premade keys, or generate one on the fly by selecting the layers you want to show.

You can then add a legend where map will setup the viewport if you’ve already created a legend, or you can set up a space to add one later.

Finally, you get to define where you’ll put your sheet set definition file (.DST).

TilepropsAfter all this, your Map Book tab will now display all the sheets with their views. You can check the properties of one of the views to see the adhacent sheet information stored. You will also see all of your new layouts, all named and ready to go.

 

 

 

The process allows you to very quickly layout some simple sheet sets with very minimal effort. If your organization needs to plot map books or sets of printed maps, this may be the right tool for

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Losing Your Religion: Interoperability with AutoCAD Map 3D and ESRI, Part 2

A little while ago I started this interoperability discussion by discussing the similarities between CAD and GIS, primarily Autodesk’s AutoCAD and ESRI’s ArcGIS. Now I’ll talk about the critical differences between them, or at least the data formats.  These differences are critical to understanding how to manage interoperability.
There are two primary areas of difference.  One is the data structure paradigm, and the other is the graphic representation. AutoCAD drawings and ESRI data sets store data in fundamentally different methods. They are both forms of databases that store information about the location, properties and appearances of the various objects, but because they have substantially different requirements, they have to organize the data differently.
 

Data Structure Paradigm
CAD is used for all types of drawing. The CAD drawing file is essentially an object-oriented database which stores objects sequentially (essentially as they’re drawn). Each row of data will represent an individual CAD primitive object.  The structure of the data and the number of elements is dependent upon the type of primitive. For example, a point is going to carry a single coordinate pair (X,Y) for its location while a line will store two coordinate pairs – a start point and an end point.  A curve will have a start point, an end point, and a bulge (or curve) factor. Along with that, there are additional data elements describing the color, line type, layer and other properties.

Entity ID Line St Point End Point Layer
Entity ID Point Ins Point Layer Color
Entity ID Block Ins Point Layer Color
Entity ID Arc St Point End Point Bulge

An ESRI GIS dataset, whether it is a shape file, geodatabase or personal geodatabase organizes the data into more formal structures, in the form of tables (this is simplified to a conceptual level – each of these data formats include several files or tables to complete the dataset, but are not really germane to the discussion). Different primitives, such as points, lines and polygons can’t reside in the same set of tables. In addition, the number of data elements in each row will be consistent with the dataset. Points representing valves will be in a different table than the lines representing the pipes they’re attached to. The tables will be divided based on some set of business rules to organize the data. In the ESRI terminology, this is essentially a Feature Class. For example, water, storm and sanitary sewer lines may all be in one table, or they may be divided into 3 or more tables. The division may be due to organization, or due to the different information needed for each group. Many times within each Feature Class, there will be a further subdivision of objects, such as high-voltage conductor and low-voltage conductor, called a Subclass. Typically the subclass will be the level of organization used to symbolize the objects. The result is a very structured organization of data.

Feature Class (Pipes – Lines)    
ID Shape (BLOB) SIZE MATERIAL IN USE
ID Shape (BLOB) SIZE MATERIAL IN USE

 

Feature Class (Vegetation – Polygon)  
ID Shape (BLOB) SPECIES AGE AVG DBH
ID Shape (BLOB) SPECIES AGE AVG DBH

The analogy that I typically use, and it seems to fit, is that the data sets are like a collection of coins. My AutoCAD file is like a pile of change and my ESRI data file is like the same group of coins all organized into paper tubes.
coins

 

 

The take away from all of this is that an AutoCAD drawing will store multiple data types in a single drawing file, while the ESRI data sets will store multiple data types in multiple tables (and/or files). This is a critical point to managing interoperability.

 

Graphic Representation
The other major area of difference is with the graphic representation. The AutoCAD drawing includes information regarding the appearance of the objects. For example, a line will include the color, line type, and thickness. Each of these properties is inherent in the primitive object. These properties define how AutoCAD will display the file. If I pass the file to someone else, and they open it, it will look the same.
ESRI datasets are a different case. The datasets are not related to the appearance of the data. The appearance is left up to the application at the time of display. ArcGIS, for example, stores the appearance of a map in a Map document, which contains pointers to the data, describing what data to select (allowing a subset of the data through a query) and how to display it. It is the map document that contains the symbolization information, such as linetype, color and stylization.

viewing
The Result
These two differences present the primary difference to interoperability. Neither one nor the other is inherently better – they have different ways of achieving similar results.   The data organization presents some challenges when bringing CAD data into GIS tools, for example, when reading an AutoCAD DWG file in ArcGIS, it reads the data as if it were ESRI datasets, and groups objects by their primitive forms, such as lines. That’s different than the way CAD users think of and manage the data. Additionally, CAD drawings typically contain information that doesn’t fit into the GIS data model. The separation of the data from the symbolization is what allows GIS systems to display the same information is many ways depending on the view or analysis needed. This also makes it a little more difficult when transferring data between systems. There is no direct method within AutoCAD to read the Map document to get the shortcuts and symbolization and replicate an ArcGIS map without recreating the symbolization. In most cases this is not really an issue because the data is the important part, although it can be problematic when you want to reproduce the entire map.
There are some other differences between systems that are important to be aware of, such as shape files not dealing with arcs (causing arcs to be broken into many small lines), and single or double precision data differences. These are important to be aware of, but not as critical to the basic interoperability of the systems.

One of the reasons I like working with Autodesk’s AutoCAD Map 3D  product is that it provides me with both worlds. It is an AutoCAD drawing, and with the Feature Data Objects connectors, I can work with the ESRI datasets natively without having to make any changes in the way I work with these disparate data types.

In most cases, there are business issues that interfere with interoperability that have a much greater impact than these technical software elements. I’ll explore those in a future blog.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Where’d My Property Go: Finding data during Splits and Merges

 

One of the challenges when working with geospatial systems is managing the data attributes when the object is split or combined with another. For example, if I have two parcels that are joining, and they have different Assessor Parcel Numbers (APNs), how do I get just one new APN from the 2 previous APNs. And what happens to the area field? Or when I split a parcel, how does the system name the 2 new parcels? More importantly, that about the ID field that serves as a key to link to other databases. The answer is that you can pretty much set it to do what you want. AutoCAD Map incorporated split and merge tools so that you can manage them. The following example should give you an idea of how to get started. The important thing is that like most things GIS, putting some thought into it prior to trying to do the work will give you the best results. In other words, design is very important.

My example will use a proposed forests data set. I have attributes for the proposed name, the area, perimeter, and the area in square kilometers and hectares. During the join, I want to rename to proposed forest, and update the area and perimeter fields.

NOTE:  As I go through this, keep in mind the terminology gets wonky. The same words can be used to describe multiple elements of these objects. For example, the attributes of a feature can be called attributes, properties, fields and columns (to us database geeks), and the properties describing the said attributes, such as field size and type, can all use the same names. So, try not to read too much in the wording and I’ll try to match AutoCAD Map’s terminology.

To set the Split and Merge Rules, I will highlight the target data set in the Display Manager and open the Data Table. 
OpenDataTable

 

 

 

 

 

 Once I get the Data Table open, I’ll select the Options, and select Set Split and Merge Rules.

 
SelectDataTableOptions

At that point, I’ll get the Split and Merge Rules dialog box.
SMRulesDialog
At the left of the box, I get a list of all of the feature properties of the selected data set (attributes or database columns). As I select each of these properties, I get the various attributes of that property. It identifies whether the property is an Identifier, the data type of the property, whether it is autogenerated, read-only or nullable. In addition, I can set Split and Merge Rules for each property attribute. Keep in mind, the available Split and Merge Rules are context sensitive based on the data type (it’s a little tough to sum text fields).

The data set I’m using is an ESRI shape file, so there are certain feature properties that are inherent because of the type of data set. The FeatID is autogenerated and read only, so I won’t be able to set any rules for this one.

My ID field is an identifier for the individual forest polygons. I’ll set my Merge Rule to Empty. When merging, I’m going to create a new and distinct record from the previous record. This is a business rule I’ve decided upon so I can keep a history of forest proposals, even if they are not actually implemented.

My area field shows the area of the polygon. I could add the polygons, but for better results I can use an expression to calculate the actual area of the result. To do this, I set my Split rule to Calculation, and select the Expression Builder button (next to the Exporession box). I’ll select the Area2D from the Geometric pull down,

expressionarea
And then Geometry from the Property pulldown.
expressionGeometry

The resulting expression, Area2D(Geometry) , will calculate the area of the new polygon (if you know the expression, you could just type it in the box rather than going through the expression builder – but if I had done that, you wouldn’t have seen it, right?). That expression will go into both the split and merge rules.
My next feature property is the Perimeter, and guess what? There’s a calculation for that as well. Select Length2D in the Geometric pull down to get this expression:  Length2D(Geometry)
On the Name feature property, I will generally not use the existing names – again a business decision. There are cases where I would want to keep one of the names (Using the FirstSelected or LastSelected rule) or concatenate the two names, just not for this case. In my example, I would need to add the name manually after doing the merge (or split).
My next feature property is AREASQKM, or the area in square kilomters. I can use the same expression as before, but include the conversion to square kilometers, giving me this expression: Area2D(Geometry)*0.00000009290304. Again this will apply to both split and merge.
My last standard property is HECTARES, which is the area in hectares. This will match the previous bit with the appropriate factor:  Area2D(Geometry)*0.000009290304

Of course the last entry is Geometry, and you can’t use rules on geometry,

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

Adding Custom Linetypes

  My last post was on the linetypes for feature objects in map 3D. There are a lot of options, but it isn’t as open as using AutoCAD linetypes. You can create additional stylization, but it takes rolling up your sleeves. My next post was going to do that, but I don’t have to – Murph did. So check out his post on adding custom linetypes, and I’ll work on something else.

Share and Enjoy:
  • Print
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter
  • email
  • Facebook
  • LinkedIn
  • Technorati

WordPress Themes