2 Copyright (C) 2015-2016 EDF
4 This file is part of SALOME HYDRO module.
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.
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.
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/>.
19 ##############################################
20 Format SinusX for SALOME HYDRO: specifications
21 ##############################################
26 SinuxX is an ASCII format used at EDF for for free surface flow studies with Telemac.
27 SinusX format as been defined a long time ago for a digitizing software used for maps, isocontours...
28 The sofware is not used any more, but there are still parameters related to the software
29 in the format specification and the data files.
30 The goal of this specification is provide an editable ASCII format for import and export of SALOME HYDRO module data,
31 and allow import of existing SinusX data files.
32 The parameters related to the old SinusX software will be ignored on import in SALOME HYDRO module,
33 and default values will be provided on export from SALOME HYDRO module, to keep a consistent format between
35 Some existing files does not follow correctly the format and must be manually corrected. For instance,
36 closed parameter is not handled correctly in a lot of files.
38 Contents and general structure of SinusX format, correspondance with HYDRO data types
39 =====================================================================================
41 HYDRO data types to import and export
42 -------------------------------------
44 HYDRO module data contains Bathymetry fields and 2D or 3D polylines. 2D polylines are either polylines in the XoY plane (Z=0)
45 or profiles in a vertical plane.
47 The bathymetry fields are a list of x,y,z points.
49 The polylines, in the XoY plane, are defined by an ordered list of x,y points. the polylines are either closed or open,
50 spline or not. Sections are not yet taken into account here.
52 The profiles are defined in a vertical plane, by an ordered list of u,z points. The profiles are georeferenced or not,
53 are used to describe variables sections of a river (stream object), constant sections of channel or enbankments,
54 or altitude lines to be combined with XoY lines in order to build 3D lines.
56 All the HYDRO module objects are named.
58 general structure of SinusX format
59 ----------------------------------
61 The file is structured in blocs of data.
62 There are several types of blocs:
64 * Scatter plot: field of Bathymetry or Altimetry, contains a list of x,y,z points
65 * XYZ profile: for instance a vertical profile on river, defined by a list of x,y,z points (in a vertical plane)
66 * isocontour: a line at a constant altitude, defined by a list of x,y,z points (with z constant)
67 * XYZ curve : a line in 3D, defined by a list of x,y,z points
69 All Blocs begin with a line starting by 'B type ...'.
71 A bloc contains several parameter lines starting with 'CN name' or 'CP parameters...'.
73 Comments are lines starting with 'C ...' and are ignored.
75 A bloc contains several point lines (one x,y,z point per line) after the bloc start and parameter lines.
85 B type several ignored parameters
89 * type = S: Scatter plot
91 * type = P: XYZ profile
92 * type = N: isocontour
94 There are other types in some old files. These blocs are ignored.
95 The parameters after the type are ignored.
104 Avoid spaces and special characters (for instance accents) in name.
106 Closed and spline parameters
107 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113 Closed and spline are two booleans (0 or 1).
119 means a closed line of type spline.
121 This parameter is significant only for curves, profiles and isocontour (types C, P, N)
122 and is present but not interpreted for Scatter plot.
124 specific curve parameters, depending on curve type
125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127 Following the type of curve (C, P, N), this parameter is different:
129 **type = C: XYZ curve**
133 CP real1 real2... real16
135 These 16 real parameters are ignored at import, and can be set to 0.0 at export.
137 **type = P: XYZ profile**
143 Folowing the plane definition parameter (see below), the values define the start and end points
146 If the plane definition is XoY (horizontal), all the point of the profile are fully defined with their 3 coordinates x,y,z.
147 All the points are supposed to be in the same vertical plane.
148 The x1,y1 and x2,y2 values are ignored (and set to 0.0 at export).
150 If the plane definition is XoZ (vertical), the points of the profile are defined with 2 coordinates x,z (or u,z).
151 The y coordinate of the profile points are set to 0.0.
152 The two extremities are defined by origin: p1(x1,y1,0) and end: p2(x2,y2,0).
153 The Points of the profile are in the plane defined by the line p1,p2 and the vertical.
154 The x or u coordinate represents the abcissa in meters on the line p1,p2 counted from origin p1.
156 If the plane definition is XoZ (vertical) and x1, y1, x2, y2 are all null, the profile is not georeferenced.
158 **type = N: isocontour**
164 Altitude value for isocontour. This value is also in the Z coordinate of each point of the bloc,
165 but the Z coordinates are ignored, only the altitude parameter is taken into account.
167 plane definition parameter
168 ~~~~~~~~~~~~~~~~~~~~~~~~~~
174 Plane parameter is an integer value: 0 1 ou 2.
180 Plane 0 is used for XYZ curve, XYZ profile and isocontour.
184 Plane 2 is used for XYZ profile.
186 Plane parameter is present but not interpreted for Scatter plots.
193 x y z ignored comments
195 There are always 3 coordinates.
196 Everything after the coordinates is ignored.
198 At export, the real values must be with a fixed format with 3 decimals. For instance::
200 275982.120 128441.000 -7.500
202 Coordinates are in meter, in Lambert 93 projection: x, y absolutes values are less then 10000000.000.
203 Z abolute values are less than 10000.000.
205 SinusX blocs description and format
206 ===================================
211 example of scatter plot bloc
212 ----------------------------
214 *import from existing data file:*
218 B S +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.000000E+00 +1.000000E+00 +1.000000E+00 1
223 +2.759820E05 +1.284410E05 -7.500000E00 A
224 +2.759970E05 +1.284470E05 -7.500000E00 A
225 +2.760120E05 +1.284530E05 -7.500000E00 A
226 +2.759760E05 +1.283920E05 +3.000000E00 A
227 +2.759900E05 +1.283970E05 -2.450000E00 A
228 +2.760030E05 +1.284030E05 -4.000000E00 A
229 +2.760160E05 +1.284080E05 -5.450000E00 A
230 +2.760300E05 +1.284130E05 -4.250000E00 A
231 +2.760440E05 +1.284190E05 -7.500000E-01 A
232 +2.760570E05 +1.284240E05 +3.250000E00 A
234 The only parameters used are the type of bloc and the name. Closed, spline parameter and plane parameter are ignored.
235 For each point, only the x y z value are used.
245 275982.000 128441.000 -7.500
246 275997.000 128447.000 -7.500
247 276012.000 128453.000 -7.500
248 275976.000 128392.000 3.000
249 275990.000 128397.000 -2.450
250 276003.000 128403.000 -4.000
251 276016.000 128408.000 -5.450
252 276030.000 128413.000 -4.250
253 276044.000 128419.000 -7.500
254 276057.000 128424.000 3.250
256 example of XYZ profile
257 ----------------------
259 profile defined by two georeferenced extremities
260 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262 *import from existing data file:*
266 CN profil_with_extremities
268 CP +2.759820E05 +1.284410E05 +2.760570E05 +1.284240E05
271 x y z values lines with y=0.0
274 The profile of name *profil_with_extremties* is vertical, is an open line of type spline.
275 The two extremities are (+2.759820E05 +1.284410E05 0.0) and (+2.760570E05 +1.284240E05 0.0)
281 CN profil_with_extremities
283 CP 275982.000 128441.000 276057.000 128424.000
286 x y z values lines with y=0.0
289 profile not georeferenced
290 ~~~~~~~~~~~~~~~~~~~~~~~~~
292 *import from existing data file:*
296 CN profil_not_georeferenced
305 The profile of name *profil_not_georeferenced* is vertical, is an open line of type polyline.
306 The 4 real parameters are null, meaning there are no georeferenced extremities.
312 CN profil_not_georeferenced
321 profile with fully georeferenced points
322 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
324 *import from existing data file:*
328 CN profil_fully_georeferenced
330 CP +1.00000E+02 +2.00000E+02 +1.00000E+01 +2.00000E+01
332 275982.000 128441.000 -7.500
336 The profile of name *profil_fully_georeferenced* is defined in plane 0 (XoY),
337 meaning all the points are fully georeferenced (x y z significants).
338 The 4 real parameters are not used.
344 CN profil_fully_georeferenced
348 275982.000 128441.000 -7.500
355 *import from existing data file:*
358 B C -3.333330E+03 +4.875000E+04 +0.000000E+00 +3.333330E+02 +1.666670E+02 +1.000000E+00 0.658992
361 CP +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00
364 211563.340 133489.165 8.750 A
365 211604.013 133517.519 9.000 A
366 211645.047 133544.734 9.100 A
367 211684.597 133585.430 9.150 A
368 211716.859 133584.277 9.050 A
369 211777.488 133597.853 8.950 A
370 211828.211 133609.896 9.000 A
371 211896.886 133618.448 9.200 A
372 211945.422 133633.990 9.250 A
373 211996.891 133649.326 9.150 A
374 212044.447 133622.576 9.050 A
375 212067.681 133584.157 9.000 A
376 212056.937 133521.369 9.000 A
377 212007.716 133482.464 9.000 A
378 211959.462 133428.999 9.000 A
379 211925.576 133392.362 9.000 A
380 211885.762 133376.207 9.000 A
381 211817.310 133404.427 9.000 A
382 211783.848 133416.811 9.000 A
383 211742.545 133413.025 9.000 A
384 211681.493 133421.775 9.000 A
385 211644.814 133436.616 9.000 A
386 211597.633 133447.736 9.000 A
387 211569.826 133461.954 9.000 A
389 The curve of name *trait_cote_ile* is closed, of type spline, defined in plane XoY (XoY is the only possible value here).
390 Other parameters are not used.
392 This 3D curve is converted in a polyline and a profile in HYDRO module:
394 * One polyline (with z=0).
395 * One vertical profile (u,z) representing the altitude along the polyline defined above.
397 The u parameter of the vertical profile is the curvilign abcissa (in meters) along the isocontour.
402 See isocontour and XYZ profile not georeferenced
404 example of isocontour
405 ---------------------
407 *import from existing data file:*
410 B N -3.333330E+03 +4.875000E+04 +0.000000E+00 +3.333330E+02 +1.666670E+02 +1.000000E+00 0.658992
416 211563.340 133489.165 9.000 A
417 211604.013 133517.519 9.000 A
418 211645.047 133544.734 9.000 A
419 211684.597 133585.430 9.000 A
420 211716.859 133584.277 9.000 A
421 211777.488 133597.853 9.000 A
422 211828.211 133609.896 9.000 A
423 211896.886 133618.448 9.000 A
424 211945.422 133633.990 9.000 A
425 211996.891 133649.326 9.000 A
426 212044.447 133622.576 9.000 A
427 212067.681 133584.157 9.000 A
428 212056.937 133521.369 9.000 A
429 212007.716 133482.464 9.000 A
430 211959.462 133428.999 9.000 A
431 211925.576 133392.362 9.000 A
432 211885.762 133376.207 9.000 A
433 211817.310 133404.427 9.000 A
434 211783.848 133416.811 9.000 A
435 211742.545 133413.025 9.000 A
436 211681.493 133421.775 9.000 A
437 211644.814 133436.616 9.000 A
438 211597.633 133447.736 9.000 A
439 211569.826 133461.954 9.000 A
442 The isocontour of name *trait_cote_ile* is closed, of type spline, defined in plane XoY
443 (XoY is the only possible value here).
444 The constant altitude is 9.0. the Z values of the points are ignored.
446 This 3D curve is converted in a polyline and a profile in HYDRO module:
448 * One polyline (with z=0).
449 * One vertical profile (u,z) representing the altitude along the polyline defined above, with a constant Z.
451 The u parameter of the vertical profile is the curvilign abcissa (in meters) along the isocontour.
453 *export of an isocontour with z=0:*
462 211563.340 133489.165 0.000
463 211604.013 133517.519 0.000
464 211645.047 133544.734 0.000
465 211684.597 133585.430 0.000
466 211716.859 133584.277 0.000
467 211777.488 133597.853 0.000
468 211828.211 133609.896 0.000
469 211896.886 133618.448 0.000
470 211945.422 133633.990 0.000
471 211996.891 133649.326 0.000
472 212044.447 133622.576 0.000
473 212067.681 133584.157 0.000
474 212056.937 133521.369 0.000
475 212007.716 133482.464 0.000
476 211959.462 133428.999 0.000
477 211925.576 133392.362 0.000
478 211885.762 133376.207 0.000
479 211817.310 133404.427 0.000
480 211783.848 133416.811 0.000
481 211742.545 133413.025 0.000
482 211681.493 133421.775 0.000
483 211644.814 133436.616 0.000
484 211597.633 133447.736 0.000
485 211569.826 133461.954 0.000
488 See also XYZ profile not georeferenced
494 In SALOME HYDRO module, when importing SinusX files,
496 - scatter plots are imported as Bathymetries,
497 - isocontours are converted as polylines (z=0) and profiles not georeferenced (lines with z=constant),
498 - XYZ curves are converted as polylines (z=0) and profiles not georeferenced (curvilign abcissa, z),
499 - XYZ profiles with georeferenced extremities are imported as is (stream profiles for instance),
500 - XYZ profiles with with fully georeferenced points are converted in profiles with georeferenced extremities (see stream profiles),
501 - XYZ profiles not georeferenced are imported as is (used for section of a channel or embankment, or altitude line...),
502 - **all points of XYZ curves and isocontour with z different of 0 are regrouped to build a Bathymetry field**,
503 (Isocontour with z=0 are not significant in that case,
504 - when 2 successive points have the same coordinates, the second point must be removed (there are some old data files with this problem).
506 When exporting SinusX files, all the polylines and profiles can be exported in a single file:
508 - polylines are exported as isocontour with z=0, (open or closed, spline or not),
509 *(what about sections ? add a comment after the first point of a section?)*
510 - profiles are exported as is, georeferenced or not...
511 - **bathymetries are exported on demand (volume may be huge).**
516 :ref:`ref_formatsSpecs`