GIS AH C6

Revisi per 9 Oktober 2014 16.11 oleh Catriona (bicara | kontrib) (Created page with "==CHAPTER 6== '''Module: Creating Vector Data''' Creating maps using existing data is just the beginning. In this module, you'll learn how to modify existing vector data and...")
(beda) ← Revisi sebelumnya | Revisi terkini (beda) | Revisi selanjutnya → (beda)

CHAPTER 6

Module: Creating Vector Data

Creating maps using existing data is just the beginning. In this module, you'll learn how to modify existing vector data and create new datasets entirely.

6.1 Lesson: Creating a New Vector Dataset

The data that you use has to come from somewhere. For most common applications, the data exists already; but the more particular and specialized the project, the less likely it is that the data will already be available. In such cases, you'll need to create your own new data.

The goal for this lesson: To create a new vector dataset.

6.1.1 [[Image:]]Follow along: The Layer Creation dialogue

Before you can add new vector data, you need a vector dataset to add it to. In our case, you'll begin by creating new data entirely, rather than editing an existing dataset. Therefore, you'll need to define your own new dataset first.

You'll need to open the New Vector Layer dialogue that will allow you to define a new layer. * Navigate to and click on the menu entry Layer ! New ! New Shapefile Layer.

You'll be presented with the following dialogue:

[[Image:]] [[Image:]] [[Image:]]


[[Image:]] [[Image:]]

It's important to decide which kind of dataset you want at this stage. Each different vector layer type is built differently in the background, so once you've created the layer, you can't change its type.

For the next exercise, we're going to be creating new features which describe areas. For such features, you'll need to create a polygon dataset.

  • Click on the Polygon radio button:

This has no impact on the rest of the dialogue, but it will cause the correct type of geometry to be used when the vector dataset is created.

[[Image:]] [[Image:]]

Chapter 6. Module: Creating Vector Data


[[Image:]]

The next field allows you to specify the Coordinate Reference System, or CRS. A CRS specifies how to describe a point on Earth in terms of coordinates, and because there are many different ways to do this, there are many different CRSs. The CRS of this project is WGS84, so it's already correct by default:

Next there is a collection of fields grouped under New attribute. By default, a new layer has only one attribute, the id field (which you should see in the Attributes list) below. However, in order for the data you create to be useful, you actually need to say something about the features you'll be creating in this new layer! For our current purposes, it will be enough to add one field called name.

  • Replicate the setup below, then click the Add to attributes list button:
  • Check that your dialogue now looks like this:

[[Image:]] [[Image:]] [[Image:]]

6.1. Lesson: Creating a New Vector Dataset 93


[[Image:]] [[Image:]]

  • Click OK. A save dialogue will appear.* Navigate to the exercise_data directory.* Save your new layer as university_property.shp.

The new layer should appear in your Layers list. 6.1.2 [[Image:]]Follow along: Data sources

When you create new data, it obviously has to be about objects that really exist on the ground. Therefore, you'll need to get your information from somewhere.

There are many different ways to obtain data about objects. For example, you could use a GPS to capture points in the real world, then import the data into QGS afterwards. Or you could survey points using a theodolite, and enter the coordinates manually to create new features. Or you could use the digitizing process to trace objects off of remote sensing data, such as satellite

[[Image:]]

94 Chapter 6. Module: Creating Vector Data


[[Image:]]

imagery or aerial photography.

For our example, you'll be using the digitizing approach. Sample raster datasets are provided, so you'll need to import them as necessary.

  • Click on the Add Raster Layer button:
  • Navigate to exercise_data/raster/.* Select the file ITB_raster.tif.* Click Open. An image will load into your map. * Find the new image in the Layers list.

[[Image:]] [[Image:]] [[Image:]]

6.1. Lesson: Creating a New Vector Dataset 95


[[Image:]]

You'll be digitizing these three fields:

[[Image:]]

  • Hide all the layers except the raster and the university_property layer.

In order to begin digitizing, you'll need to enter edit mode. GIS software commonly requires this to prevent you from accidentally editing or deleting important data. Edit mode is switched on or off individually for each layer.

To enter edit mode for the university_property layer:

  • Right click on the layer in the Layer list to select it. (Make very sure that the correct layer is selected, otherwise you'll edit the wrong layer)
  • Click on the Toggle Editing button: If you can't find this button, check that the Digitizing toolbar is enabled. There should be a check mark next to the View ! Toolbars ! Digitizing menu entry. As soon as you are in edit mode, you'll see the digitizing tools are now active: From left to right on the image above, they are:* Toggle Edit: activates / deactivates edit mode. * Save Edits: saves changes made to the layer. * Add Feature: start digitizing a new feature.

[[Image:]] [[Image:]] [[Image:]]

96 Chapter 6. Module: Creating Vector Data


[[Image:]]

  • Move Feature(s): move an entire feature around.
  • Node Tool: move only one part of a feature.
  • Delete Selected: delete the selected feature (only active if a feature is selected).
  • Cut Features: cut the selected feature (only active if a feature is selected).
  • Copy Features: copy the selected feature (only active if a feature is selected).
  • Paste Features: paste a cut or copied feature back into the map (only active if a feature has been cut or copied). You want to add a new feature.
  • Click on the Add Feature button now to begin digitizing right away! You'll notice that your mouse cursor has become a crosshair.
This allows you to more accurately place the points you'll be digitizing. Remember that even as you're using the digitizing tool, you can zoom in and out on your map by rolling the mouse wheel, and you can pan around by holding down the mouse wheel and dragging around in the map. The first feature you'll be digitizing is the tennis courts: 
  • Start digitizing by clicking on a point somewhere along the edge of the field.

[[Image:]] [[Image:]]

6.1. Lesson: Creating a New Vector Dataset 97


[[Image:]]

  • Place more points by clicking further along the edge, until the shape you're drawing completely covers the field.
  • To place your last point, right-click where you want it to be. This will finalize the feature and show you the Attributes dialogue.
  • Fill in the values as below:
  • Click OK and you've created a new feature! Remember, if you've made a mistake while digitizing a feature, you can always edit it after you're done creating it. If you've made a mistake, continue digitizing until you're done creating the feature as above. Then:
  • Select the feature with the Select Single Feature tool: You can use:
  • the Move Feature(s) tool to move the entire feature,
  • the Node Tool to move only one point where you may have misclicked,

[[Image:]] [[Image:]] [[Image:]]

98 Chapter 6. Module: Creating Vector Data


[[Image:]]

  • Delete Selected to get rid of the feature entirely so you can try again, and* the Edit ! Undo menu item or the ctrl + z keyboard shortcut to undo mistakes.

6.1.3 [[Image:]]Try yourself...

  • Digitize the athletics field and the swimming pools. Use this image to assist you:

Remember that each new feature needs to have a unique id value.Note: Whenyou'redoneaddingfeaturestoalayer,remembertosaveyoureditsandthenexit

edit mode.

6.1.4 In conclusion

Now you know how to create features! This course doesn't cover adding point features, be- cause that's not really necessary once you've worked with more complicated features (lines and polygons). It works exactly the same, except that you only click once where you want the point to be, give it attributes as usual, and then the feature is created.

Knowing how to digitize is important because it's a very common activity in GIS programs.