.

Editarea

QGIS suportă diverse capabilități pentru editarea straturilor vectoriale și pentru tabelele OGR, SpatiaLite, PostGIS, MSSQL Spatial and Oracle Spatial.

Note

Procedura pentru editarea straturilor GRASS este diferită - a se vedea secțiunea Digitizarea și editarea unui strat vectorial GRASS pentru detalii.

Tip

Editări Concurente

Această versiune de QGIS nu urmărește dacă altcineva editează o entitate în același timp cu dvs. Vor fi păstrate doar editările salvate de către ultima persoană.

Setarea Toleranței Acroșării și Căutarea Razei

Înainte de a putea edita vertecșii, trebuie să setați toleranța de acroșare și raza de căutare, la valori care să permită o editare optimă a geometriilor straturilor vectoriale.

Toleranţa de acroșare

Snapping tolerance is the distance QGIS uses to search for the closest vertex and/or segment you are trying to connect to when you set a new vertex or move an existing vertex. If you aren’t within the snapping tolerance, QGIS will leave the vertex where you release the mouse button, instead of snapping it to an existing vertex and/or segment. The snapping tolerance setting affects all tools that work with tolerance.

  1. A general, project-wide snapping tolerance can be defined by choosing Settings ‣ mActionOptions Options. On Mac, go to QGIS ‣ mActionOptions Preferences.... On Linux: Edit ‣ mActionOptions Options. In the Digitizing tab, you can select between ‘to vertex’, ‘to segment’ or ‘to vertex and segment’ as default snap mode. You can also define a default snapping tolerance and a search radius for vertex edits. The tolerance can be set either in map units or in pixels. The advantage of choosing pixels is that the snapping tolerance doesn’t have to be changed after zoom operations. In our small digitizing project (working with the Alaska dataset), we define the snapping units in feet. Your results may vary, but something on the order of 300 ft at a scale of 1:10000 should be a reasonable setting.
  2. A layer-based snapping tolerance can be defined by choosing Settings ‣ (or File ‣) Snapping options... to enable and adjust snapping mode and tolerance on a layer basis (see figure_edit_1 ).

Rețineți că această acroșare pe bază de strat suprascrie opțiunile de acroșare globale, stabilite în fila de Digitizare. Deci, dacă trebuie să editați un strat și să acroșați nodurile sale față de un alt strat, atunci activați acroșarea doar pentru strat, apoi scădeți toleranța de acroșare globală la o valoare mai mică. În plus, acroșarea nu va avea loc pentru straturile care nu sunt bifate în caseta de dialog a Opțiunilor de acroșare, indiferent de toleranța globală. Deci, asigurați-vă că ați bifat caseta pentru acele straturi față de care doriți acroșarea.

Figure Edit 1:

../../../_images/editProjectSnapping.png

Editați opțiunilor de acroșare pe bază de strat (Mod Avansat) nix

The Snapping options enables you to make a quick and simple general setting for all layers in the project so that the pointer snaps to all existing vertices and/or segments when using the ‘All layers’ snapping mode. In most cases it is sufficient to use this snapping mode.

It is important to consider that the per-layer tolerance in ‘map units’ was actually in layer units. So if working with a layer in WGS84 reprojected to UTM, setting tolerance to 1 map unit (i.e. 1 meter) wouldn’t work correctly because the units would be actually degrees. So now the ‘map units’ has been relabeled to ‘layer units’ and the new entry ‘map units’ operates with units of the map view. While working with ‘on-the-fly’ CRS transformation it is now possible to use a snapping tolerance that refers to either the units of the reprojected layer (setting ‘layer units’) or the units of the map view (setting ‘map units’).

Raza de căutare

Raza de căutare reprezintă distanța pe care QGIS o folosește pentru a căuta cel mai apropiat nod pe care încercați să-l mutați atunci când faceți clic pe hartă. Dacă nu sunteți în raza de căutare, QGIS nu va găsi și nu va selecta nici un vertex pentru editare, apărând un avertisment în acest sens. Toleranța de acroșare și raza de căutare sunt stabilite în unități de hartă sau în pixeli, astfel încât să trebuiască să experimentați pentru a obține setarea corectă. Dacă specificați o toleranță prea mare, QGIS poate realiza acroșarea la vertexul greșit, mai ales dacă vă confruntați cu un număr mare de noduri în imediata apropiere. Dacă setați raza de căutare la o valoare prea mică, este posibil ca deplasarea să nu mai aibă loc.

The search radius for vertex edits in layer units can be defined in the Digitizing tab under Settings ‣ mActionOptions Options. This is the same place where you define the general, project- wide snapping tolerance.

Transfocare și Deplasare

Înainte de a edita un strat, ar trebui să focalizați zona dvs. de interes. Astfel, se evită așteptarea, pe durata randării simbolurilor pentru vertecși, de-a lungul întregului strat.

Apart from using the mActionPan pan and mActionZoomIn zoom-in / mActionZoomOut zoom-out icons on the toolbar with the mouse, navigating can also be done with the mouse wheel, spacebar and the arrow keys.

Transfocarea și deplasarea cu ajutorul rotiței mouse-ului

While digitizing, you can press the mouse wheel to pan inside of the main window, and you can roll the mouse wheel to zoom in and out on the map. For zooming, place the mouse cursor inside the map area and roll it forward (away from you) to zoom in and backwards (towards you) to zoom out. The mouse cursor position will be the center of the zoomed area of interest. You can customize the behavior of the mouse wheel zoom using the Map tools tab under the Settings ‣ mActionOptions Options menu.

Deplasarea cu ajutorul tastelor cu săgeți

Panning the map during digitizing is possible with the arrow keys. Place the mouse cursor inside the map area, and click on the right arrow key to pan east, left arrow key to pan west, up arrow key to pan north, and down arrow key to pan south.

You can also use the space bar to temporarily cause mouse movements to pan the map. The PgUp and PgDown keys on your keyboard will cause the map display to zoom in or out without interrupting your digitizing session.

Editarea topologică

Besides layer-based snapping options, you can also define topological functionalities in the Snapping options... dialog in the Settings (or File) menu. Here, you can define checkbox Enable topological editing, and/or for polygon layers, you can activate the column checkbox Avoid Int., which avoids intersection of new polygons.

Editarea editării topologice

The option checkbox Enable topological editing is for editing and maintaining common boundaries in polygon mosaics. QGIS ‘detects’ a shared boundary in a polygon mosaic, so you only have to move the vertex once, and QGIS will take care of updating the other boundary.

Evitarea intersecţiilor pentru poligoanele noi

The second topological option in the checkbox Avoid Int. column, called Avoid intersections of new polygons, avoids overlaps in polygon mosaics. It is for quicker digitizing of adjacent polygons. If you already have one polygon, it is possible with this option to digitize the second one such that both intersect, and QGIS then cuts the second polygon to the common boundary. The advantage is that you don’t have to digitize all vertices of the common boundary.

Activarea acroșării la intersecții

Another option is to use checkbox Enable snapping on intersection. It allows you to snap on an intersection of background layers, even if there’s no vertex on the intersection.

Digitizarea unui strat vectorial existent

By default, QGIS loads layers read-only. This is a safeguard to avoid accidentally editing a layer if there is a slip of the mouse. However, you can choose to edit any layer as long as the data provider supports it, and the underlying data source is writable (i.e., its files are not read-only).

In general, tools for editing vector layers are divided into a digitizing and an advanced digitizing toolbar, described in section Digitizare avansată. You can select and unselect both under View ‣ Toolbars ‣. Using the basic digitizing tools, you can perform the following functions:

Pictogramă

Scop

Pictogramă

Scop

mActionAllEdits

Editări curente

mActionToggleEditing

Activarea/dezactivarea editării

mActionCapturePoint

Adăugarea Entităților: Captura Punctului

mActionCaptureLine

Adăugarea Entităților: Captura Liniei

mActionCapturePolygon

Adăugarea Entităților: Captura Poligonului

mActionMoveFeature

Deplasarea Entității

mActionNodeTool

Instrumentul Nod

mActionDeleteSelected

Ștergere Selecție

mActionEditCut

Decupare Entități

mActionEditCopy

Copiere Entități

mActionEditPaste

Lipire Entități

mActionSaveEdits

Salvează modificările stratului

Editarea Tabelei: Bara instrumentelor de editare de bază, pentru straturile vectoriale

All editing sessions start by choosing the mActionToggleEditing Toggle editing option. This can be found in the context menu after right clicking on the legend entry for a given layer.

Alternatively, you can use the Toggle Editing mActionToggleEditing Toggle editing button from the digitizing toolbar to start or stop the editing mode. Once the layer is in edit mode, markers will appear at the vertices, and additional tool buttons on the editing toolbar will become available.

Tip

Salvați cu Regularitate

Amintiți-vă să mActionSaveEdits Salvați Modificările Stratului cu regularitate. Aceasta va confirma, de asemenea, că sursa de date poate accepta toate modificările.

Adăugare Entități

You can use the mActionCapturePoint Add Feature, mActionCaptureLine Add Feature or mActionCapturePolygon Add Feature icons on the toolbar to put the QGIS cursor into digitizing mode.

Pentru fiecare entitate, digitizați în primul rând geometria, apoi introduceți-i atributele. Pentru a digitiza geometria, faceți clic-stânga pe zona de hartă, pentru a crea primul punct al noii entități.

For lines and polygons, keep on left-clicking for each additional point you wish to capture. When you have finished adding points, right-click anywhere on the map area to confirm you have finished entering the geometry of that feature.

The attribute window will appear, allowing you to enter the information for the new feature. Figure_edit_2 shows setting attributes for a fictitious new river in Alaska. In the Digitizing menu under the Settings ‣ Options menu, you can also activate checkbox Suppress attributes pop-up windows after each created feature and checkbox Reuse last entered attribute values.

Figure Edit 2:

../../../_images/editDigitizing.png

Completați Dialogul Valorilor pentru Atribute, după digitizarea unei noi entități vectoriale nix

Cu pictograma mActionMoveFeature Move Feature(s) de pe bara de instrumente, puteți deplasa entitățile existente.

Tip

Tipuri de Valori pentru Atribute

For editing, the attribute types are validated during entry. Because of this, it is not possible to enter a number into a text column in the dialog Enter Attribute Values or vice versa. If you need to do so, you should edit the attributes in a second step within the Attribute table dialog.

Modificări Curente

This feature allows the digitization of multiple layers. Choose mActionFileSaveAs Save for Selected Layers to save all changes you made in multiple layers. You also have the opportunity to mActionRollbackEdits Rollback for Selected Layers, so that the digitization may be withdrawn for all selected layers. If you want to stop editing the selected layers, mActionCancelEdits Cancel for Selected Layer(s) is an easy way.

Aceleași funcții sunt disponibile pentru editarea tuturor straturilor proiectului.

Instrumentul Nod

For shapefile-based layers as well as SpatialLite, PostgreSQL/PostGIS, MSSQL Spatial, and Oracle Spatial tables, the mActionNodeTool Node Tool provides manipulation capabilities of feature vertices similar to CAD programs. It is possible to simply select multiple vertices at once and to move, add or delete them altogether. The node tool also works with ‘on the fly’ projection turned on, and it supports the topological editing feature. This tool is, unlike other tools in QGIS, persistent, so when some operation is done, selection stays active for this feature and tool. If the node tool is unable to find any features, a warning will be displayed.

It is important to set the property Settings ‣ mActionOptions Options ‣ Digitizing ‣ Search Radius: selectnumber to a number greater than zero (i.e., 10). Otherwise, QGIS will not be able to tell which vertex is being edited.

Tip

Simbolurile Vertexului

The current version of QGIS supports three kinds of vertex markers: ‘Semi-transparent circle’, ‘Cross’ and ‘None’. To change the marker style, choose mActionOptions Options from the Settings menu, click on the Digitizing tab and select the appropriate entry.

Operaţiuni de bază

Începeți prin activarea mActionNodeTool Instrumentului Nod și selectați o entitate, făcând clic pe ea. Casetele roșii vor apărea la fiecare vertex al acestei entități.

  • Selecting vertices: You can select vertices by clicking on them one at a time, by clicking on an edge to select the vertices at both ends, or by clicking and dragging a rectangle around some vertices. When a vertex is selected, its color changes to blue. To add more vertices to the current selection, hold down the Ctrl key while clicking. Hold down Ctrl or Shift when clicking to toggle the selection state of vertices (vertices that are currently unselected will be selected as usual, but also vertices that are already selected will become unselected).
  • Adding vertices: To add a vertex, simply double click near an edge and a new vertex will appear on the edge near to the cursor. Note that the vertex will appear on the edge, not at the cursor position; therefore, it should be moved if necessary.
  • Deleting vertices: After selecting vertices for deletion, click the Delete key. Note that you cannot use the mActionNodeTool Node Tool to delete a complete feature; QGIS will ensure it retains the minimum number of vertices for the feature type you are working on. To delete a complete feature use the mActionDeleteSelected Delete Selected tool.
  • Moving vertices: Select all the vertices you want to move. Click on a selected vertex or edge and drag in the direction you wish to move. All the selected vertices will move together. If snapping is enabled, the whole selection can jump to the nearest vertex or line.

Each change made with the node tool is stored as a separate entry in the Undo dialog. Remember that all operations support topological editing when this is turned on. On-the-fly projection is also supported, and the node tool provides tooltips to identify a vertex by hovering the pointer over it.

Tăiere, Copiere și Lipire Entități

Selected features can be cut, copied and pasted between layers in the same QGIS project, as long as destination layers are set to mActionToggleEditing Toggle editing beforehand.

Features can also be pasted to external applications as text. That is, the features are represented in CSV format, with the geometry data appearing in the OGC Well-Known Text (WKT) format.

However, in this version of QGIS, text features from outside QGIS cannot be pasted to a layer within QGIS. When would the copy and paste function come in handy? Well, it turns out that you can edit more than one layer at a time and copy/paste features between layers. Why would we want to do this? Say we need to do some work on a new layer but only need one or two lakes, not the 5,000 on our big_lakes layer. We can create a new layer and use copy/paste to plop the needed lakes into it.

Ca un exemplu, vom copia unele lacuri într-un nou strat:

  1. Încărcați stratul din care doriți să copiați (stratul sursă)

  2. Încărcați sau creați stratul în care doriți să copiați (stratul țintă)

  3. Începeți editarea stratului țintă

  4. Activați stratul sursă, făcând clic pe el în legendă

  5. Folosiți instrumentul mActionSelect Selectare Entitate Singulară pentru a selecta entit(ățile) din stratul sursă

  6. Clic pe instrumentul mActionEditCopy Copy Features

  7. Activați stratul destinație, făcând clic pe el în legendă

  8. Clic pe instrumentul mActionEditPaste Lipire Entități

  9. Dezactivați editarea și salvați modificările.

What happens if the source and target layers have different schemas (field names and types are not the same)? QGIS populates what matches and ignores the rest. If you don’t care about the attributes being copied to the target layer, it doesn’t matter how you design the fields and data types. If you want to make sure everything - the feature and its attributes - gets copied, make sure the schemas match.

Tip

Congruența Entităților Inserate

If your source and destination layers use the same projection, then the pasted features will have geometry identical to the source layer. However, if the destination layer is a different projection, then QGIS cannot guarantee the geometry is identical. This is simply because there are small rounding-off errors involved when converting between projections.

Tip

Copie un atribut de tip șir în altul**

If you have created a new column in your attribute table with type ‘string’ and want to paste values from another attribute column that has a greater length the length of the column size will be extended to the same amount. This is because the GDAL Shapefile driver starting with GDAL/OGR 1.10 knows to auto-extend string and integer fields to dynamically accomodate for the length of the data to be inserted.

Ștergerea Entităților Selectate

If we want to delete an entire polygon, we can do that by first selecting the polygon using the regular mActionSelect Select Single Feature tool. You can select multiple features for deletion. Once you have the selection set, use the mActionDeleteSelected Delete Selected tool to delete the features.

The mActionEditCut Cut Features tool on the digitizing toolbar can also be used to delete features. This effectively deletes the feature but also places it on a “spatial clipboard”. So, we cut the feature to delete. We could then use the mActionEditPaste Paste Features tool to put it back, giving us a one-level undo capability. Cut, copy, and paste work on the currently selected features, meaning we can operate on more than one at a time.

Salvarea Straturilor Modificate

When a layer is in editing mode, any changes remain in the memory of QGIS. Therefore, they are not committed/saved immediately to the data source or disk. If you want to save edits to the current layer but want to continue editing without leaving the editing mode, you can click the mActionSaveEdits Save Layer Edits button. When you turn editing mode off with mActionToggleEditing Toggle editing (or quit QGIS for that matter), you are also asked if you want to save your changes or discard them.

If the changes cannot be saved (e.g., disk full, or the attributes have values that are out of range), the QGIS in-memory state is preserved. This allows you to adjust your edits and try again.

Tip

Integritatea Datelor

It is always a good idea to back up your data source before you start editing. While the authors of QGIS have made every effort to preserve the integrity of your data, we offer no warranty in this regard.

Digitizare avansată

Pictogramă

Scop

Pictogramă

Scop

mActionUndo

Anulare

mActionRedo

Refacere

mActionRotateFeature

Rotire Enti(tăți)

mActionSimplify

Simplificare Entitate

mActionAddRing

Adăugare Inel

mActionAddPart

Adăugare Parte

mActionFillRing

Umplere inel

mActionDeleteRing

Ştergere Inel

mActionDeletePart

Ştergere Parte

mActionReshape

Remodelare Entități

mActionOffsetCurve

Curba de Compensare

mActionSplitFeatures

Divizare Entități

mActionSplitParts

Divizare Părți

mActionMergeFeatures

Unificare Entități Selectate

mActionMergeFeatureAttributes

Unificare Atribute pentru Entitățile Selectate

mActionRotatePointSymbols

Rotiți Simbolurile Punctelor

Editarea Avansată a Tabelei: Bara instrumentelor avansate de editare a straturilor vectoriale

Anulare/Restabilire

The mActionUndo Undo and mActionRedo Redo tools allows you to undo or redo vector editing operations. There is also a dockable widget, which shows all operations in the undo/redo history (see Figure_edit_3). This widget is not displayed by default; it can be displayed by right clicking on the toolbar and activating the Undo/Redo checkbox. Undo/Redo is however active, even if the widget is not displayed.

Figure Edit 3:

../../../_images/redo_undo.png

Pașii de Anulare/Restabilire a Digitizării nix

When Undo is hit, the state of all features and attributes are reverted to the state before the reverted operation happened. Changes other than normal vector editing operations (for example, changes done by a plugin), may or may not be reverted, depending on how the changes were performed.

To use the undo/redo history widget, simply click to select an operation in the history list. All features will be reverted to the state they were in after the selected operation.

Rotire Enti(tăți)

Use mActionRotateFeatureRotate Feature(s) to rotate one or multiple features in the map canvas. Press the mActionRotateFeatureRotate Feature(s) icon and then click on the feature to rotate. Either click on the map to place the rotated feature or enter an angle in the user input widget. If you want to rotate several features, they shall be selected first.

If you enable the map tool with feature(s) selected, its (their) centroid appears and will be the rotation anchor point. If you want to move the anchor point, hold the Ctrl button and click on the map to place it.

If you hold Shift before clicking on the map, the rotation will be done in 45 degree steps, which can be modified afterwards in the user input widget.

Simplificare Entitate

The mActionSimplify Simplify Feature tool allows you to reduce the number of vertices of a feature, as long as the geometry doesn’t change. With the tool you can also simplify multi-part features. First, drag a rectangle over the feature. The vertices will be highlighted in red while the color of the feature will change and a dialog where you can define a tolerance in map units or pixels will appear. QGIS calculates the amount of vertices that can be deleted while maintaining the geometry using the given tolerance. The higher the tolerance is the more vertices can be deleted. After gaining the statistics about the simplification just klick the OK button. The tolerance you used will be saved when leaving a project or when leaving an edit session. So you can go back to the same tolerance the next time when simplifying a feature.

Adăugare Inel

You can create ring polygons using the mActionAddRing Add Ring icon in the toolbar. This means that inside an existing area, it is possible to digitize further polygons that will occur as a ‘hole’, so only the area between the boundaries of the outer and inner polygons remains as a ring polygon.

Adăugare Parte

You can mActionAddPart add part polygons to a selected multipolygon. The new part polygon must be digitized outside the selected multi-polygon.

Umplere inel

You can use the mActionFillRing Fill Ring function to add a ring to a polygon and add a new feature to the layer at the same time. Thus you need not first use the mActionAddRing Add Ring icon and then the mActionCapturePolygon Add feature function anymore.

Ştergere Inel

The mActionDeleteRing Delete Ring tool allows you to delete ring polygons inside an existing area. This tool only works with polygon layers. It doesn’t change anything when it is used on the outer ring of the polygon. This tool can be used on polygon and multi-polygon features. Before you select the vertices of a ring, adjust the vertex edit tolerance.

Ştergere Parte

The mActionDeletePart Delete Part tool allows you to delete parts from multifeatures (e.g., to delete polygons from a multi-polygon feature). It won’t delete the last part of the feature; this last part will stay untouched. This tool works with all multi-part geometries: point, line and polygon. Before you select the vertices of a part, adjust the vertex edit tolerance.

Remodelare Entități

You can reshape line and polygon features using the mActionReshape Reshape Features icon on the toolbar. It replaces the line or polygon part from the first to the last intersection with the original line. With polygons, this can sometimes lead to unintended results. It is mainly useful to replace smaller parts of a polygon, not for major overhauls, and the reshape line is not allowed to cross several polygon rings, as this would generate an invalid polygon.

For example, you can edit the boundary of a polygon with this tool. First, click in the inner area of the polygon next to the point where you want to add a new vertex. Then, cross the boundary and add the vertices outside the polygon. To finish, right-click in the inner area of the polygon. The tool will automatically add a node where the new line crosses the border. It is also possible to remove part of the area from the polygon, starting the new line outside the polygon, adding vertices inside, and ending the line outside the polygon with a right click.

Note

The reshape tool may alter the starting position of a polygon ring or a closed line. So, the point that is represented ‘twice’ will not be the same any more. This may not be a problem for most applications, but it is something to consider.

Curbe de Compensare

The mActionOffsetCurve Offset Curve tool creates parallel shifts of line layers. The tool can be applied to the edited layer (the geometries are modified) or also to background layers (in which case it creates copies of the lines / rings and adds them to the the edited layer). It is thus ideally suited for the creation of distance line layers. The displacement is shown at the bottom left of the taskbar.

To create a shift of a line layer, you must first go into editing mode and activate the mActionOffsetCurve Offset Curve tool. Then click on a feature to shift it. Move the mouse and click where wanted or enter the desired distance in the user input widget. Your changes may then be saved with the|mActionSaveEdits|:sup:Save Layer Edits tool.

QGIS options dialog (Digitizing tab then Curve offset tools section) allows you to configure some parameters like Join style, Quadrant segments, Miter limit.

Divizare Entități

Puteți împărți entitățile folosind pictograma de mActionSplitFeatures Divizare a Entităților din bara de instrumente. Este suficient să trageți o linie peste entitatea pe care doriți să o divizați.

Divizare părți

In QGIS 2.0 it is now possible to split the parts of a multi part feature so that the number of parts is increased. Just draw a line across the part you want to split using the mActionSplitParts Split Parts icon.

Unificați entitățile selectate

The mActionMergeFeatures Merge Selected Features tool allows you to merge features. A new dialog will allow you to choose which value to choose between each selected features or select a function (Minimum, Maximum, Median, Sum, Skip Attribute) to use for each column. If features don’t have a common boundaries, a multipolygon will be created.

Unificați atributele pentru entitățile selectate

The mActionMergeFeatureAttributes Merge Attributes of Selected Features tool allows you to merge attributes of features with common boundaries and attributes without merging their boundaries. First, select several features at once. Then press the mActionMergeFeatureAttributes Merge Attributes of Selected Features button. Now QGIS asks you which attributes are to be applied to all selected objects. As a result, all selected objects have the same attribute entries.

Rotiți Simbolurile Punctelor

mActionRotatePointSymbols Rotate Point Symbols allows you to change the rotation of point symbols in the map canvas. You must first define a rotation column from the attribute table of the point layer in the Advanced menu of the Style menu of the Layer Properties. Also, you will need to go into the ‘SVG marker’ and choose Data defined properties .... Activate checkbox Angle and choose ‘rotation’ as field. Without these settings, the tool is inactive.

Figure Edit 4:

../../../_images/rotatepointsymbol.png

Rotirea Simbolurilor Punctelor nix

To change the rotation, select a point feature in the map canvas and rotate it, holding the left mouse button pressed. A red arrow with the rotation value will be visualized (see Figure_edit_4). When you release the left mouse button again, the value will be updated in the attribute table.

Note

Dacă țineți apăsată tasta Ctrl, rotirea se va face în pași de 15 grade.

Panoul de Digitizare Avansată

When capturing new geometries or geometry parts you also have the possibility to use the Advanced Digitizing panel. You can digitize lines exactly parallel or at a specific angle or lock lines to specific angles. Furthermore you can enter coordinates directly so that you can make a precise definition for your new geomtry.

_figure_advanced_edit 1:

Figure Advanced Edit 1:

../../../_images/advanced_digitizing.png

Panoul de Digitizare Avansată nix

Instrumentele nu sunt activate dacă vizualizarea hărții este în coordonate geografice.

Crearea noillor straturi Vectoriale

QGIS allows you to create new shapefile layers, new SpatiaLite layers, new GPX layers and New Temporary Scratch Layers. Creation of a new GRASS layer is supported within the GRASS plugin. Please refer to section Crearea unui nou strat vectorial GRASS for more information on creating GRASS vector layers.

Crearea unui nou strat de tip fișier shape

To create a new shape layer for editing, choose New ‣ mActionNewVectorLayer New Shapefile Layer... from the Layer menu. The New Vector Layer dialog will be displayed as shown in Figure_edit_5. Choose the type of layer (point, line or polygon) and the CRS (coordinate reference system).

Rețineți că aplicația QGIS încă nu are suport pentru crearea de entități 2.5D (de exemplu, entitățile cu coordonatele X, Y, Z).

Figure Edit 5:

../../../_images/editNewVector.png

Dialogul de creare a unui nou strat de tip fișier shape nix

To complete the creation of the new shapefile layer, add the desired attributes by clicking on the [Add to attributes list] button and specifying a name and type for the attribute. A first ‘id’ column is added as default but can be removed, if not wanted. Only Type: real selectstring, Type: integer selectstring, Type: string selectstring and Type:date selectstring attributes are supported. Additionally and according to the attribute type, you can also define the width and precision of the new attribute column. Once you are happy with the attributes, click [OK] and provide a name for the shapefile. QGIS will automatically add a .shp extension to the name you specify. Once the layer has been created, it will be added to the map, and you can edit it in the same way as described in section Digitizarea unui strat vectorial existent above.

Crearea unui nou strat SpatiaLite

To create a new SpatiaLite layer for editing, choose New ‣ mActionNewSpatiaLiteLayer New SpatiaLite Layer... from the Layer menu. The New SpatiaLite Layer dialog will be displayed as shown in Figure_edit_6.

Figure Edit 6:

../../../_images/editNewSpatialite.png

Dialogul de creare a unui Nou strat de tip SpatiaLite nix

The first step is to select an existing SpatiaLite database or to create a new SpatiaLite database. This can be done with the browse button browsebutton to the right of the database field. Then, add a name for the new layer, define the layer type, and specify the coordinate reference system with [Specify CRS]. If desired, you can select checkbox Create an autoincrementing primary key.

To define an attribute table for the new SpatiaLite layer, add the names of the attribute columns you want to create with the corresponding column type, and click on the [Add to attribute list] button. Once you are happy with the attributes, click [OK]. QGIS will automatically add the new layer to the legend, and you can edit it in the same way as described in section Digitizarea unui strat vectorial existent above.

Managementul, în continuare, al straturilor SpatiaLite se poate face cu DB Manager. Vedeți Plugin-ul DB Manager.

Crearea unui nou strat GPX

To create a new GPX file, you need to load the GPS plugin first. Plugins ‣ mActionShowPluginManager Plugin Manager... opens the Plugin Manager Dialog. Activate the checkbox GPS Tools checkbox.

When this plugin is loaded, choose New ‣ icon_newgpx Create new GPX Layer... from the Layer menu. In the Save new GPX file as dialog, you can choose where to save the new GPX layer.

Crearea unui Strat Nou Temporar, Stocat în Memorie

Empty, editable memory layers can be defined using Layer ‣ Create Layer ‣ New Temporary Scratch Layer. Here you can even create radiobuttonoff Multipoint, radiobuttonoffMultiline and radiobuttonoffMultipolygon Layers beneath radiobuttononPoint, radiobuttonoffLine and radiobuttonoffPolygon Layers. Temporary Scratch Layers are not saved and will be discarded when QGIS is closed. See also paste_into_layer .

Luccrul cu Tabela de Atribute

The attribute table displays features of a selected layer. Each row in the table represents one map feature, and each column contains a particular piece of information about the feature. Features in the table can be searched, selected, moved or even edited.

To open the attribute table for a vector layer, make the layer active by clicking on it in the map legend area. Then, from the main Layer menu, choose mActionOpenTable Open Attribute Table. It is also possible to right click on the layer and choose mActionOpenTable Open Attribute Table from the drop-down menu, and to click on the mActionOpenTable Open Attribute Table button in the Attributes toolbar.

This will open a new window that displays the feature attributes for the layer (figure_attributes_1). The number of features and the number of selected features are shown in the attribute table title.

Figure Attributes 1:

../../../_images/vectorAttributeTable.png

Tabela de Atribute pentru stratul regiunilor nix

Selectarea entităților din tabela de atribute

Each selected row in the attribute table displays the attributes of a selected feature in the layer. If the set of features selected in the main window is changed, the selection is also updated in the attribute table. Likewise, if the set of rows selected in the attribute table is changed, the set of features selected in the main window will be updated.

Rows can be selected by clicking on the row number on the left side of the row. Multiple rows can be marked by holding the Ctrl key. A continuous selection can be made by holding the Shift key and clicking on several row headers on the left side of the rows. All rows between the current cursor position and the clicked row are selected. Moving the cursor position in the attribute table, by clicking a cell in the table, does not change the row selection. Changing the selection in the main canvas does not move the cursor position in the attribute table.

The table can be sorted by any column, by clicking on the column header. A small arrow indicates the sort order (downward pointing means descending values from the top row down, upward pointing means ascending values from the top row down).

For a simple search by attributes on only one column, choose the Column filter ‣ from the menu in the bottom left corner. Select the field (column) on which the search should be performed from the drop-down menu, and hit the [Apply] button. Then, only the matching features are shown in the attribute table.

To make a selection, you have to use the mIconExpressionSelect Select features using an Expression icon on top of the attribute table. mIconExpressionSelect Select features using an Expression allows you to define a subset of a table using a Function List like in the mActionCalculateField Field Calculator (see Calculatorul Câmpurilor). The query result can then be saved as a new vector layer. For example, if you want to find regions that are boroughs from regions.shp of the QGIS sample data, you have to open the Fields and Values menu and choose the field that you want to query. Double-click the field ‘TYPE_2’ and also [Load all unique values] . From the list, choose and double-click ‘Borough’. In the Expression field, the following query appears:

"TYPE_2"  =  'Borough'

Here you can also use the Function list ‣ Recent (Selection) to make a selection that you used before. The expression builder remembers the last 20 used expressions.

The matching rows will be selected, and the total number of matching rows will appear in the title bar of the attribute table, as well as in the status bar of the main window. For searches that display only selected features on the map, use the Query Builder described in section Constructorul de Interogări.

Pentru a afișa înregistrările selectate, utilizați Arată Entitățile Selectate din partea din stânga-jos a meniului.

The field calculator bar allows you to make calculations on the selected rows only. For example, you can alter the number of the ID field of the file:regions.shp with the expression

ID+5

așa cum se arată în figure_attributes_1 .

Celelalte butoane din partea de sus a ferestrei tabelei de atribute oferă următoarele funcționalități:

  • mActionToggleEditing Trecere în modul de editare, pentru editarea valorilor singulare și a funcționalităților descrise mai jos (de asemenea, cu Ctrl+E)

  • mActionSaveEdits Salvare Editări (de asemenea, cu Ctrl+S)

  • mActionUnselectAttributes Deselectare generală (de asemenea, cu Ctrl+U)

  • mActionSelectedToTop Mutare selecție în vârf (de asemenea, cu Ctrl+T)

  • mActionInvertSelection Inversare selecție (de asemenea, cu Ctrl+R)

  • mActionCopySelected Copiere rânduri selectate în clipboard (de asemenea, cu Ctrl+C)

  • mActionZoomToSelected Mărire hartă la nivelul rândului selectat (de asemenea, cu Ctrl+J)

  • PanToSelected Deplasare hartă până la rândurile selectate (de asemenea, cu Ctrl+P)

  • mActionDeleteSelected Ștergere entități selectate (de asemenea, cu Ctrl+D)

  • mActionNewAttribute Coloană Nouă pentru straturile PostGIS și OGR cu versiunea GDAL >= 1.6 (de asemenea, cu Ctrl+W)

  • mActionDeleteAttribute Ștergere Coloană pentru straturile PostGIS și OGR cu versiunea GDAL >= 1.9 (de asemenea, cu Ctrl+L)

  • mActionCalculateField Deschidere calculator de câmpuri (de asemenea, cu Ctrl+I)

Below these buttons is the Field Calculator bar, which allows calculations to be quickly applied attributes visible in the table. This bar uses the same expressions as the mActionCalculateField Field Calculator (see Calculatorul Câmpurilor).

Tip

Se omite geometria WKT

If you want to use attribute data in external programs (such as Excel), use the mActionCopySelected Copy selected rows to clipboard button. You can copy the information without vector geometries if you deactivate Settings ‣ Options ‣ Data sources menu checkbox Copy geometry in WKT representation from attribute table.

Salvează entitățile selectate ca un nou strat

The selected features can be saved as any OGR-supported vector format and also transformed into another coordinate reference system (CRS). Just open the right mouse menu of the layer and click on Save as to define the name of the output file, its format and CRS (see section Legenda Hărții). To save the selection ensure that the checkbox Save only selected features is selected. It is also possible to specify OGR creation options within the dialog.

Lipire într-un nou strat

Features that are on the clipboard may be pasted into a new layer. To do this, first make a layer editable. Select some features, copy them to the clipboard, and then paste them into a new layer using Edit ‣ Paste Features as and choosing New vector layer or New memory layer.

This applies to features selected and copied within QGIS and also to features from another source defined using well-known text (WKT).

Lucrul cu tabelele de atribute non spațiale

QGIS allows you also to load non-spatial tables. This currently includes tables supported by OGR and delimited text, as well as the PostgreSQL, MSSQL and Oracle provider. The tables can be used for field lookups or just generally browsed and edited using the table view. When you load the table, you will see it in the legend field. It can be opened with the mActionOpenTable Open Attribute Table tool and is then editable like any other layer attribute table.

As an example, you can use columns of the non-spatial table to define attribute values, or a range of values that are allowed, to be added to a specific vector layer during digitizing. Have a closer look at the edit widget in section Meniul Câmpurilor to find out more.

Crearea relațiilor one to many

Relations are a technique often used in databases. The concept is, that features (rows) of different layers (tables) can belong to each other.

As an example you have a layer with all regions of alaska (polygon) which provides some attributes about its name and region type and a unique id (which acts as primary key).

Chei externe

Then you get another point layer or table with information about airports that are located in the regions and you also want to keep track of these. If you want to add them to the region layer, you need to create a one to many relation using foreign keys, because there are several airports in most regions.

Figure Relations 1:

../../../_images/relations1.png

Regiunile cu aeroporturi din Alaska nix

In addition to the already existing attributes in the airports attribute table another field fk_region which acts as a foreign key (if you have a database, you will probably want to define a constraint on it).

This field fk_region will always contain an id of a region. It can be seen like a pointer to the region it belongs to. And you can design a custom edit form for the editing and QGIS takes care about the setup. It works with different providers (so you can also use it with shape and csv files) and all you have to do is to tell QGIS the relations between your tables.

Straturi

QGIS makes no difference between a table and a vector layer. Basically, a vector layer is a table with a geometry. So can add your table as a vector layer. To demostrate you can load the ‘region’ shapefile (with geometries) and the ‘airport’ csv table (without geometries) and a foreign key (fk_region) to the layer region. This means, that each airport belongs to exactly one region while each region can have any number of airports (a typical one to many relation).

Definiție (Managerul de Relații)

Primul lucru pe care îl vom face este de a indica aplicației QGIS despre relațiile din cadrul stratului. Acest lucru se face în Setări ‣ Proprietățile Proiectului. Deschideți meniul Relațiilor și faceți clic pe Adăugare.

  • name is going to be used as a title. It should be a human readable string, describing, what the relation is used for. We will just call say “Airports” in this case.
  • referencing layer is the one with the foreign key field on it. In our case this is the airports layer
  • referencing field will say, which field points to the other layer so this is fk_region in this case
  • referenced layer is the one with the primary key, pointed to, so here it is the regions layer
  • referenced field is the primary key of the referenced layer so it is ID
  • id will be used for internal purposes and has to be unique. You may need it to build custom forms once this is supported. If you leave it empty, one will be generated for you but you can assign one yourself to get one that is easier to handle.

Figure Relations 2:

../../../_images/relations2.png

Managerul de Relații nix

Formulare

Now that QGIS knows about the relation, it will be used to improve the forms it generates. As we did not change the default form method (autogenerated) it will just add a new widget in our form. So let’s select the layer region in the legend and use the identify tool. Depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions.

Figure Relations 3:

../../../_images/relations3.png

Dialogul de identificare a regiunilor, cu relațiile între aeroporturi nix

As you can see, the airports assigned to this particular region are all shown in a table. And there are also some buttons available. Let’s review them shortly

  • The mActionToggleEditing button is for toggling the edit mode. Be aware that it toggles the edit mode of the airport layer, although we are in the feature form of a feature from the region layer. But the table is representing features of the airport layer.
  • The mActionSignPlus button will add a new feature to the airport layer. And it will assign the new airport to the current region by default.
  • Btonul mActionRemove va șterge definitiv aeroportul selectat.

  • The mActionLink symbol will open a new dialog where you can select any existing airport which will then be assigned to the current region. This may be handy if you created the airport on the wrong region by accident.
  • The mActionUnlink symbol will unlink the selected airport from the current region, leaving them unassigned (the foreign key is set to NULL) effectively.
  • Cele două butoane din dreapta comută între vederea sub formă de tabelă și cea sun formă de formular, care, mai târziu, vă vor permite vizualizarea tuturor aeroporturilor.

If you work on the airport table, a new widget type is available which lets you embed the feature form of the referenced region on the feature form of the airports. It can be used when you open the layer properties of the airports table, switch to the Fields menu and change the widget type of the foreign key field ‘fk_region’ to Relation Reference.

If you look at the feature dialog now, you will see, that the form of the region is embedded inside the airports form and will even have a combobox, which allows you to assign the current airport to another region.

Figure Relations 4:

../../../_images/relations4.png

Dialogul de identificare a aeroportului, cu relațiile între regiuni nix