Professional Documents
Culture Documents
Vector Structure
GISA01
Vector Structure
3 Vector Structure
3.1. Purpose
The aim of this exercise is to provide you with an introduction to the vector data structure
and to on screen digitizing. More specifically, you will learn:
- How to create and digitize line, polygon and point features.
- How to add fields and attributes in an attribute table.
3.2. Data
In Moodle, you can find a zip-file with the name DATA3_Vector_Structure. Download
and save the file to your computer and use WinZip to unzip the files. The unzipped files
contain the following data:
Touristmap Image file: .tif, .xml. The .xml file contains metadata information about the
image.
Create a folder in your local working directory with the name 3_Vecor_structure (e.g.
C:\GISA01\Practical\3_Vector_structure). It is recommended that you keep an organized
file structure on your computer.
3.3. Background
We will not go into specific details about raster data management in this exercise (you
will learn how to read and analyze raster data in future exercises). However, a brief
introduction is necessary.
As you might have learned from the lectures, geographical data can be stored using a
vector or raster data structure. In the vector data structure, different geometrical objects
are stored as one or several pairs of coordinates. In the raster data structure images are
stored as an array of pixels or cells and each cell has a value that determines the color or
gray level.
Shapefiles are generally based on real-world coordinates. However, the image file
Touristmap is a scanned map of southern Sri Lanka stored as .tif. The image has no
spatial reference information associated with it (no real-world coordinates). This means
that it will not be displayed correctly together with other data. In order to display images
together with other shapefiles or coverages, it is necessary to establish an image-to-world
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 1
Vector Structure
3.5. Method
Note: If you are not able to see the Geography toolbar in ArcCatalog click View
> Toolbars > Geography in the main menu.
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 2
Vector Structure
- Save your empty map document (File > Save as) as Sri_lanka together with the
other data for this exercise.
- Switch back to ArcCatalog, click the Contents tab and click View > Refresh in
the main menu. Notice that your newly saved map document Sri_lanka now
appears in the Contents tab together with Touristmap.
- Switch back to ArcMap (do not close ArcCatalog) and add the image
Touristmap by clicking . Ignore the message notifying you that the layer is
missing spatial reference information by simply clicking Ok.
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 3
Vector Structure
- Make sure that none of the files in your working directory are selected in the
Contents tab and click File > New > Shapefile in the main menu. The Create
New Shapefile dialog window will appear.
- In the Create New Shapefile dialog window name your new shapefile coastline
and in the drop down menu Feature type select Polyline. Leave all other options
as-is and click OK.
Your newly created shapefile coastline.shp should appear as one of the items in the
ArcCatalog Contents tab and the three essential files making up the shapefile (.shp, .shx
and .dbf) are automatically created. You can check this in Windows Explorer. If you
select the file and click the Preview tab, you will see that the shapefile is currently empty.
You will remedy this by adding new features to the shapefile in ArcMap.
- Click the Sketch Tool and place the cursor on the map in the display window
where you want to start digitizing.
- Click once to place the first vertex. Then move the cursor along the coastline
and place vertices until you reach the end of the coastline where you double
click to place the end vertex. If you are dissatisfied with the placement of a
vertex while digitizing you can undo the last vertex you created by clicking
Undo in the Standard toolbar. Click Undo again to undo the second to last
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 4
Vector Structure
vertex you created, and so on. You can click Redo if you want to re-add the
vertex.
Tip: You can use the tools in Tools toolbar to Zoom in, Zoom out and Pan the
map display window while digitizing.
- Once you have finished digitizing the coastline, click Editor > Save Editing on
the Editor toolbar.
The line you just digitized appears as thick line in light-blue color. This indicates that it is
selected. If you are dissatisfied with the shape of your digitized line, you can simply press
Delete on your keyboard while it is selected and start all over again or you can choose to
edit individual vertices.
Each time you click during the digitizing process, a vertex is created. You can reshape a
line or a polygon of a selected feature by deleting or moving individual vertices.
- Click the Editor Tool in the Editor toolbar and then double click the
digitized line in the map display window. The line turns green with all of the
vertices visible as tiny green boxes except the end vertex, which is highlighted
as red.
- Position the cursor over a vertex and left click to move it or right click and
choose Delete Vertex to delete it. You can also insert a new vertex by right
clicking along the line where you want it placed and selecting Insert Vertex.
There are several ways of editing vertices. You can simply click on one and then drag it
(as described above) or you can right click a vertex and choose Move To. In the latter
case, a new dialog window Move To appears that allows you to type in the coordinates of
the new location of the vertex. You can also click Sketch Properties in the Editor
toolbar. The Sketch Properties Window lists the coordinates of all vertices along the line
(they are also editable in this window). Remember however, that the coordinates are not
real-world coordinates so the Move To option or Edit Sketch Properties window might
not be very useful in this case.
- When you are satisfied with your coastline, click Editor > Save Edits and then
Editor > Stop Editing. Save your map document as well.
Note: When you click Stop Editing or if you close ArcMap during an editing
session you will be prompted to save your edits. If you do not choose to save,
your edits will be lost.
Before adding attributes, you might want to change the appearance of the line
representing the coastline. This is done by either clicking the line symbol below
Coastline in the TOC or by right clicking the layer name, choosing Properties and in the
Layer Properties window by clicking the Symbology tab and finally the line symbol.
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 5
Vector Structure
FID stands for Feature Identification Number. A value for FID is set automatically. The
field Shape * defines the type of feature, in this case a polyline. The field Id is an
identification number that is set to 0 by default. Neither the FID nor the Shape * field can
be edited. Anyhow, lets add a new field.
- Click the Options button in the lower right corner in Attributes of coastline and
choose Add Field. The Add Field dialog window appears.
Note: If you get a message telling you that cannot add a field to the selected
table/feature. It might be that ArcCatalog has locked the file for editing. Just
close ArcCatalog and try to add a field again.
- Name the field Descript and in the Type drop down menu select Text. In Field
Properties change the value for Length to 25. This sets the maximum number of
characters allowed in the field to 25. Click OK. A new field called Descript
should appear in Attributes of coastline.
As you might have noticed, you can select different data type options at Type in the Add
Field dialog window based on what type of data you want in the added field. The options
Short Integer and Long Integer are basically used when you want numbers without
decimals. Float and Double are used for numbers with decimals. Text is for alphanumeric
symbols and Date is for date or time. You can read more about the different data types in
ArcGIS Desktop Help.
- Click Editor > Start Editing in the Editor toolbar.
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 6
Vector Structure
- Change the cell value in the field Id to 1 by simply double clicking in the cell.
Then double click the cell for Descript and type in Southern coastline. Finally
click Editor > Save Edits and Editor > Stop Editing.
When you save your edits, they are written to the file with the .dbf extension. Always
take care when making changes to a shapefile so that records are not accidentally deleted.
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 7
Vector Structure
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 8
Vector Structure
15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 9