36
Using the Asset Inventory Getting started

Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

UsingtheAssetInventoryGettingstarted

Page 2: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

Reform of Municipal Services in Eastern Ukraine

UsingtheAssetInventory

GettingStarted

Guidelines on using software for asset management planning in water and wastewater utilities

By Janneke van Dijk

GFA Consulting Group on behalf of GIZ

April 2016

Deutsche Gesellschaft für Internationale

Zusammenarbeit (GIZ) GmbH

Page 3: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

i

TABLE OF CONTENTS

1. INTRODUCTION ............................................................................................................... 5

1.1. The structure of the Asset Inventory software ........................................................ 5

1.1.1. PostgreSQL ........................................................................................................................... 5

1.1.2. QGIS ..................................................................................................................................... 5

1.1.3. The project directory ............................................................................................................. 6

1.1.4. The project file ...................................................................................................................... 6

1.2. The structure of the database .................................................................................. 71.2.1. Lookup tables ........................................................................................................................ 7

1.2.2. Location table ........................................................................................................................ 7

1.2.3. Assets table ........................................................................................................................... 7

1.2.4. Repairs table .......................................................................................................................... 8

1.2.5. Views .................................................................................................................................... 8

1.3. Data conversion ...................................................................................................... 8

2. START WORKING WITH THE ASSET INVENTORY ............................................... 8

2.1. Description of the QGIS interface .......................................................................... 8

2.2. Loading background layers and basic layer interaction ........................................ 10

2.2.1. Loading OpenStreetMap layer ............................................................................................ 10

2.2.2. Basic layer interaction ......................................................................................................... 11

2.3. Adding point locations and assets ......................................................................... 12

2.3.1. Checking if point location exists ......................................................................................... 12

2.3.2. Adding new point location .................................................................................................. 13

2.3.3. Adding a new asset to a point location ............................................................................... 14

2.4. Adding line locations and assets ........................................................................... 15

2.4.1. Check if location exists ....................................................................................................... 15

2.4.2. Set snapping tolerance ........................................................................................................ 152.4.3. Add new line location ......................................................................................................... 16

2.4.4. Add new asset ..................................................................................................................... 16

2.5. Entering repair data ............................................................................................... 17

2.6. Editing locations, assets and repairs ..................................................................... 18

2.6.1. Editing attributes of single locations, assets and repairs ..................................................... 18

2.6.2. Editing attributes of groups of locations and assets ............................................................ 182.6.3. Editing geometry of point locations .................................................................................... 19

2.6.4. Editing geometry of line locations ...................................................................................... 19

2.7. Deleting locations and assets ................................................................................ 22

2.7.1. Deleting a location .............................................................................................................. 22

2.7.2. Deleting an asset ................................................................................................................. 22

2.8. Backup .................................................................................................................. 23

2.8.1. Making a backup of the database ........................................................................................ 23

Page 4: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

ii

2.8.2. Restoring the database ........................................................................................................ 24

2.8.3. Resetting some database settings ........................................................................................ 25

2.8.4. Backup of the project file .................................................................................................... 26

3. STANDARD QGIS TOOLS FOR DATA ANALYSIS .................................................. 26

3.1. Working with attribute tables ................................................................................ 26

3.2. Data visualisation .................................................................................................. 283.2.1. Labelling ............................................................................................................................. 28

3.2.2. Styling ................................................................................................................................. 29

3.3. Data export to Excel .............................................................................................. 32

3.4. Printing a map ....................................................................................................... 32

ANNEX 1 DATA CONVERSION ............................................................................................ 34

Page 5: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

iii

TABLE OF TABLES

Table 1 Location table referring to lookup table a_district ............................................................ 7 TABLE OF FIGURES

Figure 1 Install OpenLayers Plugin ............................................................................................. 10

Figure 2 Adding OpenStreetMap layer ........................................................................................ 11

Figure 3 Using filtering functionality .......................................................................................... 12

Figure 4 Location form ................................................................................................................ 13

Figure 5 Assets list tab on the location form ............................................................................... 14

Figure 6 Engineering data tab (point assets) ................................................................................ 15

Figure 7 Engineering data tab (line assets) .................................................................................. 17

Figure 8 Table editing toolbar ...................................................................................................... 19

Figure 9 Straight line to be edited ................................................................................................ 20

Figure 10 Edited line with extra vertices ..................................................................................... 20

Figure 11 Lines not connecting .................................................................................................... 20

Figure 12 Connected lines using snapping tolerance ................................................................... 21

Figure 13 Line asset to be split .................................................................................................... 21

Figure 14 Drawing splitting line using snapping tolerance ......................................................... 21

Figure 15 Marking an asset ‘to be verified’ ................................................................................. 23

Figure 16 Making a backup of the Asset Inventory database ...................................................... 24

Figure 17 Restoring a backup of the Asset Inventory database ................................................... 25

Figure 18 Opening the Query Window ........................................................................................ 26

Figure 19 Using the query builder in QGIS ................................................................................. 27

Figure 20 Simple labelling of streets ........................................................................................... 28

Figure 21 Labelling using the expression builder ........................................................................ 28

Figure 22 Advanced labelling of streets ...................................................................................... 29

Figure 23 Style window - Categorized ........................................................................................ 29

Figure 24 Simple styling of line assets ........................................................................................ 30

Figure 25 Style window – Rule based ......................................................................................... 30

Figure 26 Rule properties window ............................................................................................... 31

Figure 27 Advanced styling of line assets using rules ................................................................. 32

Figure 28 Map view exported to .jpeg ......................................................................................... 33

Page 6: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

iv

ACRONYMNS AND ABBREVIATIONS

AI Asset Inventory AMP Asset Management Planning EUL Expected Useful Life GIS Geographic Information System GPS Global Positioning System HDPE High Density Polyethylene ID Identity MS Microsoft OD Outside diameter RMS Reform of Municipal Services RUL Remaining Useful Life S&CI Serviceability and Criticality Index WSP Water Service Provider

Page 7: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

5

1. INTRODUCTION

This manual is meant to give the user of the Asset Inventory some guidelines on how to use the asset inventory in support of the Asset Management Planning process. It is assumed that the user will be familiar with the concepts and working procedures as explained in the Asset Management Planning manual that was developed by the Reform of Municipal Services Project (RMS). It is also assumed that the Asset Inventory has been set up correctly (using the Set up instructions for Asset Inventory) and that the user can start up the AI project and connect to the database. In the following paragraphs you will find some background information on the structure of the Asset Inventory, the structure of the database and on the considerations with regard to a data conversion. If you would just like to get started using the Asset Inventory you can continue straight away with Chapter 2. Chapter 3 will give you some examples of commonly used QGIS functionality, with references to the QGIS documentation for further reading.

1.1. The structure of the Asset Inventory software

The Asset Inventory is designed making use of Open Source software, freely available on the internet. The two key components are PostgresSQL and QGIS. The QGIS functionality has been extended to make data entry into the Asset Inventory more convenient.

1.1.1. PostgreSQL

Postgres is a fully-fledged Open Source database with comparable functionality to the industry standard Oracle. It can be used on a stand-alone computer, or on a server with multiple concurrent users. User access can be controlled on database level, giving individual users different degrees of rights (read-only, write, administration). It is used as a database backend that stores all the data in the Asset Inventory. As a user, most likely you will not have much direct interaction with the database.

1.1.2. QGIS

QGIS is Open Source GIS software with extensive GIS functionality, comparable to ArcGis which is the dominant application in GIS in the world. It is widely used over the world, including in local government organisations. It has an active user community with swift response to questions asked. If you need more specific functionality than offered in the core functionality it can be extended by freely available plug-ins. In many cases, someone will already have designed a plug-in that can do what you need it to do. The full functionality of QGIS is available in the Asset Inventory. QGIS serves as a frontend to access the data that are stored in the Postgres backend. As a user, you will most likely only work with QGIS in order to access the data in the Asset Inventory. For help with the standard QGIS functionality you are referred to the official QGIS documentation (English version: http://docs.qgis.org/2.8/en/docs/user_manual/ , also available in .pdf format. There is a Russian version available that is fully translated for QGIS version 1.8 at http://docs.qgis.org/1.8/ru/docs/user_manual/index.html, and a not fully translated manual for QGIS 2.8 at http://docs.qgis.org/2.8/ru/docs/user_manual/index.html.). Also highly recommended is “A Gentle Introduction in GIS” (http://docs.qgis.org/2.8/en/docs/gentle_gis_introduction/index.html for the English version and http://docs.qgis.org/2.8/ru/docs/gentle_gis_introduction/index.html for the Russian version). This document explains the general concepts of GIS and has some accompanying exercises to get hands-on experience.

You are encouraged to browse the site www.qgis.org and read more about the QGIS project, as there is a lot of development going on and there are different active community groups that can provide support.

Page 8: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

6

1.1.3. The project directory

The Asset Inventory provides the full functionality of QGIS. It has been extended with functionality to add, edit and access the data in the Asset Inventory database. During the installation process the project directory has been copied to a location on your computer.

It contains the following folders:

• UI The folder UI contains the files for the user interfaces designed for the Asset Inventory

• Images The folder Images is where the Asset Inventory will look for pictures and diagrams of assets and repairs. You can create subfolders to order the picture files according to your wishes.

By default, it also contains the following files: • 8 files with the extension .qgis

These files are the QGIS project files that have been configured during installation to grant you access to your two databases (production and test, 4 for each database). Your username and password may or may not be stored in this file. If not, you will be asked to enter your Asset Inventory username and password each time you open the project.

o AI_w_en_production.qgs: English version for the water sector production database o AI_ww_en_production.qgs: English version for the waste water sector production

database o AI_w_ru_production.qgs: Russian version for the water sector test database o AI_ww_ru_production.qgs: Russian version for the waste water sector test database o AI_w_en_test.qgs: English version for the water sector test database o AI_ww_en_test.qgs: English version for the waste water sector test database o AI_w_ru_test.qgs: Russian version for the water sector test database o AI_ww_ru_test.qgs: Russian version for the waste water sector test database

• Repairscript.py: Python script containing logic for adding and editing repairs • Assetscript.py: Python script containing logic for adding and editing assets

Your folder may contain .qgs files with different names if during installation the filenames have been changed. This does not matter for the Asset Inventory functionality, as long as you know to which database you are connecting with what user rights.

1.1.4. The project file

All the files with extension .qgs in the project directory have the same structure and work on the same principle. If set up properly, double clicking the .qgs file, should open the specific project in QGIS.

The project file is nothing more than a text file in xml-format, in which some of the AI application logic is stored, but also all of the user settings that you may start saving once you start working with the Asset Inventory, such as layer styles and additional background layers. While no actual data are stored in this file (these are stored in the PostgreSQL database), you may want to make regular backups of this file so you do not lose styling and other preferences in case of file corruption.

In the QGIS user manual you can read more about what information is stored in the project file. English: http://docs.qgis.org/2.8/en/docs/user_manual/introduction/getting_started.html and for Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/introduction/getting_started.html.

Page 9: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

7

1.2. The structure of the database

The data of the Asset Inventory are stored in 24 tables in the PostgreSQL database. Furthermore, there are 28 so called views. A view can best be described as a virtual table. It does not contain any data, but provides a tool to extract data from different tables and present them to the user in one overview table in a user friendly way. In the file tables_overview.xlsx all tables and views are listed in several worksheets.

1.2.1. Lookup tables

The first worksheet, standard_lookup_tables, shows all 15 tables and their content that should not be modified by the user and are filled with default lookup lists. The second worksheet, VK_specific_lookup_tables, shows the 6 lookup tables that are specific for each water utility. These need to be filled with the relevant data from the utility. How to enter the data has been described in the Set up instructions for Asset Inventory.

1.2.2. Location table

The third worksheet gives a description of the location table. The location table is one of three tables that contains the actual asset inventory data that are being collected (the other two tables are assets and repairs). Many columns are referencing lookup tables. This means that a number will be stored in the location table, and this number will correspond with a record with the same number in the lookup table. For example, the column “districtid” references the table a_district (Table 1).

Table 1 Location table referring to lookup table a_district

Table location: Table a_district

locationid districtid districtid district district_ru district_ukr

1 2 1 Kirovskyi Кировский Центральний

2 1 2 Industrialnyi Индустриальный Індустріальний

3 1 3 Samarskyi Самарский Самарський

In this example, location with locationid = 1 will be in district “Industrialnyi” (or “Индустриальный” using the Russian name column district_ru) and locations with locationid = 2 and locationid = 3 will be in district “Kirovskyi” (or “Кировский” using the Russian name column district_ru).

In the actual Asset Inventory application, that you will be using, you will not be seeing the numbers but just the list of districts as entered in the column district (for the English version), or as entered in the column district_ru (for the Russian version).

A location can be represented by a point geometry (this is for example the case for a building, or for a manhole) or by a line geometry (this is for example the case for a pipe or a pipe gallery). It can only be one or the other geometry (either a point or a line), but it has to have a geometry. It also has to belong to a specific sector (either water or waste water).

1.2.3. Assets table

The fourth worksheet describes the assets table. The assets table contains the bulk of the information that is stored in the database. Similar to the location table, several columns refer to

Page 10: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

8

lookup tables. A particular form of referencing is the column l”ocationid”, which refers to the corresponding location in the location table with the same “locationid”. This “locationid” has to be filled in, because each asset has to belong to one location. And one location can contain one or more assets. The other column that has to be filled in is the column “assettypeid”.

1.2.4. Repairs table

The fifth worksheet describes the repairs table. Here most of the information collected using the repairs forms will be stored. Again, some columns refer to lookup tables. The column “assetsid” has to be completed as each repair has to belong to a specific asset. One asset can have 0, 1 or more repairs. If the repair is done to an asset that belongs to a line location, it will be possible to add the specific location of this repair to the Table. Especially on longer pipes this might provide further insight in the condition of the asset.

1.2.5. Views

The remaining sheets describe the different views in the database and what information they contain. Many of the layers that are used in the Asset Inventory project file are based on a view to provide the user with the optimal amount of information.

1.3. Data conversion

In order to get started with the Asset Inventory, data will need to be entered into the database. You can start from scratch, by collecting data in the field and entering them into the Asset Inventory. More about this approach is described in Chapter 2.

You may already have some information available, for example in the form of a hydraulic model, CAD drawing or GIS data. In this case, there are two approaches to using this information. The first approach is to use these data as a background layer (to indicate where the assets are located) and then start entering the data manually. The second approach is to convert the data in an automated way by creating a conversion script. Which of these approaches is suitable for your organisation will depend on the amount and quality of the data available, the skill level available and/or the possibility to hire the skills necessary to carry out a conversion.

As there are many different sources of information it is not possible to describe a ‘one size fits all’ procedure to convert the data. There are Open Source tools available that can help importing different data formats into Postgres. Once in Postgres, someone with some knowledge of SQL can transfer the relevant information to the Asset Inventory database. In ANNEX 1 you will find a general description of the steps involved in converting data into the Asset Inventory.

2. START WORKING WITH THE ASSET INVENTORY

2.1. Description of the QGIS interface

When you open the Asset Inventory, you will see the standard QGIS interface with the layers from the Asset Inventory loaded. To find out more about the different sections and their functions, take a look at the QGIS user manual (for English): https://docs.qgis.org/2.8/en/docs/user_manual/introduction/qgis_gui.html, (for Russian): https://docs.qgis.org/2.8/ru/docs/user_manual/introduction/qgis_gui.html). The function of most of the general standard tools is described in English here: https://docs.qgis.org/2.8/en/docs/user_manual/introduction/general_tools.html and in Russian here: https://docs.qgis.org/2.8/ru/docs/user_manual/introduction/general_tools.html

In the map legend, you will see the standard Asset Inventory layers loaded:

Page 11: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

9

• Water o location_point o location_line o assets_point o assets_line o repairs_point o Assessment views

§ bulkediting_location_point § bulkediting_location_line § bulkediting_assets_point § bulkediting_assets_line § assessment_line § assessment_point § prepare_assessment_line

• Waste Water

o location_point o location_line o assets_point o assets_line o repairs_point o Assessment views

§ bulkediting_location_point § bulkediting_location_line § bulkediting_assets_point § bulkediting_assets_line § assessment_line § assessment_point § prepare_assessment_line

• Lookup Tables

o Default § a_abovebelowground § a_assessementvalues § a_assetcategory § a_assettype § a_assetused § a_causeoffailure § a_lifespan § a_naturofproblem § a_pipematerial § a_pipesnetwork § a_processunit § a_replcostm § a_sector § a_terrain § a_typeofdatacollection

o Editable § a_assessor § a_district § a_facility § a_object § a_operationalzone § a_streets

Page 12: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

10

Using the (+) and the (-) in front of the layers you can maximise the folders or minimise them again, depending on your preference. The layers that contain geometry can be made visible in the map by ticking the box in front of them, and made invisible by unticking the box again. By clicking on a layer in the map legend you can make it active (which means it is selected) and it will be highlighted in the map legend. Many tools (for example the information tool) will work on the active layer. Note the difference between ‘active’ and ‘visible’: visibility refers to the visibility of the layer in the map, while ‘active’ refers to the layer that is available to specific tools.

2.2. Loading background layers and basic layer interaction

2.2.1. Loading OpenStreetMap layer

When you first open the Asset Inventory and there has been no conversion of data from other sources into the Asset Inventory, you will see an empty map. However, if you have an internet connection, you can easily use online map services to provide background data to your Asset Inventory.

Firstly you have to go to the menu “Plugins” > “Manage and Install Plugins…”. The Plugins window will open automatically (Figure 1). Click on the “All” icon. Here you can find all additional plugins and in this list you need to click on “Open Layers Plugin” and press the “Install Plugin” button:

Figure 1 Install OpenLayers Plugin

Read more about working with plugins in QGIS in the QGIS User Manual (English: http://documentation.qgis.org/2.8/en/docs/user_manual/plugins/plugins.html, Russian: http://documentation.qgis.org/2.8/ru/docs/user_manual/plugins/plugins.html).

Go to the menu “Web” > “OpenLayers plugin” > “OpenStreetMap” > “OpenStreetMap”, and the online OpenStreetMap layer will be loaded into your project (Figure 2)

Page 13: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

11

Figure 2 Adding OpenStreetMap layer

Initially, it will zoom at a level that shows the whole world, so you will want to use the zoom button

to zoom in to the area of your interest. As the “OpenStreetMap” layer in the map legend is now the top layer, it will cover all the other layers in the map legend. Click on the layer and slide it down in the map legend, so that it ends up at the bottom of the list of layers. This way, as you start entering data into the Asset Inventory, they will appear on top of the “OpenLayersBackground” layer. Ticking the box in front of the “OpenStreetMap” layer will make the map invisible, ticking it again will make it visible again.

2.2.2. Basic layer interaction

In the previous sections you have already learned about making a map layer visible/invisible and active/inactive. You have also moved the “OpenStreetMap” layer down in the map legend so that it won’t cover other layers in the map. You have used the zoom tool to zoom in to an area of interest. And you know how to use the (+) and (-) in front of layers and folders to show more or less detail in the map legend.

One very important aspect of working with GIS data is that each layer containing geometry consists of two interlinked parts: while all information is stored in tables, in addition to that there is also information available in the map – the geometry. This means that there are always two ways to get to a single location, asset or repair: either by selecting it in the map first and then opening the table to find the selected item, or by selecting it in the table and then zooming in to it in the map. When working with layers this is a very useful principle.

Here is an example of the data available in a Table. Make the layer “location_point” active (highlighted) by clicking on it. Then, use right-click to open the context menu, and choose “Open attribute table”. This will open the Table that contains all the information on point locations that are in the Asset Inventory. If there are no data in the Asset Inventory yet, this table will of course be empty. As you start entering data, this table will show more and more records of the locations that have been entered.

If you do have records in this layer, you can sort data in a column by clicking on the column heading, the arrow will show you if the sorting is ascending or descending. Clicking the column heading again will reverse the sort order. You can also use the field filtering functionality (bottom left corner of the table) to filter for records that meet specific criteria. Figure 3 shows the example of using the field filter on the column “facility”. This will then provide you with a dropdown list of the available facilities, and you can pick the one that you are interested in. As a result, only records of locations of the selected facility will be shown.

Page 14: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

12

Figure 3 Using filtering functionality

2.3. Adding point locations and assets

Wherever you are in the Asset Inventory application forms, you can obtain help about a specific data entry field by hovering (holding the mouse still) over the description in front of the data entry field. This will show you a tooltip which will describe what type of information is expected to be entered in this particular field.

2.3.1. Checking if point location exists

Before you can add a new asset to the Asset Inventory, you will need to check if the location to which it belongs already exists. If it does not exist, you will first have to create the location. We will illustrate the procedure of adding new point locations and assets using the example of “PumpingStationA”.”PumpingStationA” belongs to the facility “WaterTreatmentPlant-WestBank”, and it contains 3 assets, Pump1, Pump2 and Pump3.

First, we need to check if the location “PumpingStationA” exists in the Asset Inventory. You can do this by zooming in on the map to where the pumping station is located. Make sure that the layer

Page 15: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

13

“location_point” in the folder Water is visible (the box in front of it is ticked) and that the layer is above (on top of) any background layers such as “OpenStreetMap”. If “PumpingStationA” is already in the Asset Inventory, you should see a point on the location on the map where the pumping station is.

Alternatively, you can select the layer “location_point” in the map legend, right-click on it and choose ‘open attribute table’. If the table is empty, you know there are no locations yet in the Asset Inventory. If there are many records, you can use the field filtering function to check if the location “PumpingStationA” already exists. For example, you can filter using the field ‘facility’, and select “WaterTreatmentPlant-WestBank”. This will show you the available locations for this facility, and you can easily check if the location “PumpingStationA” is already in the Asset Inventory. If it already exists, continue with Chapter 2.3.3 to start adding assets to the location. If not, continue with Chapter 2.3.2 to create the location.

2.3.2. Adding new point location

This section will contain actual changes to the data in the Asset Inventory. It is therefore recommended to do this first in the test database (ask your system administrator if you do not know how to open the project file to the test database) so that you can get familiar with the procedure and can feel free to make mistakes while learning.

If the location does not exist, we will first need to create it. Make the layer “location_point” active

(highlighted) by clicking on it. Then select the ‘toggle editing’ button . This will put the layer in editing mode, if you have the rights to be editing this layer. Then, click the button ‘add

feature’ . The mouse cursor will now change into the shape of a visor. Click in the map on the location of “PumpingStationA”. The location form (Figure 4)will open automatically and you can start entering the relevant data.

Figure 4 Location form

Fields marked with a * are required fields. In the location form, you will at least have to fill in the Sector (Water or Waste Water sector), but it is recommended to fill as much identifying information as possible, such as the District, the Facility (‘WaterTreatmentPlant-WestBank’), street and location

Page 16: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

14

description (‘PumpingStationA’ for example). This will make it easier in the future to select the correct location. The dropdown lists are filled with data from the corresponding lookup table – if they do not show a list, fill the relevant lookup table with the data for your Water Utility as described in the Set up instructions for Asset Inventory.

When you’ve filled in the relevant information click OK to return to the map view. Click the ‘toggle editing’ button again to stop editing, and choose ‘Save’ if you want to save the result to the Asset Inventory, or ‘Discard’ when you don’t want to save it. You should now have a new point location

visible in your map. Use the ‘Information’ button to click on the location and verify the data you just entered.

2.3.3. Adding a new asset to a point location

Now that your location (‘PumpingStationA’ at the facility ‘WaterTreatmentPlant-WestBank’) exists, you can add new assets to the location. Yet again, it is recommended to practice this first in the test database so you can feel free to make mistakes.

Make the layer “location_point” active and zoom in to the location to which you want to add assets. Use the ‘information’ button and click on this location. This will open the form at the selected location.

Figure 5 Assets list tab on the location form

Open the tab “Assets list” (Figure 5). If it is a new location, this will not yet show any assets. Following the example, we will now add Pump1 to the list of assets. Start editing by clicking the

‘toggle editing’ button in the top left corner of the form. Click on the ‘add’ button to create a new asset for this location. It will now appear in the list of assets as <NULL> (no values have been filled in yet), select it in this list. In the tab ‘main information’ you will have to fill in at least the field ‘Asset type’ which is marked by *. The more information you fill in, the easier it will be to select this specific asset later. This is particularly important with above ground assets, where one location can contain hundreds of assets. In our example, we would at least fill in the Asset name as ‘Pump1’, pick asset category ‘Mechanical equipment’ to be able to select the Asset type ‘Pump’.

Page 17: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

15

Check in the other tabs what information about the asset you would like to enter. In the tab engineering data the parameters that are most likely to be relevant to the chosen asset type are marked with a green background (Figure 6).

Figure 6 Engineering data tab (point assets)

In our case of the pump this would be ‘Nameplate capacity’, ‘Supply capacity’ and ‘head’.

When you are done entering the data for the new asset, click the ‘toggle editing’ button again to stop editing, and click ‘Save’ if you want to save the new asset or ‘Discard’ if you don’t. Initially, the new asset will not show up in the list. However, when you close the form (click the cross) and return to the map view, reopen the form with the ‘information’ button at this location, you will see the new asset added to the assets list. The list by default shows ‘Expression’. You can click on the dropdown list, select ‘column preview’, and from the long lists of columns select a column that is most informative to show – for example asset name. Our newly added asset will now show in the list as ‘Pump1’.

Repeat this process for additional new assets for this location (in our example, for ‘Pump2’ and ‘Pump3’). Make sure to save the edits after each new asset.

2.4. Adding line locations and assets

2.4.1. Check if location exists

The principle of adding line location and assets is very similar to adding point locations and assets, with only a few differences, which we will highlight here. Again, before adding a new line asset (pipe or a pipe gallery), you need to check if the location already exists. In case of line locations, this is easiest done in the map, by zooming in to the area where the line location is, and to see if there is already a location in the Asset Inventory. Make sure that the layer location_line is visible (the box in front of it is ticked) and that there are no background layers (OpenStreetMap for example) on top of it (above it in the map legend). If the location already exists, you can continue straight on to adding a new asset. If not, continue with the next paragraph.

2.4.2. Set snapping tolerance

For assets that belong to the network, it is important that they interconnect precisely. There should not be any gaps between the lines of two pipes that are connected in reality. To make sure the lines

Page 18: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

16

all connect precisely, we will make use of the Snapping properties of QGIS. It is recommended to read a bit more about how snapping works in the QGIS user manual. For the English manual: https://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/editing_geometry_attributes.html). The Russian version is not yet fully translated for this section: https://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/editing_geometry_attributes.html. An older version of the manual can possibly help to understand the principle of snapping (though the interface has changed between versions): https://docs.qgis.org/1.8/ru/docs/user_manual/working_with_vector/editing_geometry_attributes.html

In order to set the snapping tolerance for ‘location_line’ make the layer active, then go to the menu ‘Settings’>’Snapping options’ and pick snapping mode ‘current layer’. Probably ‘to vertex and segment’ will be the most suitable one for your use, and you will have to experiment with the tolerance units to see what works best, you can start with 10 map units. Working with the snapping tolerance takes some getting used to and it generally needs some tuning and testing before the settings are comfortable to work with and they may change depending on the type of objects you are working with. It is worth familiarising yourself with the principle and how you can make it work for you, because it greatly increases the accuracy and therefore the reliability of your data. It is recommended to test the settings while working with the test database first.

2.4.3. Add new line location

Once the snapping options are set, you are ready to add a new line location. We will use the example of a water pipe that runs through a pipe gallery. This means that we have one location, containing two assets, the pipe and the gallery.

First, zoom to the area of interest where the line location will need to be added. Similar to adding a point location, make the ‘locations_line’ layer active, click the ‘toggle editing’ button, click the ‘add feature’ button (the mouse cursor will turn into a visor) and draw the line location in the map by clicking along the path of the pipe. As you finish drawing the line, right-click and the location form will pop up. Fill in the relevant data (at least ‘sector’, but in the case of pipes most likely also street and possibly district) and click OK to return to the map, click ‘toggle editing’ to stop editing and click ‘Save’ if you want to save the new location.

If the new line location that you want to create needs to connect to an existing line, you follow the same steps. As you start drawing and your mouse cursor (in the shape of the visor) comes within snapping tolerance distance of the other line (to which you want it to connect) a pink cross will

appear on that line to indicate the location where your new line will be connected. . This will help you to locate the correct connection point between the two lines. As the mouse cursor moves out of range of the snapping tolerance, the pink cross will disappear again, indicating that the snapping will not take place.

2.4.4. Add new asset

Make the layer ‘location_line’ active, and with ‘information’ button click on the location where you want to add the new assets. The location form will pop up with information that was entered earlier. Go to the tab ‘Assets list’. If the location was new, this list will be empty. Similar to the point

assets, you will click on the ‘toggle editing’ button to start editing, and on the ‘add’ button to add a new asset to this location. It will now appear in the list of assets as <NULL> (no values have been filled in yet), select it in this list. Again, the only required field is Asset type, this is

Page 19: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

17

marked with a *. In our example, we will first add the asset of asset category pipelines and of asset type ‘pipe’. In the tab ‘Engineering data’ (Figure 7) you will find again the technical parameters that can be filled in for the asset, most notably the diameter. In the case of line assets these have been greatly reduced compared to the point assets.

Figure 7 Engineering data tab (line assets)

Once you have filled in the relevant information for the newly added asset, click ‘toggle editing’ to stop editing and ‘Save’ if you want to save the new asset. As with the point assets, initially, the new asset will not show up in the list. However, when you close the form and return to the map view, reopen the form with the ‘information’ button at this location, you will see the new asset added to the assets list. You can click on the drop-down list with expression and select ‘column preview’ to choose a field that you would like to see displayed in the list. For line assets this could for example be asset type or pipe material.

Repeat this process for any other asset you would like to add at this location (in our example, the pipe gallery).

2.5. Entering repair data

The collection of repair data is most crucial for the underground assets, as visual inspection is not possible in this case. The example discussed here is for line assets, but would work similarly for point assets. In order to add a repair, it is necessary to first select the asset to which the repair belongs. There are two ways of doing that, either via the map, or via the attribute table.

If you know where the asset is located, you can use the map to select it. Make the layer ‘assets_line’ active. Zoom in to where the asset is located. Use the ‘information’ button to select the asset. The asset form will pop up. If there are two assets at the location you may need to first specify which asset you would like to view. Verify that it is indeed the correct asset that the repair refers to (generally, the repair forms should always refer to a specific ‘assetsid’).

Alternatively, you can make the layer ‘assets_line’ active and right-click on it in the map legend. Choose ‘open attribute table’. You will see all assets in the Asset Inventory (including the point assets). As the repair form should indicate the ‘assetsid’ of the asset that was repaired, you can use this to find the correct asset. Use the filtering option in the bottom left corner of the table (it initially shows ‘Show all Features’ and choose ‘field filter’>’assetsid’ and type the ‘assetsid’ in the box next to it. Choose apply – the table will now only show the relevant asset. In the bottom right corner of

Page 20: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

18

the table you can click the button ‘switch to form view’ , this will open the asset form at the filtered asset.

With the asset form opened at the correct asset, you can now start adding a new repair. Go to the tab ‘Repair’ and click on the ‘toggle editing’ button on the same tab. Similar to adding a new asset to a location, click the ‘add’ button to add a new repair to this asset. It will now appear in the list of repairs as <NULL> (no values have been filled in yet), select it in this list. You can now fill in all the relevant data for this repair. When done, click the ‘toggle editing’ button again to stop editing, and click ‘Save’ if you want to save the new repair. As with the assets, initially, the new repair will not show up in the list. However, when you close the form and return to the map view, reopen the form with the ‘information’ button at this location, you will see the new repair added to the repair list.

2.6. Editing locations, assets and repairs

2.6.1. Editing attributes of single locations, assets and repairs

The principle of editing the attribute information of a single location, asset or repair is the same for all three. First, you will need to select the location, asset or repair that you would like to edit. You can use the relevant attribute table with its filtering functionality to arrive at the correct location, asset or repair. From there you can pick ‘show form view’ to open the form for that particular location/asset/repair.

Alternatively, you can use the map to zoom to the relevant location or asset (and repairs if the burst location has been entered for that repair). Make the relevant layer active, and click on the ‘information’ button to open the form. Verify that the form indeed reflects the location/asset/repair that you would like to edit.

Once you have the form opened at the correct location/asset/repair, click the ‘toggle editing’ button and make the changes that you would like to make. You can also fill in additional fields that may have remained empty before. When you have made the changes, click ‘toggle editing’ again to stop editing and ‘Save’ if you want to save the changes. Close the form to go back to the map view.

2.6.2. Editing attributes of groups of locations and assets

The previous method only allows you to change one location or asset at the same time. To facilitate editing multiple locations or assets some supporting layers are available in the Asset Inventory. For example, you may want to select all the pipes in a certain neighbourhood because you know they are all built in the same year (1980) and with the same material (steel). These bulk editing layers can be found in the map legend under the group ‘assessment views’.

CAUTION: you can easily make accidental changes to all records in the Asset Inventory using this method. Make sure to practice this procedure first in the test database and make sure to have a backup of the Asset Inventory database before you attempt to do this on the production database.

In the map legend make the layer active that you would like to perform the bulk edits on. In our example, this would be the layer ‘bulkediting_assets_line’ as year of construction and pipe material are attributes of assets and we are looking at pipes. Use one of the map selection tools that you find

easiest to work with: . For more information on the selection tools refer to the QGIS user manual (English: http://docs.qgis.org/2.8/en/docs/user_manual/introduction/general_tools.html, Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/introduction/general_tools.html). Select all

Page 21: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

19

the pipes in the map that you would like to edit (they appear yellow in the map) and open the

attribute table of the layer. Use the ‘promote’ button to make all the selected pipes appear at the top of the table (they will be highlighted in blue). Click the ‘toggle editing’ button to start editing. At the top of the table an extra bar will appear (Figure 8).

Figure 8 Table editing toolbar

In the drop-down menu pick the field that you would like to edit, in our example ‘yearconstruction’ and in the white text box in the middle enter the year in which all of these pipes were constructed. Then, be very careful to click the button ‘update selected’, to make sure the edits only apply to our selected pipes! When you are happy with the result, you can select ‘toggle editing’ and click ‘Save’ to save the edits, or ‘discard’ if you do not want to save the edits.

The selected records will remain selected, so you could repeat this process to change the ‘pipematerialid’ for all these pipes. It is not possible to use drop-down menus (such as in the forms) for any of the fields making use of a lookup table. You will therefore have to enter the id of the value you would like to update. For example, in the case of pipe material, we can open the lookup table ‘a_pipematerial’ (right click ‘open attribute table’ in the folder Lookup tables > default) and we will see that the ‘pipematerialid’ for steel is (6). When updating, we will therefore select the column ‘pipematerialid’ and set its value to (6), after which we would select ‘update selected’ to make sure only our selected pipes will be changed to ‘steel’.

2.6.3. Editing geometry of point locations

Select the layer ‘location_point’ and zoom to the location that you would like to change. Click

‘toggle editing’ to start editing and click the button ‘move feature’ . The mouse cursor changes into a black cross, and you can select your point location and move it to the correct place. It will still show the old location for reference purposes, the new location shows with a small red cross through it. If you are happy with the new location, click ‘toggle editing’ to stop editing and ‘Save’ if you want to save the changes.

2.6.4. Editing geometry of line locations

As there are more geometry editing options for lines than for points, it is recommended to read the QGIS user manual on this topic. The English version is available here:http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/editing_geometry_attributes.html. The Russian version for 2.8 is not fully translated but can be found here: http://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/editing_geometry_attributes.html. The Russian manual for version 1.8 is fully translated and might help to understand the principles: http://docs.qgis.org/1.8/ru/docs/user_manual/working_with_vector/editing_geometry_attributes.html )

We will show (3) common examples of editing the geometry of a line. One example is where a line may have previously been drawn in a straight line, but in reality it has a few corners. Another example will be where a line needs to be extended in order to connect (snap) to another pipe. The third example is where a pipe currently is drawn as one line, where in reality it should be two. This

Page 22: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

20

often happens when part of a pipe has been replaced by a different material, so in fact it is two pipes with two different materials.

Example 1:

In the map legend make the layer ‘location_line’ active and zoom in to the line that you would like

to edit. Click ‘toggle editing’ and click the button ‘node tool’ . The mouse cursor will turn imto a black cross. Click on the line you would like to edit. All its vertices (‘corners’) will turn into small red squares. In our case of a straight line we will have two vertices (Figure 9).

Figure 9 Straight line to be edited

Now, you can pick up individual vertices and move them. We would like to make the line go around a building instead of straight through it, for this we need (4) extra vertices. You can add additional vertices by double clicking on the line – a new small red square will appear which you can then move to a desired location. In Figure 10 we added (4) vertices by double clicking, and moved the two middle ones around the imaginary building.

Figure 10 Edited line with extra vertices

When you’re happy with the new geometry, click ‘toggle editing’ to stop editing and choose ‘Save’ if you want to save the changes.

Example 2:

In this example the line on the right needs to be extended to connect to the line on the left (Figure 11).

Figure 11 Lines not connecting

In the map legend make the layer ‘location_line’ active and zoom in to the line that you would like to edit. Click ‘toggle editing’ and click the button ‘node tool’. The mouse cursor turns into a black cross. Click on the line on the right, it will turn red and the end point of the line will show up as a little red square. Pick up this end point (it will turn into a blue square) and drag it in the direction of the left line. As the cursor comes within snapping tolerance distance of the left line, the point will jump onto the line indicating where the connection would be made. Move it to where you want the two pipes to connect (Figure 12):

Page 23: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

21

Figure 12 Connected lines using snapping tolerance

When you’re happy with the new geometry, click ‘toggle editing’ to stop editing and choose ‘Save’ if you want to save the changes.

Example 3:

This example will typically happen when only part of a pipe has been replaced and this part now has a different material. The red line in Figure 13 contains currently one asset of type ‘pipe’, diameter ‘100’ and pipe material ‘steel’. We will split it at the corner into two pieces of pipe, where the vertical section should be ‘HDPE’ and 80 mm, and the horizontal section should remain ‘steel’ and 100 mm.

Figure 13 Line asset to be split

In the map legend make the layer ‘location_line’ active and zoom in to the line that you would like

to edit. Click ‘toggle editing’ and click the button ‘split feature’: . The mouse cursor changes into a visor. Draw a line from one side of the line we want to split, through the corner where we want the split to occur, and on to the other side. For the second click (in the corner) we have to make sure that the cursor is within snapping tolerance distance from the corner (the corner turns into a pink cross) so that the split will occur exactly in the corner (Figure 14).

Figure 14 Drawing splitting line using snapping tolerance

The third click will be on the other side of the pipe line. Right click to finish drawing the ‘splitting line’. The line location has now been split into two parts. Verify this by using the ‘information’ button and selecting each pipe section in turn. Click ‘toggle editing’ and ‘Save’ if the split went as you wanted.

Click on the first line section with the ‘information’ button, and verify the location attributes. With the exception possibly of the ‘locationid’, all attributes should be the same as of the original location. Then, check the tab assets list. This may contain the original asset, or it may not. If it contains the original asset, we need to verify the asset attributes. In our case, it contains the original asset (steel and 100 mm), whereas it should have the new asset properties (HDPE and 80 mm, and the current year for year of construction). In this example, we would ‘toggle editing’ in the assets

Page 24: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

22

list, select this original asset, and change the diameter, material and year of construction. When the attributes have been changed, ‘toggle editing’ again to stop editing and save the changes.

Next, click on the second pipe section with the ‘information’ tool, and verify the location the location attributes. Then, click on the tab assets list. In our case, this location does not contain any assets. We will have to add a new asset of type pipe, with diameter 100 mm and of type steel and save the changes.

2.7. Deleting locations and assets

2.7.1. Deleting a location

Locations can only be deleted by a user who has administrator rights (in the default installation this would be the user ‘u_admin_gis’). Select the layer ‘location_line’ or ‘location_points’ from which you want to delete a location in the map legend. Click ‘Toggle editing’ to start editing. Select the location you want to delete in the map, or in the attribute table. If you have administrator rights, the

delete button will be available. Click it, then click ‘toggle editing’ to stop editing and ‘save’ if you are sure you want to delete the location and all the assets and repairs that it contains.

2.7.2. Deleting an asset

Assets can only be permanently deleted by a user who has administrator rights (in the default installation this would be the user ‘u_admin_gis’). However, a user with editing rights (in the default installation this would be the user ‘u_water_gis’ or ‘u_waste_gis’ depending on the sector) can mark an asset as ‘to be verified’ – after which an administrator can permanently delete the asset from the Asset Inventory.

For the administrator, deleting an asset works the same as for deleting a location: select the asset that needs to be deleted either in the attribute table, or in the map. ‘toggle editing’ to start editing, and click the ‘delete’ button to delete the selected asset. ‘toggle editing’ again to stop editing and ‘save’ if you are sure you really want to delete the asset.

For the user with editing rights, deleting an asset works the same as editing the attributes of an asset. Select the asset that needs to be deleted and open the assets form. ‘toggle editing’ to start editing and click the box in front of ‘should be verified’ in the tab ‘main information’ (Figure 15).

Page 25: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

23

Figure 15 Marking an asset ‘to be verified’

Click ‘toggle editing’ again to stop editing and ‘save’ if you want to save the changes to this asset. It will remain in the Asset Inventory, until the administrator permanently removes it.

2.8. Backup

Creating backups for the Asset Inventory will most likely be done by a system administrator and not by the user. This section is written assuming that the reader is familiar with system administration and has enough rights to carry out the procedures. It is also assumed that the reader has read the Set up instructions for Asset Inventory – particularly the section on running SQL scripts.

2.8.1. Making a backup of the database

There are many ways of making backups of PostgreSQL databases, from the command line or using a GUI, scheduled or not. Use the internet to find out more about the options that are most suitable for your organisation. Here, we will give an example of making a backup of the database using the GUI PgAdminIII.

Page 26: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

24

1. Startup ‘PgAdminIII’, and right click on the database you would like to backup, in this case ‘ai_production’. Choose “Backup”

2. Browse to the desired location and give it a descriptive file name. Leave the default parameters and check the tab “Objects” and make sure all tables are selected. Click Backup (Figure 16).

Figure 16 Making a backup of the Asset Inventory database

3. Check for error messages 4. After making a backup, it is good practice to create a temporary empty database (as

described in the Set up instructions for Asset Inventory) and make a test restore into this empty database, to check if the backup was created correctly and can restore without complications.

2.8.2. Restoring the database

Before restoring a backup into a production database, it is good practice to create a temporary empty database (as described in Set up instructions for Asset Inventory) and make a test restore into this empty database, to check if the backup can restore without complications. To restore do the following:

Page 27: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

25

1. In ‘pg_admin’, right click on the database that you want to restore into. Choose restore. 2. Navigate to the backup file with extension .backup and click Restore (Figure 17)

Figure 17 Restoring a backup of the Asset Inventory database

3. Check for error messages

If you have done this successfully in a temporary test database, you can repeat the process in the production database.

2.8.3. Resetting some database settings

There are some database settings that do not automatically get restored after a database restore. These need to be set separately.

Page 28: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

26

During the installation procedure, roles, privileges and users were created and assigned in the database, using 3 SQL scripts. These scripts may have been changed from the default scripts by the system administrator. The script ‘assign_privileges.sql’ will need to be run again on the restored database to restore the privileges (access rights) on tables. If this script has been changed during installation, use the changed script (and not the default one as downloaded from the website).

1. Select the database that was restored (in our example ‘ai_production’), and click on the ‘SQL’ button to open a Query window (Figure 18).

Figure 18 Opening the Query Window

2. Open the script ‘assign_privileges.sql’ 3. Run it by clicking the green arrow button 4. Check for error messages and troubleshoot if there are error messages 5. When everything is OK, open a new Query window 6. Type the statement select setpath() and click the green arrow button to execute the

statement 7. Check for error messages

2.8.4. Backup of the project file

While the previous sections referred to the backing up of the Asset Inventory database, this section refers to the Asset Inventory project file (.qgs file format). As described in the Introduction this file does not contain any data but a lot of settings that might take a long time to set again if the file would be lost. It is recommended to make regular backups of all project files by making a copy of them to another location, or by including them in the standard file backing up procedures.

3. STANDARD QGIS TOOLS FOR DATA ANALYSIS

As mentioned before all QGIS functionality is available in the Asset Inventory. We will not discuss all QGIS functionality (that is done in the QGIS user manual), but we will highlight some of the most relevant tools here that will make working with the Asset Inventory more productive.

3.1. Working with attribute tables

As mentioned earlier in the manual, one very important aspect of working with GIS data is that each layer containing geometry consists of two interlinked parts: while all information is stored in tables, there is also information available in the map – the geometry. Here we will make more use of this principle.

In the editing section we have already described how multiple assets can be selected in the map using the selection tool, after which the attribute Table can be opened to view the selected assets in the Table and perform some analysis only on the selected records (in that particular example a bulk

Page 29: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

27

update on some attribute information). This example showed how to use the map to find the corresponding records in the Table.

The reverse is also possible. To illustrate this, right-click in the map legend on the layer ‘location_line’ and open the attribute Table. In earlier examples we used the built-in filtering functionality (at the bottom left corner of the Table), for example to find a specific asset using

‘assetsid’. Alternatively, we can use the query builder to specify criteria which can be used to make a selection.

In our example, we will select all the locations that are in Kirovskyi district (Figure 19).

Figure 19 Using the query builder in QGIS 1. Single click on Fields and Values to get a list of fields that are available in the Table 2. Double click on ‘district’ so it appears in the left section of the query builder 3. Single click on ‘=’ 4. Single click on ‘all unique’ to get a list of possible values for districts 5. Double click on ‘Kirovskyi’. The selection expression now reads “district” = ’Kirovskyi’ 6. Click on ‘select’ followed by Close

In the title bar of the attribute Table it will now show you how many records have been selected out of a total number of features. You can use the ‘promote’ button to move all the selected records to

the top of the table. Then, you can use the ‘zoom to selected’ button to view the selected records in the map. Close the attribute table window to see the result of the selection in yellow in the map.

The query builder has very powerful selection possibilities and is capable of processing complex expressions that we will not be going into here. For more information read, for English: http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/query_builder.html and http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/expression.html, for Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/query_builder and htmlhttp://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/expression.html

Page 30: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

28

3.2. Data visualisation

3.2.1. Labelling

To help working with data in the map view it can be helpful to label certain layers. As an example we will label all the streets (layer ‘a_streets’) with the streetname. In the map legend, double click on the layer ‘a_streets’ (in the group Lookup tables, Editable). This will open the properties window for this layer. In the left pane of this properties window select Labels. In the top drop-down menu choose ‘show labels for this layer’ and in the next line “Label with” select the field that you want to use for the labelling (in our example, ‘streetname’). Click OK to return to the map. All streets have now been labelled with the value from the field ‘streetname’ (Figure 20).

Figure 20 Simple labelling of streets

It is possible to create more complex labels by using the expression builder (Figure 21):

Figure 21 Labelling using the expression builder

Here we combined the streetname followed by a space and then the ‘streetsid’. The result looks like the example in Figure 22:

Page 31: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

29

Figure 22 Advanced labelling of streets

For more information on labelling options read for English: http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/vector_properties.html#labels-menu, or in Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/vector_properties.html#labels-menu

3.2.2. Styling

In addition to labelling we can also use styling to make the map more informative. In this example we will draw the layer ‘assets_line’ in different colours depending on the ‘pipematerial’ of the asset. In the map legend, double-click on the layer ‘assets_line’ to open the properties window of this layer (Figure 23).

Figure 23 Style window - Categorized

Page 32: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

30

1. Click on style 2. In the first drop-down menu choose ‘Categorized’ 3. for Column pick the field ‘pipematerial’ 4. Click classify – this will create different colour lines for each pipematerial 5. Then click OK to look at the result in the map.

The result looks like Figure 24 with each material showing in the map with its own unique colour:

Figure 24 Simple styling of line assets

A slightly more complex method of styling can also be used, using. In this example we will draw pipes which were constructed before 1990 in a different style than those constructed after 1990. In the map legend, double-click on the layer ‘assets_line’ to open the properties window of this layer (Figure 25).

Figure 25 Style window – Rule based

Page 33: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

31

1. In the layer properties window click Style 2. In the first drop-down menu select ‘Rule-based’ 3. Click on the green plus sign to add the first rule. The rule properties window will pop up

(Figure 26)

Figure 26 Rule properties window

4. Give the rule a label that will be visible in the map legend 5. Create the first rule, in this case “yearconstruction” < 1990. You can click the … button to

use the expression builder to build this expression 6. Click OK

Repeat steps 3 to 6 for each rule (in this example we have 3 rules, one for old pipes, one for new pipes, and one for pipes without year of construction).

7. When all rules are created click OK.

The result will look something like the example in Figure 27:

Page 34: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

32

Figure 27 Advanced styling of line assets using rules

For more information on all the options with regard to style read the QGIS User Manual. For English: http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/vector_properties.html#style-menu

For Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/working_with_vector/vector_properties.html#style-menu

3.3. Data export to Excel

Often, the data analysis in QGIS is only part of the analysis. For example, one might want to make pivot tables in MS Excel in order to analyse the state of the network (see examples in the Asset Management Planning manual). In this example we will export the information from the layer ‘assessment_line’ (in the group Assessment views) to Excel for further analysis.

Open the attribute table of the layer ‘assessment_line’ (in the map legend righ-click on the layer and

choose ‘open attribute table’). Click on the button ‘select all’ if you would like to export all records, or make a selection of records by using the query builder (for example, only export the lines assets from one particular district). The selected records will be highlighted in blue. Click CTRL-C to copy all selected records. Open MS Excel. In the top left cell (A1) click CTRL-V. All selected records will now have been pasted into Excel where you can continue with further analysis.

3.4. Printing a map

There are several ways of printing maps in QGIS. We will describe a very straight forward way to just export the map view to an image format, such as .jpeg. You can use any available printing method that works well for your chosen image format.

In the map view, zoom in to the area you would like to have printed and make sure the layers that you want to show are visible. In the menu Project > Save as image > select file format, file location and file name. Click Save. In our example this is the resulting .jpeg (Figure 28):

Page 35: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

33

Figure 28 Map view exported to .jpeg

With the built-in QGIS print composer, you will have more options to format your map (adding legends, north arrows, change many printing settings and export formats). How to work with the print composer is described in the QGIS User Manual, for English: http://docs.qgis.org/2.8/en/docs/user_manual/print_composer/print_composer.html, for Russian: http://docs.qgis.org/2.8/ru/docs/user_manual/print_composer/print_composer.html

Page 36: Using the Asset Inventory · 2016. 5. 24. · USING THE ASSET INVENTORY 6 1.1.3. The project directory The Asset Inventory provides the full functionality of QGIS. It has been extended

USING THE ASSET INVENTORY

34

ANNEX 1 DATA CONVERSION

The general steps that will need to be carried out for a conversion are similar for all types of source data:

1. Identify the information that is available in the source data which can be used for the Asset Inventory and ‘map’ the matching fields. Beware of what units the data are in, and that fields that are called the same might have different meanings.

2. Establish the correct coordinate conversion. The coordinates in the Asset Inventory are stored in a projected coordinate system (WGS84/Universal Transverse Mercator zone 36 North). Using a projected coordinate system makes it easy to combine geographical information from different sources (for example GPS coordinates, Google Maps/Open Street Map). If the source data are in a GIS they are likely to have some Coordinate Reference System associated with them. If this is the case, both QGIS and PostgreSQL will be able to handle the geometry conversion with standard functionality. If the source data are from a CAD or hydraulic model, it may only have a local coordinate system that has no direct relation to a Coordinate Reference System In the following links you can find more background information on coordinate systems. For English: http://docs.qgis.org/2.8/en/docs/gentle_gis_introduction/coordinate_reference_systems.html and https://docs.qgis.org/2.8/en/docs/user_manual/working_with_projections/working_with_projections.html For Russian: http://docs.qgis.org/2.8/ru/docs/gentle_gis_introduction/coordinate_reference_systems.html and https://docs.qgis.org/2.8/ru/docs/user_manual/working_with_projections/working_with_projections.html If you are carrying out a ‘manual’ conversion, you will after this step have your source data in a background layer in the correct location, and you can start manually entering the data as described in Chapter 2. For carrying out an automated conversion, continue with step (3).

3. Write code to carry out the conversion. After using any of the available Open Source tools (for example ogr2ogr) to import your source data into PostgreSQL you can now use SQL to translate the source data to the Asset Inventory database. If you do not have free access to your source data because it is part of proprietary software, you may need to employ the software company to carry out the conversion for you.

4. Perform a quality check. Mistakes are easily made, and the end user will have to take a close look at the converted data, and verify that the data have been transferred correctly.