3 Input data to Vector Layers
3.1 Preparation for Data Editing
3.2 Editing Data
3.3 Editing Geometry

Premise:PostgreSQL
user
name=‘yokoi’, password=‘yokoi’(This can create new database)database
name=‘valley’ owned by user ‘yokoi’(This is connected to PostGIS)
tablesname=buildings, type=POINT
name=roads, type=LINESTRING
name=open_spaces, type=POLYGON

1

3.1 Preparation for Data Editing

Double click on ‘Quantum GIS’ icon.
Logo of Quantum GIS appears.

Then, Quantum GIS 0.9.1 starts.

2

Double click on ‘Add a PosGIS Layer’.

‘Add PostGIS Tables’ dialog opens.
Click on ‘New’.

‘Create a New PostGIS connection’ dialog opens.
Type in:Name (of connection): ‘connect to valley’ (arbitrary),
Host: ‘localhost’ (fixed),
DataBase: ‘valley’ (target database),Port: ‘5432’ (fixed),
Username: ‘yokoi’ (User of PostgreSQL)
Password: ‘yokoi’ (Password of above user).
Then, click on ‘Test Connect’.

3Click ‘OK’ if successfully connected.

Then, click on ‘OK’.

Click ‘Connect’.

Then, three tables appear here.

4Select all these three tables andclick on ‘Add’.

Three tables are connected to QGIS as vector layers.

5Manipulating PostgreSQL Database & Tables with pgAdmin III & QGIS 5
User Account=postgres
PostgreSQL DataBase Server 8.1
Internal DataBase
Superuser=postgres

Account=Administrator
Account=user
PostgreSQL DataBase Client

DataBase=“TEST”
Table=“buildings”

Table = PostGIS Layer

PostGIS Layer(“buildings”)

Table2QGIS

Table?

On MicroSoft Windows

Connect to the raster layer (Satellite Image) that is used as BaseMap.

6‘Tai_wide_G.tif’ is a GeoTiff file that was exported from GRASS
after georeferencing and rectfying and also Pylamidized. Itsgeoreferencing information is stored in ‘Tai_wide_G.tfw’. Thesetwo files compose a GeoTiff file.

Select ‘Tai_wide_G’ layer in the left panel and‘Zoom to Layer’ button.

Then, the selected ‘Tai_wide_G’ layer isdisplayed.

7

Drug down ‘Tai_wide_G’ layer in the left panel.

Take tick off from other layers.

Click the left button on the ‘Tai_wide_G’ layer andput check ‘Shown in overview’ box on.
Then, the overview if this layer is displayed in the
Map overview area.

Map overview area
Panning

Zoom to Selection

Zoom in

Zoom out

Zoom to Layer

Zoom full

Zoom lastRefresh8

Zoom in a target. Set thescale 1:2500

Overview Area

Type in the scale

3.2 Editing Data

9

From ‘Setting’ in Menu bar select ‘Project
Properties’. Then, ‘Project Properties’
dialog appears.
Confirm that the ‘Snapping Toplerance’ isset ‘0’.

Click on ‘Toggle Editing’ button to startdata input.

Editing POINT data10

Select ‘building’ layer and put check box on.

Click on ‘Toggle Editing’ button to allow editing
this layer. (By default QGIS loads layers read-only.
‘Capture Point’ button is put on simultaneously. Ifnot click on ‘Capture Point’ button also.
Confirm that the cursor changes its shape to an
aim mark.

Click on a building. For example a white color big roof.
‘Enter Attribute Value’ dialog appears.

11Type in the corresponding attribute values and clockon ‘OK’.

Note that a mark appears on the targeted building.

After typing in the data for all targeted buildings, clickthe ‘Toggle editing’ button again.
Then, ‘Stop editing’ dialog appears. Click on ‘Save’ ifeverything goes well. The edited data are saved inPostgreSQL table ‘buildings’.

Click on ‘Identify Feature’ button.

12

Click on a mark on ‘buildings’ layer. Then,‘Identify Result…’ appears and shows thedata saved in the PostgreSQLtable ’buildings’.
Close it.

If you find a necessity to revise the data, clickon ‘Toggle editing’ button.

Then, edit the necessary part.

13

Editing LINESTRING data

Select ‘roads’ layer and put check box on.

Click on ‘Toggle Editing’ button to allow editing
this layer. (By default QGIS loads layers read-only.
‘Capture Line’ button is put on simultaneously. If
not click on ‘Capture Line’ button also.

Confirm that the cursor changes its shape to an
aim mark.

14

Click on points along the target road and finally
click the left button.
‘Enter Attribute Values’ dialog appears.
Type in the data and finally click ‘OK’.

The targeted road andpoints (verteces) appear.

After typing in the data for all targeted roads, clickthe ‘Toggle editing’ button again.
Then, ‘Stop editing’ dialog appears. Click on ‘Save’ ifeverything goes well. The edited data are saved inPostgreSQL table ‘roads’.

Click on ‘Identify Feature’ button.

15

Click on a mark on ‘roads’ layer. Then,‘Identify Result…’ appears and shows thedata saved in the PostgreSQL table ’roads’.
Close it.

If you find a necessity to revise the data, clickon ‘Toggle editing’ button.

Then, edit the necessary part.

16

Editing POLYGON data

Select ‘open_spaces’ layer and put check box on.

Click on ‘Toggle Editing’ button to allow editing
this layer. (By default QGIS loads layers read-only.
‘Capture Polygon’ button is put on simultaneously.
If not click on ‘Capture Polygon’ button also.

Confirm that the cursor changes its shape to an
aim mark.

17

Click on points around the target open space andfinally click the left button.
‘Enter Attribute Values’ dialog appears.
Type in the data and finally click ‘OK’.

The targeted open spaceand points (verteces)
appear.

After typing in the data for all targeted roads, clickthe ‘Toggle editing’ button again.
Then, ‘Stop editing’ dialog appears. Click on ‘Save’ ifeverything goes well. The edited data are saved inPostgreSQL table ‘roads’.

Click on ‘Identify Feature’ button.

18

Click on a mark on ‘open spaces’ layer.
Then, ‘Identify Result…’ appears and shows
the data saved in the PostgreSQL
table ’open_spaces’.
Close it.

If you find a necessity to revise the data, clickon ‘Toggle editing’ button.

Then, edit the necessary part.

19

After completing the tasks for editing, ‘File’ and‘Save Project As’.

Save the project as‘Tai.qgs’ in‘C:¥cygwin¥home¥yokoi’for this example.

The saved project can be used in thenext session. Connection toPostgreSQL tables are saved also.

20

3.3 Editing Geometry

It is necessary to edit geometry of newly digitized vector layers except POINT
type one.
PostGIS does have the functionality for editing geometry but command base.
QGIS does not have the functionality for editing geometry.
GRASS does have the functionality for editing geometry in GUI base.
andIt is possible to edit geometry of vector data from QGIS through its GRASSEdit Dialog.
First, PostgreSQL tables areimported to GRASS through
PostGIS. Then, the importedlayer is edited and exported
from GRASS to PostgreSQL
through PostGIS again.
This topic will be explained later.

21