3vector and Data Structure
3vector and Data Structure
3vector and Data Structure
3.1 PURPOSE
The aim with this exercise is to get an understanding of vector data structure and learn some
basics about digitizing on screen. You will create your own spatial data (shapefiles) and
describe them by adding some attributes. The three different feature types will be treated:
points, lines and polygons.
3.2 DATA
The file you need for this exercise is an image file, stored in TIFF-format:
touristmap.tif
Copy the file DATA3_Vector_Structure to your computer.
In your file manager, create a new folder called “3_Vector_structure”, under “C:\GIS\”,
and copy the necessary data.
The image file is a scanned map of southern Sri Lanka taken from an atlas. The image is
not yet geo-referenced, meaning that it cannot be used together with other GIS data of Sri
Lanka directly. It is neither possible to measure distances on the image. Just see it as an
example of what you can do with a scanned map.
Images are stored as raster data, where each cell in the image has a value that determines the
color or level of grey of the cell. Shapefiles and Coverages (vector data) are saved with
“real- world” coordinates. In order to display images together with such data, it is necessary
to establish an image-to-world transformation that converts the image coordinates to real-
world coordinates. This transformation information can be saved with the image as a header.
Otherwise, it can be defined with a so-called “world file” (*.tfw), which contains the geo-
referencing information of the image. You will not do this in this introduction exercise, but if
you want to know more about it, use Help in ArcGIS desktop to search for world file.
⇒ In a further exercise – raster structure – you will learn how to geo-reference raster data.
3.4 METHOD
Connect ArcGIS to the data folder: Start ArcCatalog and connect to the folder :
“3_Vector_structure” and your items will appear in the Contents tab listed with name
and type of data.
1
Get an overview of the data using ArcCatalog: Click on Preview tab and take a look at
touristmap.tif. You can even zoom in and/or pan through the image showing the
southern part of Sri Lanka.
Open a new map document and add the data in ArcMap: Start ArcMap from
touristmap.tif by clicking on .
2
Create a new shapefile in ArcCatalog. Go back in ArcCatalog and click File > New>
Shapefile. In the Create New Shape file dialog box appearing, Name the new shapefile
coastline and select Feature type: Polyline, since the coastline is a line.
Click OK and the coastline.shp appears as an item in the ArcCatalog Contents tab. By
creating a new shapefile, the three essential files making the shapefile (*.shp, *.shx
and *.dbf) are automatically created. Have a look in Windows Explorer. Clicking the
Preview tab, you see that it is empty. The next step is to add features to this theme.
Add features to your new shapefile in ArcMap: Go back to ArcMap, and add your new
theme Coastline to the view. Open the attribute table by right-clicking in
Coastline.shp in the Table of Contents and choosing Open Attribute Table. Notice 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 coastline in your currently empty shapefile
(coastline.shp) based on the scanned map touristmap.tif. Select coastline.shp in the
Table of Contents, click Start Editing in the Editor scrollbar (if you do not see the
Editor toolbar, activate it through View > Toolbars > Editor). Choose Create New
Click the pen symbol and place the cursor on the map where you want to begin
digitizing. Click with the mouse once to place the first vertex (node). Then move the
cursor along the coastline and place vertices until you reach the end of the coastline,
where you double right-click to place the end vertex (node). Click Save Editing from
the Editor drop-down menu. The line you just digitized appears as a turquoise (light-
blue) thick line, which indicates that it is selected. If you are not happy with your
digitization, you can simply press the Delete button on your keyboard and start again.
When you are satisfied with your coastline, click Stop Editing and save your edits.
Changing color and thickness of Symbols: If you would like to change the color and/or
thickness of the line, right-click on coastline in the Table of Contents and select
Properties from the drop-down menu. In the Layer Properties dialogue box, click on
the tab Symbology, and in the Symbol Selector dialogue box that appears, you can
choose a new color and change the width of the line.
3
For each features digitized, a record will be created in the attribute table. When you have
finished your edits, they must always be saved, otherwise, everything will be lost (both
attributes and features). Before saving, they just exist in the temporarily memory of the
computer.
Deleting a vertex: Click Editor > Start Editing. Choose Click on Edit Vertices . The Edit Vertices
Dialogue box appears, click the black arrow button of the leftmost side to modify sketch vertices.
Move the cursor in the map and select the digitized line by clicking on it. The line turns green
with the vertices visible as small boxes. All the vertices are dark green except the last one
which is red. You can select a vertex by simply clicking on it. To delete it, right- click on
the vertex and choose Delete vertex from the drop-down menu.
Moving a vertex: There are several ways to move vertices. You can simply click on one
to select and then move it with the mouse, or right-click and choose Move To… In
the latter case, a new dialog allows you to type in the coordinates of the new location
of the vertex. Try it by changing one of the coordinates of a vertex. Right-click again
on the same vertex and change the coordinates back to the original ones. When you
finished editing, DO NOT FORGET TO CLICK Stop Editing!
4
3.4.4 Adding attributes to a table
Open the attribute table of coastline.shp. At the moment, there is only one record in the
table, your coastline. If you had digitized more than one-line, other records would also
have been added to the table. ArcGIS automatically creates the three fields, FID, Shape
and ID.
In the field FID, the Feature Identification is set automatically by the program and cannot be
changed by the user. The field Shape is a field ArcGIS uses to define what kind of feature
described (in this case a polyline). Without the shape field, no feature could exist in the View.
You cannot edit this field.
The field Id is an identification number that is set to 0 by default, but you can change it to
any number you like. If you select the feature row in the Attribute Table by clicking the
gray frame left of the table, the row changes to a turquoise color (selected).
Minimize the Attribute Table to see both the table and the map. Notice that the feature
on the map is also the same color (turquoise) as in the table.
Add a field to the Attribute Table: Click the Options button in the top-left corner of the
table Attributes of coastline and choose Add Field. The Add field dialog box appears.
Name the field Descript and choose to have the Type* of field as Text from the drop
down list. Under Field Properties change the Length of field to 25 (the number of
characters allowed). Click OK.
*Data Type of field: According to what data you want to put in the added field: Short
Integers or Long Integers, when you add numbers without decimals. Float or Double,
when you add numberswith decimals. Text,whenyou want to add text. Date,when you
want to adda date, and Blob if you want to add a file path or link a picture or other
media files.
Add data to a cell in the field: You can add fields without activating Start Editing, but
you cannot thereafter edit the fields or records without first doing so. Click Editor and
choose to Start Editing. Change the cell value of Id field to 1 (by simply clicking on
the cell) and the cell value of Descript to southern coastline and press Enter. Then do
not forget to Editor > Stop Editing!
When you save your edits, they are written into the dbf-file. You always have to be careful when
making changes to a shapefile, because it can sometimes happen that data is accidentally
deleted or modified.
- Close the table and save your project (map document) - File > Save.
3.4.5 Creating a polygon theme
Add new shapefile with polygon features: Go to ArcCatalog and create a new shapefile
to create polygons, and name it national_parks.
5
Digitize polygons: in ArcMap, add national_parks to your view and activate the editing
function to start digitizing polygons (a “polygon” in ArcGIS can either be a rectangle,
a circle or a polygon). Note: Do not forget to set Target:national_parks.
Click and digitize the two national parks and the rain forest visible on the map.
Follow the contour of the National Park and click to place vertices (double-click to
stop).
Open the Attribute table for the theme and add a field called Name. The field will contain
text and should have a length of 25 . Type in the names of the parks in the table.
Add another field where you type in some species of animals living in the parks. Do
not forget to stop editing and save your edits.
Change the color of the polygons to give them an appropriate color for parks/forests.
6
3.4.7 Exporting your map as a picture to insert it in a document
Once you’ve created a map, you can export it from a map document to another
file type. You can export maps as several industry-standard image formats.
These include EMF, BMP, EPS, PDF, JPEG, and CGM. Once your map is
exported as an image, it can be imported in other programs, such as MS Word
and Power Point. The resulting exported image will be exactly what you see in
your View (zooming level, colors, ect.).
Insert both maps in a Word document with Insert > Picture > From file.
Make sure you write your name and all other student info in the document
and save it.
End of exercise 3
⇒ Send your answers to the teacher as
instructed.
3.4.8 Theoretical questions exc. 3
T 3.1 Describe howco-ordinatescan be storedfor a) points, b) lines
and c) polygons when using a simple vector data structure.
T 3.2 Which two characteristics signify a topological data structure, and
what do they mean?
T 3.3 Do you think topology is important? Why/why not?