Shapefiles
Back to WinCan VX DDMS User Guide
Chapters
Page Contents
Introduction
Shapefiles are at the very heart of HADDMS data processing and delivery, and they represent the start of the round-tripping process for the contractor.
Shapefiles are geometric data files that contain complex three-dimensional geometry of any type of objects and carry linked attributes that can be used to describe anything the user wishes about each object. Shapefiles come in three different types to describe three different types of object:
Point – describes point items in geographical (coordinate) locations and their attributes. Drawn as dots on a piece of paper.
Line – describes line items that can be any shape. Drawn as a line that has two ends and does not enclose a space.
Polygon – describes closed shapes of any size and shape. These are shapes that can be filled in with a coloured pencil on a piece of paper.
A Shapefile of any type is not a single file. To many people, it is a strange concept because they become used to a single file .xlsx representing a spreadsheet from Microsoft Excel, or a .jpg file being a photo on their mobile phone, but a ‘shapefile’ is a collection of files that combine to make the total product.
There are a number of files included in this bundle, with a minimum of three files with different extensions and an unknow maximum number of files that are used by different GIS data software applications.
In any one bundle of files in a shapefile, all of the files must have exactly the same file name and only the file extensions (the letters after the dot) change for each part. It is because of this that the file renaming utility tool is recommended in the Software Requirements section, because it allows the user to make a selection of several files and rename them at the same time, thereby removing the chances of human error.
It is common for users to make comments like, “I have received these files and I don’t know how to open them.” This is where WinCan Map VX come in. WinCan Map VX is a full GIS application that is built and design for working with shapefiles and also communicates at all times with your WinCan VX database project.
Because of the nature of shapefiles being a collection of individual files, it is common and normal to share and distribute shapefiles in a .zip format so that the entire package is bundled up into one easy-to-handled file. Furthermore, the HADDMS upload process requires the shapefiles to be zipped.
The mandatory files included in a shapefile bundle are:
.shp – this file contains the actual geometry and coordinates of the objects in the file. We never try to open or edit the .shp in any application that is not a GIS application.
.dbf – this is a database file that can be opened and edited using the .dbf file viewer application mentioned earlier. They can also be opened and viewed in Excel, but this is not recommended for two reasons – because it is not normally possible to save any edits in Excel, and HADDMS detects .dbf files that have been opened in Excel as corrupt and rejects them. This file contains all of the attribute data for the objects and care should be taken with reading this. A common mistake is to assume that because the COVER_LEVE (i.e. the cover level field) is defined in the point.dbf file, then this must mean that the point is plotted at the correct altitude, but this may not be the case, because the .shp file contains that actual Z value, and the .dbf file contains nothing more than a data attribute of that point, which can realistically say almost anything. It is possible to open and edit the .dbf file on its own outside of a GIS application, but it is not recommended.
.shx – is known as a cross table in database terms and creates the lookup links between the geometric shapes in the .shp file and the attribute data in the .dbf file. We never try to open or edit the .shx in any application that is not a GIS application.
There are many non-mandatory (and quite common) files that can and often are bundled with shapefiles, and these include:
.prj – this is the projection file that describes where on the surface of the planet these coordinates are located. This is because we are working in metric metres in these shapefiles at all times, and there are simply too many metres around the globe to have a single projection, and for large countries (like USA), the curvature of the globe means that it is very difficult to plot points in a single Cartesian coordinate system. It is possible to open and edit the .prj file on its own outside of a GIS application, but it is not recommended.
.shp.ini – these are WinCan files that are used to define design themes for shapefiles loaded in WinCan Map VX. It is possible to open and edit the .shp.ini file on its own outside of a GIS application, but it is not recommended.
.shp.ttkstyle – the same as .shp.ini and work in the same way, but a more robust file format. It is possible to open and edit the .shp.ttkstyle file on its own outside of a GIS application, but it is not recommended.
All others – are either temporary files used by the GIS application or other types of controls, but in all cases, we never try to open them in any other software application. We just leave them as they are inside the shapefile directory.
Warning - WinCan will accept no responsibility for errors caused by edits made to individual shapefiles in software applications that are not WinCan Map VX.
When people see shapefile data of a drainage network in WinCan Map VX for the first time, there is a common misconception that when it is a version of a CAD application, but this is not the case. Shapefiles and CAD files are very different things, although there is a certain amount of interchangeability between them.
A crude a simple comparison is that CAD files are all about nice looking drawings, and shapefiles are all about the data, but both are usually dimensionally correct.
Info – it is very difficult to work with these files when you cannot see the file extensions on your PC. This is controlled by a Windows folder display setting and is off by default, so to turn it on, first click on the Options button in the View ribbon of a Windows Explorer window and choose ‘Change folder and search options’:
Windows folder options button.
Now the Folder Options window will appear, and in the View tab, uncheck the option ‘Hide extensions for known file types’:
Turning on Windows file extensions.
DDMS Shapefile Data
In the section Shapefiles, we described generic types of shapefiles, and these ar used specifically in HADDMS:
Point – In HADDMS data, this is called point.shp and contains all the geometry and attributes of point the specified point items on the job including things like gullies and catchpits.
Line – Known as the continuous.shp shapefile in HADDMS and carries all the data regarding line items like pipes and kerbs.
Polygon – The region.shp shapefile in HADDMS, used to plot things like ponds.
There are is one other file in standard HADDMS download dataset that requires some consideration:
observation.dbf – this is a .dbf file that stands on its own 2 feet with no other supporting files. It is a database file that contains all of the observation data for all assets; point, continuous and region.
Finally, there are two more files in a standard HADDMS download dataset that do not require any attention at all unless it interests you. WinCan VX extracts some information from them at the initial import stage of the round-tripping process, but after that they have no more use to the project. The best advice is to just leave these where they are and do not delete them:
LINKDATA.DBF – this is a .dbf file that contains information about the Priority Register field values and the numbers of attached documents per asset in the data, and the objects that they relate to.
SCHEME.DBF – contains some useful information about this set of shapefiles that can be read in a .dbf file viewer and can be used to enhance the Job data in your project.
Reviewing the Shapefile Data
So, you’ve received some shapefiles maybe for the first time and they are HADDMS files. The first thing to do is to unzip the folder and copy all of the file contents to a regular folder on your PC, and the contents will look something like this:
Basic shapefile folder structure.
The .zip folder will usually come named as the catchment or scheme name. The example above uses the more old-fashioned way where jobs were issued by scheme, so the name at the top refers to Area 2, Scheme 1138 in a standard naming convention.
With the introduction of round-tripping and the consolidation process that has taken place over recent years, this naming convention has now largely been replaced by something like A9AS_CA23 which refers to Area 9, Catchment 23, although it should be noted that this naming convention is not defined and is not consistent across all areas.
Inside the folder above, you will see that there are 3 point files (point.shp, point.shx and point.dbf), 3 continuous files (continuous.shp, continuous.shx and continuous.dbf) and 3 region files (region.shp, region.shx and region.dbf).
These are the geometric shapefiles with their mandatory parts for the nodes, linear items and ponds etc. Do not be surprised if there is no region shapefile in the data, it just means that there are no ponds in this catchment.
Then, there are 3 additional .dbf files (observations.dbf, SCHEME.DBF and LINKDATA.DBF). The observation.dbf file will only be there if the assets have been previously inspected on another job at some point in the past. The scheme and linkdata files will always be there.
All files will always have the same consistent names. This is how they are delivered by HADDMS on download, in a zipped format by the catchment name. Catchments are designed to be stretches of road from high point to high point, so from the top of a hill through a dip in the road to the next hilltop. The idea of this principle is that all of the drainage ‘should’ flow from the two high points at each end to the low point at the bottom in the middle, and so all of the drainage assets are within one defined group of assets and flowing to a clearly defined outfall, or multiple outfalls.
Loading the Data in WinCan Map VX
WinCan Map can be used in two ways:
Connected to a WinCan VX project database where there is a constant communication channel open between what is happening in VX and what is happening in Map.
As a standalone software application that does not need a connection to VX. After all, Map is a GIS application.
To simply load and review the shapefiles without any connection to a WinCan project (see the section WinCan VX Project Setup), you can add a shortcut icon to your desktop, start menu or task bar in Windows by navigating to C Drive -> Program Files (x86) -> CDLAB -> WinCanMapVX and then finding the file WincanMapVX.exe which will have a green W icon. Now right click on this file and select any of the following options that you prefer:
Pin to Start
Pin to Taskbar
Send To -> Desktop (create shortcut)
Now, you will have a ‘direct’ launcher for WinCan Map which does not need WinCan VX to be running in order to work.
For this shapefile data review, now click this button and launch WinCan Map.
In the Home ribbon, you will see some options in the Layer panel. Click on ‘Add Layer’ and then navigate to the folder (must be the unzipped one) where your shapefiles are saved and select the point.shp, continuous.shp and region.shp files to load. This is another reason why it is recommended to have the file extensions activated on your PC, so that you can select the correct file here.
Add Layer button in WinCan Map VX.
The shapefiles will load, and depending on the layout of the catchment that you are working with and whether or not there are any region items in the data, you will see something like this:
Shapefile first load in WinCan Map.
See the layers listed on the left-hand side (each one of these is a shapefile), the point items will load as small red squares, the continuous items will load as thin black lines and the region items will load as grey shapes.
However, it is very easy to apply some nice themes and colours to help you with identifying on screen what is what, and you can save these themes for future use once they have been created so that you don’t have to keep building them each time you want them.
One of the most useful tools in WinCan Map VX is the Info Tool, which shows you all of the attribute data that is attached to an object. In this example, we will select a point item and display the data attached to it:
Using the Info Tool.
Select the point layer in the Layers panel.
Activate the Info Tool by clicking on the large blue circle with i in the middle.
Click on the Point tool from the Select panel (more commonly referred to as ‘Select Point'). The fact that it is orange shows you that this tool is now active.
Click on a point item of your choice and the information for that point will be displayed in the Info Tool.
Try this again with a continuous item for practice, and then try again using a Select Rectangle over several objects at once and see the list of items on the left-hand side of the Info Tool.
You will see in the Name column of the Info Tool of the shapefile field names that are listed in the .dbf file for the layer. Those who have worked with HADDMS data for a long time commonly refer to field IDs by these names, so it is not uncommon to hear people talking about the ‘Supp Ref’ of an object. They are of course referring to the ‘Supplier’s Reference’ which is saved in the SUPP_REF field in the shapefile.
Next, in this example, we load the shapefiles from another catchment at the same time, so now Map looks like this:
Loading a 2nd set of shapefiles.
Notice that there are now additional layers on the left-hand side (point [1] and continuous [1]), but all of the points are still red squares, and we cannot see where one catchment starts and the next one ends, so now we shall consider adding themes to the layers.
Applying a theme to a set of layers.
The simplest theme is to simply change the colour of the small squares on one of the layers:
Right click on the layer of your choice and select ‘Show Properties’
Select the ‘Marker’ in the properties panel.
Change the colour to one of your choice.
Apply the changes and see that now this layer has changed colour.
If you wish, you can save this theme using the save icon button at the bottom-left corner of the properties panel.
The result is now clear to see and easy to work with. With some experimenting and training, you will be able to create some user-friendly themes that really help you to navigate the data:
Using themes to make the view user-friendly.
In this example, we have extended the reg and green colours to the continuous items, turned the small red squares into circles with a dark outline, activated the line direction arrows (right click on the layer in the Layers panel to do this) and added the SUPP_REF field of the point items as a label so that we can see which point is which.
Finally, try a right-click on a layer in the Layers panel and select the option ‘Show Data’. This will display a table of the attribute data for the selected layer. This is exactly the same data that you see in the Info Tool, but it is presented in a different way.