Exercise – 1 / Creating features (Shapefiles)
Creating new shapefile;
- Choose Create Layer → New Shapefile Layer from the Layer menu or select it from the Data Source Manager toolbar.
- The New Shapefile Layer dialog will be displayed as shown inthe below figure. Provide the path and name for the Shapefile.
- QGIS will automatically addthe .shp extension to the name you specify.
- Select the type of layer (point, line or polygon)
- Provide desired CRS (coordinate reference system).
- Add the required attribute fields information with field type, length, precision and click on add to fields list and click on OK.
Figure 4 - Create New Shapefile dialog box
Creating features;
- To create new features (point, line or polygon) click on Toggle Editor from Digitizing toolbar to start digitization.
Figure 5 – Toggle Editor from Digitizing toolbar
- Activate Snapping toolbar before starting digitization to avoid snapping errors. To add snapping toolbar, right click on the toolbars and select Snapping Toolbar from the toolbars section.
Figure 6 - Adding Snapping Toolbar
- Provide snapping tolerance by choose →Settings→Option and under Digitizing →enable snapping by default under Snapping and select snapping mode and provide tolerance and click on OK to proceed.
Figure 7 - Snapping Tolerance
- Enable Snapping on the snapping toolbar and start digitizing.
- Click on Add Line Featurefrom Digitizing toolbar to start digitization. After completion of digitization click on Save Layer Edits.
From left to right the tools are:
- Current Edits allows you to manage your editing session. Here you can save and rollback edits for one or more selected layers.
- Toggle Editing provides an additional means of beginning or ending an editing session for a selected layer.
- Save Layer Edits allows you to save edits for the selected layer(s) during an editing session.
- The add Features tool will change to the appropriate geometry depending on whether a point, line or polygon layer is selected. Points and vertices of lines and polygons are created by left clicking. To complete a line or polygon feature right click. After adding a feature, you will be prompted to enter the attributes.
- Features can be moved with the Move Tool by clicking them and dragging them to the new position.
- Individual feature vertices can be moved with the Node Tool. Click on a feature once with the tool to select it, the vertices will change to red boxes. Click again on an individual vertex to select it. The selected vertex will turn to a dark blue box. From there the vertex can be moved to the desired location. Additionally, edges between vertices can be selected and moved. To add vertices to a feature, simply double click on the edge where you want the vertex to be added. Selected vertices can be deleted by clicking the Delete key on the keyboard.
- Edit/modify the attribute of all selected features simultaneously.
- Features can be deleted, cut, copied and pasted with the Delete Selected, Cut Features, Copy Features, and Paste Features
- Undo Edits
- Redo Edits
Note: The above example for creation of shapefile and snapping has shown for Line feature. For creation of point and polygon shapefiles the procedure remains the same.
Comments
Post a Comment