Salome HOME
appying 2to3
[modules/hydro.git] / doc / salome / tutorial / english / english_introQgis.rst
1 ..
2    Copyright (C) 2015-2016 EDF
3
4    This file is part of SALOME HYDRO module.
5
6    SALOME HYDRO module is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    SALOME HYDRO module is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
18
19 #########################################
20 Run Qgis and CloudCompare
21 #########################################
22
23 Starting from SALOME 8, the installer of qgis and / or CloudCompare is provided in a separate product.
24 At EDF the installer depends on the platform:
25
26 * On Calibre 7 qgis and CloudCompare are provided separately,
27 * On Calibre 9, CloudCompare is installed with SALOME, qgis aside.
28
29 Knowing the installation directory of the products (*<appli_XXX>*) ::
30
31   <appli_XXX>/salome shell CloudCompare
32
33 ou::
34
35   <appli_XXX>/salome shell qgis
36
37 For CloudCompare on Calibre 9, you can also use the *tools / plugins / Salome shell session* menu from SALOME
38 to open a shell in the SALOME environment.
39
40 In this shell, the *CloudCompare* command launches the software.
41
42 #########################################
43 Basic help on qgis
44 #########################################
45
46 Some indications of the use of qgis are given below.
47 These are some basic functions for displaying and processing rows or polygons.
48 For more advanced uses and geographic data manipulation and visualization, the user can refer to
49 the official qgis documentation <http://www.qgis.org/fr/docs/index.html> or specific existing documentation.
50
51 Setup Internet access from qgis (specific EDF R&D)
52 ==================================================
53
54 Internet access is needed in many uses of qgis, for example to install plugins.
55 To setup EDF R&D proxy configuration, in the *settings / options* menu of qgis,
56 *Network* tab, check the option *Use proxy for web access* and take *DefaultProxy* as *Proxy type*.
57
58 You also must add the following lines to the file *.bashrc* from its Linux account:
59
60 ::
61
62   export http_proxy=http://proxypac.edf.fr:3128
63   export https_proxy=http://proxypac.edf.fr:3128
64   export no_proxy=localhost,.edf.fr
65
66 Open a qgis projet
67 ==================
68
69 To open or create a qgis project, go to the *Project* menu and select *Open or New*.
70 GIS data consists of several types of files.
71
72 Show dada in qgis
73 =================
74
75 A "Shapefile" is the format for storing the vector data used
76 by most GIS, it is made from the following files:
77
78  * ***.shp**: stores geographic entities. This is the shapefile itself.
79
80  * ***.dbf** (DataBaseFile): stores the attribute data (available in Excel).
81
82  * ***.shx**: stores the record indexes of the ".shp" file.
83
84  * ***.prj**  (recommanded): stores the associated projection.
85
86  * ***.sbn**, ***.sbx** (faculatatifs): FIXME: stocke des index n'existant qu'après une requête ou une jointure.
87
88  * ***.xml** (facultatif): stores metadata for shape.
89
90 A **vector** data file is make with points or contours while a **raster** file
91 is made up of pixels, that means that it is an image or a photography as background.
92
93 To load existing data (for example, CorineLandCover data),
94 Click the *AddVectorLayer* button in the left button bar or select *AddLayer*
95 then *Add Vector Layer* from the *Layer* menu.
96
97 To view data, you will find in the "View" menu all the necessary tools
98 to explore by moving or zooming in your maps.
99
100 Displacements on the map are also accessible from the icon bar where
101 there are the same symbols as in the scrolling menu.
102
103 The "Zoom Full" allows the view to all project data.
104
105 The "Zoom to Layer" zooms to the layer that is selected in the left column.
106
107 Create des lines or polygones
108 =============================
109
110 A layer **Line** allows to draw an outline, a plot, an isocontour ...
111 with its own characteristics.
112
113 The **Polygon** layer is a surface. FIXME: Ce polygone apparaitra sur la carte et sera représenté
114 aussi sous forme d’une ligne dans la table de la couche, qui aura ces propres éléments exemple:
115 colonne nombre, couleur, taille...
116
117 To create new layer of type *Line* or *Polygon*:
118
119  * In the layer menu select *CreateLayer/new Shapefile Layer*
120
121  * Select Line or Polygon type in dialog box (add a new field if needed by filling its name)
122
123  * Click OK
124
125  * Name and fill up the path of the new shape file and save
126
127  * To create lines, switch to edit mode by clicking on the icon representing a pencil
128
129  * Click on *Add Feature* in taskbar
130
131  * End the line of polygone with a right click
132
133  * Enter the attribute of the line (id) in the window that just appeared,
134    then click OK.
135
136  * Repeat for the next lines
137
138  * Finish the update of the layer by clicking on the button representing a pencil (stop editing)
139
140 Extract lines of polygons from a shape file
141 ===========================================
142
143 **This operation is needed, when the data cover a larger zone
144 than the study area, such as the CorineLandCover data
145 Which are provided by large zones (French department).**
146
147 First, have a polygon bounding the study area:
148 the polygon can be created in SALOME-HYDRO, or in qgis - example (Contour.shp)
149
150 If the polygon has been created in SALOME-HYDRO as a polyline, it must be exported from SALOME-HYDRO
151 in shp (Polyline / Export) format (Example Contour_Etude.shp).
152
153 This polyline must then be transformed into a polygon in qgis:
154
155  * Add Vector Layer: Contour.shp
156
157  * In *Vector / Geometry Tools*: run *Lines to Polygons*
158    and transform Contour.shp in Contour_polygon.shp
159
160 Display the CorineLandCover areas by clicking on *Add Vector Layer* (example: CLC12_D086_RGF.shp)
161
162 Extract data within a contour:
163
164  * In qgis: in *Vector / Geoprocessing Tools*: run *Intersect* and complete
165    in *Input vector*: the CLC file (example: CLC12_D086_RGF.shp),
166    and in *Intersect layer* the contour of the study in polygon
167    (example: Contour_polygon.shp).
168    Give a name to the result file (example CLC12_D086_Extract.shp)
169
170
171 Caution, the cutting of the CorineLandCover areas by the study outline could generate
172 2-parts entities. In order that SALOME-HYDRO recognize all the parts, they
173 must be in different entities.
174
175  * In qgis: in *Vector / Geometry Tools*: run *Multipart to single parts*
176    with "Input polygon vector layer" the extracted file from the CLC (example CLC12_D086_Extract.shp))
177    and as *output shapefile* another name (example: CLC12_D086_Extract_Single_Parts.shp)
178
179  * This shp file, (CLC12_D086_Extract_Single_Parts.shp) can be imported into SALOME-HYDRO
180    as LandCoverMap: *Import Land Cover Map from files*
181
182 .. only:: html
183
184    :ref:`ref_outilsComplementaires`
185