Toggle editing

disturbedoctopusData Management

Nov 27, 2012 (4 years and 8 months ago)

334 views

Creating and Editing
Layers

GeoData Institute

Creating and Editing Layers


Creating new data


Geodatabases


Shapefiles


Editing


Snapping


Editing Attribute data


Saving data


Undo and Redo

Creating New Data


So far, you have used existing data that has been created by
someone else


Often you may need to create your own data from scratch, if it
does not already exist


Alternatively, you may need to edit or update existing data


In QGIS you can:


Create or edit map data


Add and edit attribute data

File based Spatial Databases


Tabular/Spatial data is stored/linked in a single location


Types of geodatabase:


Personal Geodatabase (ESRI)

²
Access database (single file), 2GB limit



File Geodatabase (ESRI)

²
File system folder, 1 TB limit for each dataset (each
file geodatabase can hold many datasets)



SQLite

²
Single file database. ~140TB size limit. Each
database can hold many datasets.



Enterprise (Server based) Databases


PostgreSQL

²
File system folder. No file size limit. Each database
can hold many datasets.

²
Stores PostGIS datasets



SDE Geodatabase


Uses SQL, Oracle….



Spatial & attribute data integrity


Centralized Data Storage


Advanced Analysis Capabilities


Multi
-
user editing

Working with Databases


Quantum is able to read data from the most commonly
used GIS databases such as Personal and File
GeoDatabases (ESRI), SQLite databases as well as
PostgreSQL / PostGIS and databases



QGIS is able to read and write data from SQLite and
PostGreSQL databases.



Quantum can’t write data (yet) to Personal or File
Geodatabases, so to work with data from these you must
first export the data into a usable format such as a
shapefile or SpatiaLite layer.



Moreover, to read data from an ESRI File Geodatabase you
need to add a number of files to the libraries folder in your
QGIS installation which can be downloaded from the ESRI
website. This won’t be covered on this course.

Working with File Databases


As of QGIS v 1.8 the functionality to work
directly with ESRI Files
geodatabases

has
become available.


Please see the additional help file for guidance

Working with Personal Geodatabases


Personal Geodatabases are a type of database used by the ESRI
community.



QGIS has the ability to read data from these, but the data can’t
be edited unless you first export it to a different format
.


Working with Personal Geodatabases


You will notice that the
Toggle editing

tool is
unavailable. This is
because you are not able
to edit data stored in a
Personal Geodatabase.



You need to save the data
as a different format to
be able to edit it.


Working with Shapefiles


The most common file type used in QGIS is the shapefile (.shp).
A lot of the plugins in QGIS will only output to a shapefile.


For the purpose of this course you will only be creating
shapefiles.


Shapefile was the former ESRI standard vector format


Shapefiles are made up of many components:


.
shp

-

stores the map object information


.
shx

-

stores the index of the feature geometry


.
dbf

-

stores the attribute information of the features


Other files may be present for further indices and also for
projection (.prj or .qpj), symbology (.qml) and metadata
(.xml).


Working with Shapefiles


Sometimes you will load a
shapefile which has a
projection (.prj) file that
isn’t recognised by QGIS, or
no projection is defined at
all.



You will then need to define
the projection under the
General

tab in the
Layer
Properties

to give QGIS the
information it needs to
position the data correctly.

Creating a new Shapefile


To create a new layer go to
Layer >
New >
and select the data type you
wish to create. Shapefile and
SpatiaLite layer are available from
this menu.



You will then get a window where
you are asked to set the coordinate
reference system for the new layer.

Creating a new Shapefile

Select if your dataset
will be Points, Lines
or Polygons.

The coordinate
system to use should
already be set from
the previous window.
If not, click on

Specify CRS

and
select the appropriate
one.

Create your attribute
table columns.
Depending on the
data type you choose
you will get options
for field width and
precision. Remember
to click on
Add to
attributes list

after
you create each new
column.

As you add attribute
headings they will
appear in this
window. You can
remove headings
using the
Remove
Attribute

button.

Editing


Start Editing


To start editing, select the layer you
want to edit from the layers window
and either select the
Toggle editing

button from the digitizing toolbar, or
right click on the layer name in the
Layers window and select
Toggle
editing
.



If the digitizing toolbar isn’t visible,
right click in the toolbar area and a
menu will pop
-
up. Select both
Digitizing
and
Advanced Digitizing
.


Digitising toolbar

Advanced Digitising toolbar

click

click

click

click

Right
-
click to
finish drawing

click

click

click

click

click

click

click

Editing


Draw new Features

The capture tool button will vary depending on the
object type of the layer:

Capture Point

Capture Line

Capture Polygon

Right
-
click to
finish drawing

Editing


Draw new Features


When you finish drawing a new feature, an Attribute window will
automatically pop up. You can then enter the attributes for your new
feature.

Snapping


Use snapping to ensure that features you digitise
touch/align with each other.


Due to the high precision used to store coordinates by QGIS,
it is virtually impossible to exactly capture the location of an
existing feature when digitising without using snapping


Snapping options are:


Snap to vertex


Snap to segment (line)


Snap to vertex and segment

Snapping


why bother?

Lines

Polygons

Close


Zoom

Wide

Zoom

Overshoot

Undershoot

(Dangling

Node)

Sliver

Polygon

Snapping Options

Select which layers
you want to snap to

Set the snapping
mode

Set the snapping
tolerance and units

Select if you wish to avoid
overlaps with existing
polygons in the dataset

Select to enable
topological editing

Settings > Snapping Options

Editing


Edit Existing Features

Move feature(s)


Click on a feature from the
currently editable layer to
move it.

Delete Selected

-

Use to delete a
whole feature.

The Node Tool


Selecting and moving vertices


Single click on a vertex to select it, drag to move it


Click and drag a rectangle to select a group of
vertices.


Click on an edge to select the vertices at both ends.


Hold
Ctrl

to add more vertices to the current
selection.



Adding vertices


Double click near an edge to add a new vertex.



Deleting vertices


After selecting one or more vertices, hit the
Delete
key.

When you start editing a layer, you
will notice that all of the vertices
for that layer become visible.

Other Editing


Simplify Feature


Add Ring


Add Part


Delete Ring


Delete Part


Reshape Features


Split Features


Merge Selected Features


Merge Attributes of Selected Features


Adding Attributes



When adding a new feature to a
map, a window will automatically
pop up asking you to fill the
attributes.


This can be deactivated:

Settings > Options >

Digitising Tab


Editing Attributes


Edit from the Attribute
Table


or from the Identify Results
window.





Saving your edits


Save your edits as you work


Click on the
Save Edits

button on the Digitizing toolbar.





You will be prompted to save your edits when you stop
editing if there are any unsaved edits.

Undo and Redo


Use the
Undo

and
Redo

commands from the
Edit

menu
or the corresponding buttons
from the
Advanced Digitising

toolbar.



The Undo / Redo window
maintains a list of sequential
edits since the last save.


Clicking at a location on the
list undoes or redoes edits to
that point in the list