You are on page 1of 10

Practical Exercise 3

Vector Structure

Department of Physical Geography and Ecosystems


Analysis, and GIS Centre at Lund University, Sweden

Introduction to Geographical Information Systems

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

transformation. An image-to-world transformation converts the image coordinates to real-


world coordinates. Usually, this transformation info is stored with the image in a header
or in a small separate file called World file. A World file is a plain text file that describes
the location of the image. In this exercise you will not define the real-world coordinates
of the image Touristmap, just try to look at it as a simple example of what you are able to
do with scanned images in ArcGIS.

3.4. Answers to be sent to teachers


There are no questions to be answered in this exercise. However, all students have to
send in one document with two maps by email to the teachers as indicated in the
document Sending Answers to Teachers available in the section Course Information on
the course homepage.

3.5. Method

3.5.1. Exploring and viewing the data


- Start ArcCatalog and navigate to or create a folder connection to the folder
containing the data for this exercise.
- Select Touristmap in the Catalog tree.
- Click on the Preview tab and take a closer look at the image.
The file Touristmap is a scanned map from an atlas representing the southern parts of Sri
Lanka. When clicking the tab Preview the tools available in the Geography toolbar
becomes active. You can zoom in or out and pan the image by clicking the icons in the
toolbar.

Note: If you are not able to see the Geography toolbar in ArcCatalog click View
> Toolbars > Geography in the main menu.

- Start ArcMap in ArcCatalog by clicking in the Standard toolbar. Choose to


open A new empty map.

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.

3.5.2. Creating a shapefile


You are now going to create three new shapefiles. The first shapefile will represent the
coastline of Sri Lanka as lines. The second, national parks as polygons and the third,
places of interest as points. Each shapefile will be noted as point, polyline or polygon as a
shapefile cannot contain, for instance, both lines and points.
When you create a new shapefile, you can either create a new empty shapefile or you can
base it on an existing shapefile and edit it according to your wishes. Here, you will create
a new shapefile from scratch. Lets start with the Sri Lankan coastline:
- Switch to ArcCatalog.

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.

3.5.3. Editing a shapefile


- Switch to ArcMap and add your newly created shapefile Coastline. Again, if
the message about missing spatial reference information appears just ignore it
by clicking Ok.
- Right click on Coastline in the Table of Contents (TOC) and select Open
Attribute Table. Observe that there are no records in the table yet, since there
are no existing features. Close the attribute table.
You are now going to digitize the southern Sri Lankan coastline based on the scanned
map Touristmap.
- First off, make the Editor toolbar visible in ArcMap by activating it through
clicking View > Toolbars > Editor in the main menu.
- Select Coastline in the TOC and click Editor > Start Editing in the Editor
toolbar.

- 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

3.5.4. Adding attributes to a shapefile


- Open the attribute table of Coastline.
As you may notice, there is only one record in the table, your digitized coastline. If you
had digitized more than one line, there would have been more records in the attribute
table. ArcGIS automatically creates three fields, FID, Shape * and ID.

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.

- Close Attributes of coastline and save your map document.

3.5.5. Creating a polygon and a point shapefile


Now you will create the other two shapefiles. Its basically the same procedure as for
lines.
- If closed, open ArcCatalog and choose to create a new shapefile by clicking
File > New > Shapefile. Give it the name national_parks and in the Feature
Data Type drop down menu select Polygon.
- In ArcMap, add National_parks and click Editor > Start Editing in the Editor
toolbar to begin digitizing the polygons.
- Make sure that National Parks is set as Target, then click the Sketch Tool
and digitize the two national parks Udawa Walawe and Yala and the rain forest
Sinharaja in the tourist map.
- Click to place vertices and double click to stop. Make sure to save your edits
when you have finished digitizing each of the three polygons. Modify the shape
of the features if necessary.
- Open the attribute table for National Parks and add a new field called Name.
The field should have the data type Text with Length 25.
- Type the names of the parks and rainforest in the field Name for each of the
features in Attributes of national_parks.
- Add another field where you type in the type of reserve (National park or
Rainforest). Do not forget to save your edits.

15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 7
Vector Structure

- Give the polygon features an appropriate color. Green is a good choice.

Now finally, create the point shapefile.


- In ArcCatalog create a third shapefile for the point features and name it
places_of_interest.
- Digitize at least 10 places of interest on the map and add a field with names for
each point in the attribute table of Places_of_interest.
- Change the symbol of the point features to a red star.

15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 8
Vector Structure

3.5.6. Exporting a map


Once you have created a map, you can export it from a map document to another file type
such as an image. ArcMap supports a number of common file types including .bmp, .eps,
.pdf and .jpg. Once you have exported the map you can import it in other common
software applications such as Microsoft Word or Open Office Writer. The exported
image will look exactly as it does in the map display view (extent, colors etc).
You should export two maps or images. The first image should contain the shapefiles you
have created together with the image file Touristmap in the background. The second
image should only contain the shapefiles.
- In ArcMap, zoom to Full Extent .
- To export the map in the display window to an image click File > Export Map.
- Save both of your images as .jpg and name them sri_lanka_1 and sri_lanka_2
respectively. Make sure to save them in your working folder together with all
the other files.
- Insert both of the maps in a Word document using Insert > Picture > From
File. Make sure to write your name and all other student info in the document
and save it.

End of Practical Exercise 3

Send your answers to the teacher as instructed

15-01-2010 Copyright 2010. Lund University GIS Centre. All rights reserved. 9

You might also like