OS MasterMap and AutoCAD explained.

17 February , 2008

This weeks post is focused on the premier digital mapping dataset of Great Britain – OS MasterMap®. While many mapping software users have understood, and have been using OS MasterMap for a number of years now, the CAD community has seen a slower take up of the data, mainly due to the difficulty in reading the MasterMap information into the DWG.

This post is designed to provide an introduction and summary to some of the ways the data can be managed within an AutoCAD environment.

What is OS MasterMap?

OS MasterMap is the latest generation of Ordnance Survey’s most detailed geographic data of Great Britain. It provides consistent and up to date information down to address, street and building level and is available in four data layers: Topography, Address, Imagery and Integrated Transport Network (ITN). It replaces the old OS Land-Line product, which will be withdrawn from the market in September 2008.

The most commonly used layer is the Topography Layer, which provides detailed mapping of around half a billion landscape features; such as buildings, land area classifications, roads, tracks, paths, railways, water features and administrative boundaries. From the infrastructure design perspective, this is excellent for showing the detailed geographic context around a specific site.

Historically Land-Line has been supplied in a CAD friendly format as tiled DXF or NTF files, in a simple data structure of points, lines and text. Due to its simplicity, this data can be quickly and easily loaded into AutoCAD. In contrast, OS MasterMap is delivered to the users in GML files (Geography Mark up Language), a format based on XML, designed by the Open Geospatial Consortium to store spatial information. GML cannot be read by vanilla AutoCAD and due to the increased data intelligence, OS MasterMap files are much larger than their Land-Line equivalent.

As such, the management of the data within an organisation requires careful thought, especially when considering how data can be accessed and utilised within an AutoCAD environment.

Why use OS MasterMap?

OS MasterMap data is a far richer dataset than Land-Line. No longer limited by tiled boundaries, OS MasterMap is a seamless database of information offering the customer the flexibility to receive only the extents of the data they require.

OS MasterMap data is polygonised, forming intelligent objects that represent real world features such as a building, a park or road junction. Each object has rich attribution, including an id known as a TOID (Topographic Object Identifier) a unique, numeric value given to every feature in the dataset. As these TOIDs stay constant for the lifetime of the feature in the dataset, it is possible to use them as a framework for linking other ‘user specific’ data to the geographical features.

The problem with the DWG file

When MasterMap data is translated into a standard AutoCAD DWG using an external translator it will convert the MasterMap entities into CAD features. However the standard DWG cannot understand attributes on the entities therefore losing the intelligence assigned to the data by the Ordnance Survey. This intelligence is a major advantage of the MasterMap data, as it allows you to produce powerful themes, link the data to external datasets and manage the life cycle of the data.

A further disadvantage of loading MasterMap data into the DWG is storage and speed problems. The DWG was not designed to store large amounts of geospatial data. The more data loaded into the DWG, the bigger the impact on performance. Even when dealing with a small dataset, the DWG file sizes can become very large before any other design data is added.

How can AutoCAD Map manage OS MasterMap?

As AutoCAD Map 3D is based on open data standards the user has the flexibility to work with virtually any spatial data available. So whether the MasterMap is supplied directly by the OS in GML/GZ format, or the user receives the data in other geospatial formats they can read the data directly into their DWG. Allowing them to select the most appropriate method for managing MasterMap data dependant on what they want it for. The options include:

1 – Load raw MasterMap GML/GZ data into the DWG

2 – Connect to a geospatial file holding MasterMap data  

3 – Access MasterMap data stored within a spatial database

Option 1 – Loading raw GML/GZ files into the DWG

AutoCAD Map allows the user to import the OS MasterMap GML data directly into the DWG without the need for an external loader. Within this import process, the user has full control over which layers and attributes to import, and can create a spatial query when loading the data to control the geographical extents of the data required.

The DWG used within AutoCAD Map has an extended ability to store attributes on all CAD entities. This allows the intelligence inherent within MasterMap to exist within the AutoCAD environment. Using that intelligence, users can theme and style the data according to their own requirements. The issues of DWG speed and size still remain however.

Option 2 – Connect to a geospatial file

An alternative to importing the MasterMap data into the DWG is to ‘Connect’ to the data. AutoCAD Map uses an engine called Feature Data Objects (FDO) for accessing features and geospatial data regardless of the underlying data store.

There is a great write up on FDO at Neal Niemiec’s blog

When you access data through the FDO tool, you use an ‘FDO provider’ to connect directly to a data source. This source could be foreign spatial file formats such as MapInfo TAB files, ESRI SHP files or even OS MasterMap GML data (more about this option here).

When the FDO tool connects to the data it is NOT translated into the DWG as AutoCAD objects, but read natively from the original source and then displayed in the Model space as you would display normal CAD entities.

Once the data is connected within AutoCAD Map it displays all the features within the file and the FDO source becomes a layer in the Display Manager, through which the user can then perform styling and querying.

With this method, MasterMap data held within foreign file formats can be accessed very quickly and in large quantities without the risk of any performance issues. As the data is connected and not imported, it takes up the minimum of space within the file, resulting in a very small DWG.

Option 3 – Access the data within a spatial database

An increasingly popular way of storing MasterMap data and many other geospatial datasets is within a spatial database. Database storage makes spatial data easier to manage, and presents a seamless dataset to the user. With a spatial database you are no longer required to search for the right file in order to obtain the information required – it is all available by simply connecting to the database.

There are a number of different spatial databases on the market- examples include Oracle and MySQL. Many organizations in the UK have implemented spatial database solutions and are storing huge amounts of MasterMap data within them. AutoCAD Map is able to connect directly to databases such as Oracle and MySQL, and will also connect to ArcSDE, which is a widely used spatial database tool from ESRI.  

Database connections use the FDO engine as in option 2, meaning all the same advantages are gained here also.

Over the future posts I will try to highlight some tips on using OS MasterMap within the DWG so check back soon.

Using the 3d in AutoCAD Map 3d

3 February , 2008

Hi all – today’s post is all about the 3d!

Well if you are anything like me you have called the software ‘Map 3d’ many times but have all to often ignored the 3d part! When speaking to customers I often hear “We only work in 2d” or “3d would be nice but it takes to long to get results” – Well in this post I want to show you thats not always true!

AutoCAD Map 3d has a great, fast, easy way to produce a 3d visualisation. Although the product has no capabilities for creating surfaces from X,Y,Z data – you will require AutoCAD Civil 3d for that – you are able to connect to existing 3d surfaces that have been created externally to AutoCAD Map. These include DEM (Digital Elevation Model) files, ESRI Grid files (asc Grid), or Digital Terrain Elevation Data (DTED).

Here in the UK for example there are a number of sources I can purchase pre-existing 3d surface data that will read directly into AutoCAD Map. One such source is from a comapny called eMapSite that offer a range of digital geospatial data, including 3d surfaces – The data in this example was kindly provided by them.

To access the data within AutoCAD Map you use the Feature Data Objects (FDO) technology, which connects directly to the file and displays it within the DWG. Once you have connected to the raster-based surface, you can create contour maps to help you analyze 3D terrain. You can use raster-based theming to analyze elevation, slope, and aspect, and drape other map data over the surface. You can also view the data in 3D with walk-through and fly-through options, creating compelling visualisations.

Here are 5 quick steps to produce a 3d visualisation and perform some flooding analysis.

Step 1 – Connecting to the 3d surface file

Open the ‘Data Connect’ menu from the ‘Display Manager’ and select the ‘Add Raster Image or Surface Connection’. Navigate and select the surface file you wish to add (in my case its a .asc). Then tick the box and hit ‘Add to Map’. This will add your 3d surface connection to your DWG in the same way you would add any other raster file.

Your surface will now appear in Model space and the layer will appear on the Display Manager.

Step 2 – Adding additional data to drape onto the surface

To add an aerial photo to drape onto the surface, open the Data Connect menu again and select the ‘Add Raster Image or Surface Connection’. But this time add an aerial photograph or other relevant raster file that you have. 

When you view this data in 3d the raster image will drape automatically onto the 3d surface. It is also possible to use the FDO access tools to connect to vector data which will then automatically drape on the surface also.

Tip – When dealing with DWG CAD entities, these will NOT drape on the surface so you need to ensure the entities are given the correct elevation to appear in the correct place in the 3d world.

Step 3 – Adding the flood surface

To enable me to produce some flood analysis I need to create an object to represent the flood. To do this you can add a simple polygon CAD entity.

Draw a polygon around the surface – You may wish to snap your polygon to the edge of the surface to make the visualisation clearer. Once completed select the properties of the polygon and change the colour fill setting to Blue.

Step 4 – Visualising the data in 3d

Now its time to view the data in 3d.

Select the ‘3d Mode’ button underneath the Model space tab.

Tip – It’s important you use this button to switch to 3d mode as it applies the stylisation settings required.

The data is now viewable in 3d and you can use the 3d navigation tools to move around.

Step 5 – Adding the Flood height

Finally you can specify the height of the flood you want to analyse. 

Select the blue polygon underneath the 3d model, right mouse click and select ‘Properties’. In the properties editor, underneath the ‘Misc’ section, enter your flood height into the ‘Elevation’ field.

Before Elevation Change

After Elevation Change

This will raise the polygon on the Z axis to the relevant height and cut through the model.

Hopefully you will all agree that once you have the right 3d surface data, this is quick, easy and a great starting point for creating compelling visualisations and fly-throughs.

There are a number of other things you can do with the surface, including style it based on Height, Slope and Aspect; plus you can produce a contours dataset from the surface. I have written a short ‘How 2’ guide on how to insert and style 3d surfaces in AutoCAD Map 3d, which . If you are interested please drop me an email – greig.richardson@bmarq.co.uk

See you next time.  

It all becomes transparent…..

6 January , 2008

Happy New Year!!! So here is my first post of 2008 – I did intend to post a few times over the festive period but got caught up in mince pies and sherry……But better late than never.

When AutoCAD Map 2007 was released with its new FDO (Feature Data Object) engine I found the transparency functionality and thought – ‘excellent see-through data!’. There was a catch however, although it’s great for polygons, I have never been able to make raster data transparent – until now!!

Through some useful posts from the community on the AutoCAD Map discussion forum; and through some trial error, I can now make my raster images transparent. This is how to do it……..

Step 1 – Add the raster image to the DWG through FDO

Open the ‘Data Connect’ menu found on the ‘Display Manager’. Once in the editor, select ‘Add Raster Image or Surface Connection’, navigate to the file you wish to connect to and then tick the box and hit ‘Add to Map’.This will add your raster image connection to your DWG.

Before Insertion


After insertion

As you can see from the screen captures above, the image displays in the correct location as AutoCAD Map understands its associated ‘World File’. However it has been placed in front of the stadium design CAD data, hiding it.

Using the Display Manager I am able to manage the draw order of my data in Model Space and could force the image behind the CAD data. In future posts I will explain the tips for doing this. In this example however I want to make the image transparent.

Step 2 – Save a ‘Layer file’ for the image

A Layer file is an XML based file that you can export from AutoCAD Map for any FDO connection you have made in the Display Manager. Within the file it will save all the styling information and it also records the location of the data source e.g. Location on disk of the Raster Image file. Once the file has been created you can add saved Layer files into any AutoCAD Map DWG to re-use them – making it very easy to connect and style the data.

To create a Layer file for the raster image that has been connected simply right mouse click the layer on the Display Manager and select ‘Save Layer’

It will prompt you for a name and location to save the Layer file. 

Step 3 – Edit the Layer file to enable the transparency.

To make the image transparent you need to add a extra line to the Layer file. In Windows Explorer, navigate to the Layer file that has just been saved and open it in Notepad.

This is the data contained within a Layer file.

To add the transparency setting, find the line that defines the ‘FeatureName’. Its usually about 22 lines down in the file. 

It looks like this: 

FeatureName: <FeatureName>rasters:MyRasterImage</FeatureName>

Underneath this section on a new line add the following…..


0.5 being the degree of transparency – 0.1 is very transparent, 0.9 is not very transparent.

This is how your file should look:

Before Edit


After Edit

Once you are happy, save the notepad file.

Step 4 – Add the Layer file to AutoCAD Map DWG.

Now you have added the transparency in the Layer file you can add the Layer file to your DWG.

Turn off any other Raster Imagery in your DWG. From the Data button on the Display Manager select ‘Load Layer’ and point to your Layer file.

This will add the Raster Image to the Display Manager in the same way as doing a Data Connect would do, except this time the transparency should be activated.

You now can see the Stadium CAD data below the image.

Check back for more soon!

The power of the Display Manager – Part I

14 December , 2007

For today’s post I want to go back to basics and highlight the unsung hero of AutoCAD Map – The Display Manager.

When the AutoCAD Map application opens the Display Manager will appear automatically on either the right or left hand side of the GUI. At first sight its use may seem slightly ambiguous, with a lot of white space and just a few buttons. DO NOT SWITCH IT OFF! All too often I train users that simply turn the Display Manager off, and in doing this, lose access to huge amounts of functionality.

In short, the Display Manager enables you to manage how data is displayed in the model space and how that data is styled. It doesn’t replace the AutoCAD Layer Control, it just compliments it.

The Display Manager is a bit ‘Dr Jekyll and Mr Hyde’ depending on the type of data you are managing…..It will provide different functions and options dependant on where your data resides. When managing data held within the DWG file, i.e. CAD entities, it provides one set of functions for styling and querying. When managing data accessed through the FDO (Feature Data Objects) connection mechanism it provides a whole range of other functions, including connection to the data, styling, editing and a quite a bit more. A major advantage of the Display Manager is its ability to manage all of this data, regardless of its source and produce a map for you to use in model or paper space.

In this post I will highlight some of the cool things you can do with the Display Manager when managing data held within the DWG.

Cool Thing no. 1 – Managing the display of your CAD layers

You can use the Display Manager as a time save for turning layers, and groups of layers, on and off. All you have to do is pick which layers you would like to add to the display manager…..


This will open the ‘Select Layers’ editor which lists all the layers within the DWG.

Each layer you tick is added to the Display Manager. Once on the Display Manager you can control the visibility of the layers within your Map very easily by simply switching the data on and off using the tick box.  

Another top tip is to group the layers together by using the ‘Group Selection’ option. This way you can turn a number of layers on and off at the same time. Any layers that aren’t added to the display manager can be turned on and off all together by toggling the ‘Map Base’ option, which automatically groups all other DWG layers.

Managing your layers through the Display Manager in this way will allow you very powerful control over what you see in your Model or Paper space. It also provides a effective way of managing draw order – more on this in a future post!!

Cool thing no. 2 – Managing Styles on your layers 

Once you have added your DWG layers to the Display Manager you then have a range of functions you can perform on that data. One such function is ‘Add Style’. The different styles available can be found by selecting the layer in the Display Manager and right mouse clicking.

Styles offer you the ability to apply hatching, annotation, symbols and themes to the data. You can style based on your standard CAD properties such as .Area or you can style based on intelligent Object Data (data attributes) that can be stored against each entity. For example you may be storing an attribute on a set of polygons recording the ‘Use’ of a building – The resulting Theme may look like this…

Cool thing no. 3 – Querying the data

Any CAD entity within the current DWG or stored within an external DWG can be “queried”. The results of the query are added to the Display Manager as a single display layer. 

The query can be based on a range of conditions such as a location – e.g. All entities within a rectangle, or it can be based on a property or data condition. It is possible to build up very powerful query by using a combination of different conditions.

Queries can be saved reused over and over. As long as you know your data, the query tool can be extremely powerful.

Continuing with the ‘Buildings’ example, the following query has produced a Display Manager layer containing all polygons in which the CAD property .Area is greater than 2000 msq.

So if the first thing you do when you open AutoCAD Map is to turn off the Display Manager – don’t. Have a play with some of your data and some of the functions and I bet you will like what you see.