Salome HOME
Translate CouldCompare and Qgis parts.
[modules/hydro.git] / doc / salome / tutorial / 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 L'accès internet est nécessaire dans de nombreux usages de qgis, par exemple pour installer des plugins.
55 Pour passer le proxy, à EDF R&D, il faut dans le menu *settings / options* de qgis, onglet *Network*, cocher l'option
56 *Use proxy for web access* et prendre *DefaultProxy* comme *Proxy type*.
57
58 Il faut par ailleurs avoir défini le proxy dans son environnement. On peut par exemple ajouter
59 les lignes suivantes dans le fichier *.bashrc* de son compte Linux:
60
61 Internet access is needed in many uses of qgis, for example to install plugins.
62 To setup EDF R&D proxy configuration, in the *settings / options* menu of qgis,
63 *Network* tab, check the option *Use proxy for web access* and take *DefaultProxy* as *Proxy type*.
64
65 You also must add the following lines to the file *.bashrc* from its Linux account:
66
67 ::
68
69   export http_proxy=http://proxypac.edf.fr:3128
70   export https_proxy=http://proxypac.edf.fr:3128
71   export no_proxy=localhost,.edf.fr
72
73 Open a qgis projet
74 ==================
75
76 To open or create a qgis project, go to the *Project* menu and select *Open or New*.
77 GIS data consists of several types of files.
78
79 Show dada in qgis
80 =================
81
82 Un « Shapefile » ou « Fichier de forme » est le format de stockage des données vectorielles utilisées
83 par la plupart des SIG, il est constitué des fichiers suivants :
84
85 A "Shapefile" is the format for storing the vector data used
86 by most GIS, it is made from the following files:
87
88  * ***.shp**: stores geographic entities. This is the shapefile itself.
89
90  * ***.dbf** (DataBaseFile): stores the attribute data (available in Excel).
91
92  * ***.shx**: stores the record indexes of the ".shp" file.
93
94  * ***.prj**  (recommanded): stores the associated projection.
95
96  * ***.sbn**, ***.sbx** (faculatatifs): FIXME: stocke des index n'existant qu'après une requête ou une jointure.
97
98  * ***.xml** (facultatif): stores metadata for shape.
99
100 A **vector** data file is make with points or contours while a **raster** file
101 is made up of pixels, that means that it is an image or a photography as background.
102
103 To load existing data (for example, CorineLandCover data),
104 Click the *AddVectorLayer* button in the left button bar or select *AddLayer*
105 then *Add Vector Layer* from the *Layer* menu.
106
107 To view data, you will find in the "View" menu all the necessary tools
108 to explore by moving or zooming in your maps.
109
110 Displacements on the map are also accessible from the icon bar where
111 there are the same symbols as in the scrolling menu.
112
113 The "Zoom Full" allows the view to all project data.
114
115 The "Zoom to Layer" zooms to the layer that is selected in the left column.
116
117 Create des lines or polygones
118 =============================
119
120 A layer **Line** allows to draw an outline, a plot, an isocontour ...
121 with its own characteristics.
122
123 The **Polygon** layer is a surface. FIXME: Ce polygone apparaitra sur la carte et sera représenté
124 aussi sous forme d’une ligne dans la table de la couche, qui aura ces propres éléments exemple:
125 colonne nombre, couleur, taille...
126
127 To create new layer of type *Line* or *Polygon*:
128
129  * In the layer menu select *CreateLayer/new Shapefile Layer*
130
131  * Select Line or Polygon type in dialog box (add a new field if needed by filling its name)
132
133  * Click OK
134
135  * Name and fill up the path of the new shape file and save
136
137  * To create lines, switch to edit mode by clicking on the icon representing a pencil
138
139  * Click on *Add Feature* in taskbar
140
141  * End the line of polygone with a right click
142
143  * Enter the attribute of the line (id) in the window that just appeared,
144    then click OK.
145
146  * Repeat for the next lines
147
148  * Finish the update of the layer by clicking on the button representing a pencil (stop editing)
149
150 Extract lines of polygons from a shape file
151 ===========================================
152
153 **This operation is needed, when the data cover a larger zone
154 than the study area, such as the CorineLandCover data
155 Which are provided by large zones (French department).**
156
157 First, have a polygon bounding the study area:
158 the polygon can be created in SALOME-HYDRO, or in qgis - example (Contour.shp)
159
160 If the polygon has been created in SALOME-HYDRO as a polyline, it must be exported from SALOME-HYDRO
161 in shp (Polyline / Export) format (Example Contour_Etude.shp).
162
163 This polyline must then be transformed into a polygon in qgis:
164
165  * Add Vector Layer: Contour.shp
166
167  * In *Vector / Geometry Tools*: run *Lines to Polygons*
168    and transform Contour.shp in Contour_polygon.shp
169
170 Display the CorineLandCover areas by clicking on *Add Vector Layer* (example: CLC12_D086_RGF.shp)
171
172 Extract data within a contour:
173
174  * In qgis: in *Vector / Geoprocessing Tools*: run *Intersect* and complete
175    in *Input vector*: the CLC file (example: CLC12_D086_RGF.shp),
176    and in *Intersect layer* the contour of the study in polygon
177    (example: Contour_polygon.shp).
178    Give a name to the result file (example CLC12_D086_Extract.shp)
179
180 Attention, le découpage des zones de CorineLandCover par le contour d’étude a pu générer des entités
181 constituées de deux parties. Pour que SALOME-HYDRO puisse reconnaitre toutes les parties celles-ci
182 doivent être dans des entités différentes.
183 Caution, the cutting of the CorineLandCover areas by the study outline could generate
184 2-parts entities. In order that SALOME-HYDRO recognize all the parts, they
185 must be in different entities.
186
187  * In qgis: in *Vector / Geometry Tools*: run *Multipart to single parts*
188    with "Input polygon vector layer" the extracted file from the CLC (example CLC12_D086_Extract.shp))
189    and as *output shapefile* another name (example: CLC12_D086_Extract_Single_Parts.shp)
190
191  * This shp file, (CLC12_D086_Extract_Single_Parts.shp) can be imported into SALOME-HYDRO
192    as LandCoverMap: *Import Land Cover Map from files*
193
194 .. only:: html
195
196    :ref:`ref_outilsComplementaires`
197