SAGA API  v9.7
shapes_io.cpp
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_io.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #include "shapes.h"
54 #include "table_dbase.h"
55 #include "tool_library.h"
56 #include "data_manager.h"
57 
58 
60 // //
61 // //
62 // //
64 
65 //---------------------------------------------------------
67 {
68  return( Create(Get_File_Name(false)) );
69 }
70 
71 //---------------------------------------------------------
73 {
74  CSG_String File_Name = Get_File_Name(true);
75 
76  SG_File_Delete(File_Name);
77 
78  SG_File_Set_Extension(File_Name, "shp"); SG_File_Delete(File_Name); // shapes
79  SG_File_Set_Extension(File_Name, "shx"); SG_File_Delete(File_Name); // shape index
80  SG_File_Set_Extension(File_Name, "dbf"); SG_File_Delete(File_Name); // attributes
81  SG_File_Set_Extension(File_Name, "prj"); SG_File_Delete(File_Name); // projection
82  SG_File_Set_Extension(File_Name, "sbn"); SG_File_Delete(File_Name); // spatial index
83  SG_File_Set_Extension(File_Name, "sbx"); SG_File_Delete(File_Name); // spatial index
84  SG_File_Set_Extension(File_Name, "atx"); SG_File_Delete(File_Name); // attribute index
85  SG_File_Set_Extension(File_Name, "xml"); SG_File_Delete(File_Name); // metadata
86  SG_File_Set_Extension(File_Name, "cpg"); SG_File_Delete(File_Name); // code page
87  SG_File_Set_Extension(File_Name, "qix"); SG_File_Delete(File_Name); // quadtree spatial index
88 
89  return( true );
90 }
91 
92 
94 // //
95 // //
96 // //
98 
99 //---------------------------------------------------------
101 
102 //---------------------------------------------------------
104 {
105  switch( Format )
106  {
111  return( true );
112  }
113 
114  return( false );
115 }
116 
117 //---------------------------------------------------------
119 {
121 }
122 
123 //---------------------------------------------------------
125 {
127  {
128  default:
129  case SHAPE_FILE_FORMAT_ESRI : return( "shp" );
130  case SHAPE_FILE_FORMAT_GeoPackage: return( "gpkg" );
131  case SHAPE_FILE_FORMAT_GeoJSON : return( "geojson" );
132  }
133 }
134 
135 
137 // //
139 
140 //---------------------------------------------------------
141 bool CSG_Shapes::Save(const CSG_String &File, int Format)
142 {
143  if( Format == SHAPE_FILE_FORMAT_Undefined )
144  {
146 
147  if( SG_File_Cmp_Extension(File, "shp" ) ) { Format = SHAPE_FILE_FORMAT_ESRI ; }
148  if( SG_File_Cmp_Extension(File, "gpkg" ) ) { Format = SHAPE_FILE_FORMAT_GeoPackage; }
149  if( SG_File_Cmp_Extension(File, "geojson") ) { Format = SHAPE_FILE_FORMAT_GeoJSON ; }
150 
151  if( SG_File_Cmp_Extension(File, "txt" ) ) { return( _Save_Text (File, true, '\t') ); }
152  if( SG_File_Cmp_Extension(File, "csv" ) ) { return( _Save_Text (File, true, ',') ); }
153  if( SG_File_Cmp_Extension(File, "dbf" ) ) { return( _Save_DBase(File) ); }
154  }
155 
156  //-----------------------------------------------------
157  bool bResult = false;
158 
159  SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("shapes"), File.c_str()), true);
160 
161  switch( Format )
162  {
163  case SHAPE_FILE_FORMAT_ESRI : bResult = _Save_ESRI(File ); break;
164  case SHAPE_FILE_FORMAT_GeoPackage: bResult = _Save_GDAL(File, "GPKG" ); break;
165  case SHAPE_FILE_FORMAT_GeoJSON : bResult = _Save_GDAL(File, "GeoJSON"); break;
166  }
167 
168  //-----------------------------------------------------
169  if( bResult )
170  {
171  Set_Modified(false);
172 
173  Set_File_Name(File, true);
174 
176  SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
177 
178  return( true );
179  }
180 
182  SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
183 
184  return( false );
185 }
186 
187 
189 // //
190 // //
191 // //
193 
194 //---------------------------------------------------------
195 bool CSG_Shapes::_Load_GDAL(const CSG_String &File_Name)
196 {
197  CSG_Data_Manager Manager;
198 
199  CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 3); // Import Shapes
200 
201  if( pTool )
202  {
203  if( pTool->Settings_Push(&Manager) && pTool->Set_Parameter("FILES", File_Name, PARAMETER_TYPE_FilePath) )
204  {
205  SG_UI_Msg_Lock(true);
206  pTool->Execute();
207  SG_UI_Msg_Lock(false);
208  }
209 
211  }
212 
213  //-----------------------------------------------------
214  CSG_Shapes *pShapes = Manager.Shapes().Count() ? Manager.Shapes()[0].asShapes() : NULL;
215 
216  if( !pShapes || !Create(*pShapes) )
217  {
218  return( false );
219  }
220 
221  Get_MetaData () = pShapes->Get_MetaData ();
222  Get_Projection() = pShapes->Get_Projection();
223 
224  //-----------------------------------------------------
225  if( SG_File_Cmp_Extension(File_Name, "gpkg" )
226  || SG_File_Cmp_Extension(File_Name, "GeoJSON") )
227  {
228  Set_File_Name(File_Name, true);
229  }
230  else
231  {
232  Set_File_Name(File_Name, false);
233  }
234 
235  return( true );
236 }
237 
238 //---------------------------------------------------------
239 bool CSG_Shapes::_Save_GDAL(const CSG_String &File_Name, const CSG_String &Driver)
240 {
241  bool bResult;
242 
243  SG_UI_Msg_Lock(true);
244 
245  SG_RUN_TOOL(bResult, "io_gdal", 4, // Export Shapes
246  SG_TOOL_PARAMETER_SET("SHAPES", this)
247  && SG_TOOL_PARAMETER_SET("FORMAT", Driver)
248  && SG_TOOL_PARAMETER_SET("FILE" , File_Name)
249  );
250 
251  SG_UI_Msg_Lock(false);
252 
253  return( bResult );
254 }
255 
256 
258 // //
259 // //
260 // //
262 
263 //---------------------------------------------------------
264 bool CSG_Shapes::_Load_ESRI(const CSG_String &File_Name)
265 {
266  CSG_File Stream;
267 
268  //-----------------------------------------------------
269  // Open Encoding File...
270 
272 
273  if( Stream.Open(SG_File_Make_Path("", File_Name, "cpg")) )
274  {
275  CSG_String Line;
276 
277  if( Stream.Read_Line(Line) && Line.Find("UTF-8") >= 0 )
278  {
280  }
281 
282  Stream.Close();
283  }
284 
285  //-----------------------------------------------------
286  // Open DBase File...
287 
289 
290  if( DBase.Open_Read(SG_File_Make_Path("", File_Name, "dbf"), this, false) && DBase.Get_Field_Count() < 1 )
291  {
292  SG_UI_Msg_Add_Error(CSG_String::Format("[%s] DBase %s.", _TL("Warning"), _TL("file does not provide data.")));
293 
294  DBase.Close();
295  }
296 
297  if( DBase.is_Open() )
298  {
299  DBase.Move_First();
300  }
301  else
302  {
303  Add_Field("FID", SG_DATATYPE_Int);
304  }
305 
306  //-----------------------------------------------------
307  // Open Shapes File...
308 
309  if( !Stream.Open(SG_File_Make_Path("", File_Name, "shp"), SG_FILE_R, true) )
310  {
311  SG_UI_Msg_Add_Error(_TL("Shape file could not be opened."));
312 
313  return( false );
314  }
315 
316  //-----------------------------------------------------
317  // Read File Header (100 Bytes)...
318 
319  CSG_Buffer File_Header(100);
320 
321  if( Stream.Read(File_Header.Get_Data(), sizeof(char), 100) != 100 )
322  {
323  SG_UI_Msg_Add_Error(_TL("corrupted file header"));
324 
325  return( false );
326  }
327 
328  if( File_Header.asInt( 0, true) != 9994 ) // Byte 00 -> File Code 9994 (Integer Big)...
329  {
330  SG_UI_Msg_Add_Error(_TL("invalid file code"));
331 
332  return( false );
333  }
334 
335  if( File_Header.asInt(28, false) != 1000 ) // Byte 28 -> Version 1000 (Integer Little)...
336  {
337  SG_UI_Msg_Add_Error(_TL("unsupported file version"));
338 
339  return( false );
340  }
341 
342  int Type = File_Header.asInt(32);
343 
344  switch( Type ) // Byte 32 -> Shape Type (Integer Little)...
345  {
346  case 1: m_Type = SHAPE_TYPE_Point ; m_Vertex_Type = SG_VERTEX_TYPE_XY ; break; // Point
347  case 8: m_Type = SHAPE_TYPE_Points ; m_Vertex_Type = SG_VERTEX_TYPE_XY ; break; // MultiPoint
348  case 3: m_Type = SHAPE_TYPE_Line ; m_Vertex_Type = SG_VERTEX_TYPE_XY ; break; // PolyLine
349  case 5: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XY ; break; // Polygon
350 
351  case 11: m_Type = SHAPE_TYPE_Point ; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PointZ
352  case 18: m_Type = SHAPE_TYPE_Points ; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // MultiPointZ
353  case 13: m_Type = SHAPE_TYPE_Line ; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PolyLineZ
354  case 15: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PolygonZ
355 
356  case 21: m_Type = SHAPE_TYPE_Point ; m_Vertex_Type = SG_VERTEX_TYPE_XYZ ; break; // PointM
357  case 28: m_Type = SHAPE_TYPE_Points ; m_Vertex_Type = SG_VERTEX_TYPE_XYZ ; break; // MultiPointM
358  case 23: m_Type = SHAPE_TYPE_Line ; m_Vertex_Type = SG_VERTEX_TYPE_XYZ ; break; // PolyLineM
359  case 25: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XYZ ; break; // PolygonM
360 
361  case 31: // unsupported: MultiPatch...
362  default: // unsupported...
363  SG_UI_Msg_Add_Error(_TL("unsupported shape type."));
364  return( false );
365  }
366 
367  //-----------------------------------------------------
368  // Load Shapes...
369 
370  CSG_Buffer Record_Header(8), Content; sLong Length = Stream.Length();
371 
372  for(int iShape=0; Stream.Tell() < Length && SG_UI_Process_Set_Progress(Stream.Tell(), Length); iShape++)
373  {
374  if( Stream.Read(Record_Header.Get_Data(0), sizeof(int), 2) != 2 ) // read record header
375  {
376  SG_UI_Msg_Add_Error(_TL("corrupted record header"));
377 
378  return( false );
379  }
380 
381  if( Record_Header.asInt(0, true) != iShape + 1 ) // record number
382  {
383  SG_UI_Msg_Add_Error(CSG_String::Format("%s (%d != %d)", _TL("corrupted shapefile."), Record_Header.asInt(0, true), iShape + 1));
384 
385  return( false );
386  }
387 
388  size_t nBytes = 2 * (size_t)Record_Header.asInt(4, true); // content length as 16-bit words !!!
389 
390  if( !Content.Set_Size(nBytes, false) )
391  {
392  SG_UI_Msg_Add_Error(_TL("memory allocation error."));
393 
394  return( false );
395  }
396 
397  if( Stream.Read(Content.Get_Data(), sizeof(char), nBytes) != nBytes )
398  {
399  SG_UI_Msg_Add_Error(_TL("corrupted shapefile."));
400 
401  return( false );
402  }
403 
404  if( DBase.is_Open() && DBase.isDeleted() )
405  {
406  continue; // nop
407  }
408 
409  if( Content.asInt(0) != Type )
410  {
411  if( Content.asInt(0) == 0 )
412  {
413  // null shape is allowed !!!
414  }
415  else
416  {
417  SG_UI_Msg_Add_Error(_TL("corrupted shapefile."));
418 
419  return( false );
420  }
421  }
422 
423  //-------------------------------------------------
424  else
425  {
426  CSG_Shape *pShape = Add_Shape(); TSG_Point *pPoint; int nPoints, nParts, *Parts; double *pZ = NULL, *pM = NULL;
427 
428  switch( m_Type )
429  {
430  //---------------------------------------------
431  case SHAPE_TYPE_Point:
432 
433  pPoint = (TSG_Point *)Content.Get_Data(4);
434 
435  pShape->Add_Point(pPoint->x, pPoint->y);
436 
437  switch( m_Vertex_Type ) // read Z + M
438  {
439  default: break;
440  case SG_VERTEX_TYPE_XYZM: pShape->Set_M(Content.asDouble(28), 0);
441  case SG_VERTEX_TYPE_XYZ : pShape->Set_Z(Content.asDouble(20), 0);
442  }
443 
444  break;
445 
446  //---------------------------------------------
447  case SHAPE_TYPE_Points:
448 
449  nPoints = Content.asInt(36);
450  pPoint = (TSG_Point *)Content.Get_Data(40);
451 
452  switch( m_Vertex_Type ) // read Z + M
453  {
454  default: break;
455 
456  case SG_VERTEX_TYPE_XYZ:
457  pZ = 56 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(56 + nPoints * 16) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8]
458  break;
459 
460  case SG_VERTEX_TYPE_XYZM:
461  pZ = 56 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(56 + nPoints * 16) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8]
462  pM = 72 + nPoints * 32 <= (int)Length ? (double *)Content.Get_Data(72 + nPoints * 24) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8 + 2 * 8] + [nPoints * 8]
463  break;
464  }
465 
466  //-----------------------------------------
467  for(int iPoint=0; iPoint<nPoints; iPoint++, pPoint++)
468  {
469  pShape->Add_Point(pPoint->x, pPoint->y);
470 
471  if( pZ ) { pShape->Set_Z(*(pZ++), iPoint); }
472  if( pM ) { pShape->Set_M(*(pM++), iPoint); }
473  }
474 
475  break;
476 
477  //---------------------------------------------
478  case SHAPE_TYPE_Line :
479  case SHAPE_TYPE_Polygon:
480 
481  nParts = Content.asInt(36);
482  nPoints = Content.asInt(40);
483  Parts = (int *)Content.Get_Data(44);
484  pPoint = (TSG_Point *)Content.Get_Data(44 + 4 * nParts);
485 
486  switch( m_Vertex_Type ) // read Z + M
487  {
488  default: break;
489 
490  case SG_VERTEX_TYPE_XYZ:
491  pZ = 60 + nParts * 4 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(60 + nParts * 4 + nPoints * 16) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8]
492  break;
493 
494  case SG_VERTEX_TYPE_XYZM:
495  pZ = 60 + nParts * 4 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(60 + nParts * 4 + nPoints * 16) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8]
496  pM = 76 + nParts * 4 + nPoints * 32 <= (int)Length ? (double *)Content.Get_Data(76 + nParts * 4 + nPoints * 24) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8 + 2 * 8] + [nPoints * 8]
497  break;
498  }
499 
500  //-----------------------------------------
501  for(int iPoint=0, iPart=0, Offset=0; iPoint<nPoints; iPoint++, pPoint++, Offset++)
502  {
503  if( iPart < nParts - 1 && iPoint >= Parts[iPart + 1] )
504  {
505  iPart++; Offset = 0;
506  }
507 
508  pShape->Add_Point(pPoint->x, pPoint->y, iPart);
509 
510  if( pZ ) { pShape->Set_Z(*(pZ++), Offset, iPart); }
511  if( pM ) { pShape->Set_M(*(pM++), Offset, iPart); }
512  }
513 
514  break;
515 
516  //---------------------------------------------
517  default: break;
518  }
519 
520  //---------------------------------------------
521  if( DBase.is_Open() )
522  {
523  for(int iField=0; iField<Get_Field_Count(); iField++)
524  {
525  switch( DBase.Get_Field_Type(iField) )
526  {
527  default:
528  pShape->Set_Value(iField, DBase.asString(iField));
529  break;
530 
531  case DBF_FT_FLOAT: case DBF_FT_NUMERIC:
532  {
533  double Value;
534 
535  if( DBase.asDouble(iField, Value) )
536  {
537  pShape->Set_Value(iField, Value);
538  }
539  else
540  {
541  pShape->Set_NoData(iField);
542  }
543  }
544  break;
545  }
546  }
547 
548  DBase.Move_Next();
549  }
550  else
551  {
552  pShape->Set_Value(0, iShape);
553  }
554  }
555  }
556 
557  //-----------------------------------------------------
558  Get_Projection().Load(SG_File_Make_Path("", File_Name, "prj"));
559 
560  Load_MetaData(File_Name);
561 
562  CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
563 
564  if( pFields && pFields->Get_Children_Count() == Get_Field_Count() )
565  {
566  for(int iField=0; iField<Get_Field_Count(); iField++)
567  {
568  Set_Field_Name(iField, pFields->Get_Content(iField));
569  }
570  }
571 
572  Set_File_Name(File_Name, true);
573 
574  //-----------------------------------------------------
575  return( true );
576 }
577 
578 
580 // //
581 // //
582 // //
584 
585 //---------------------------------------------------------
586 #define Set_Content_Length(n) Record_Header.Set_Value(4, (int)(n), true);\
587  fSHP.Write(Record_Header.Get_Data(), sizeof(int), 2);\
588  fSHX.Write_Int(fSHP_Size, true);\
589  fSHX.Write_Int((n) , true);\
590  fSHP_Size += 4 + (n);\
591  fSHX_Size += 4;
592 
593 //---------------------------------------------------------
594 bool CSG_Shapes::_Save_ESRI(const CSG_String &File_Name)
595 {
596  //-----------------------------------------------------
597  // Determine Shape Type...
598 
599  int Type;
600 
601  switch( m_Type )
602  {
603  case SHAPE_TYPE_Point : Type = 1; break;
604  case SHAPE_TYPE_Points : Type = 8; break;
605  case SHAPE_TYPE_Line : Type = 3; break;
606  case SHAPE_TYPE_Polygon : Type = 5; break;
607  default: return( false );
608  }
609 
611 
612  switch( Vertex_Type )
613  {
614  case SG_VERTEX_TYPE_XY : break;
615  case SG_VERTEX_TYPE_XYZ : Type += 20; break; // M
616  case SG_VERTEX_TYPE_XYZM: Type += 10; break; // Z (+M)
617  default: return( false );
618  }
619 
620  //-----------------------------------------------------
621  // DBase File Access...
622 
623  SG_File_Delete(SG_File_Make_Path("", File_Name, "cpg"));
624 
626  {
627  CSG_File Stream;
628 
629  if( Stream.Open(SG_File_Make_Path("", File_Name, "cpg"), SG_FILE_W, false) )
630  {
631  Stream.Printf("UTF-8\n");
632 
633  Stream.Close();
634  }
635  }
636 
638 
639  if( !DBase.Open_Write(SG_File_Make_Path("", File_Name, "dbf"), this, false) )
640  {
641  return( false );
642  }
643 
644  //-----------------------------------------------------
645  // Shape File Access...
646 
647  CSG_File fSHP, fSHX;
648 
649  if( !fSHX.Open(SG_File_Make_Path("", File_Name, "shx"), SG_FILE_W, true) )
650  {
651  SG_UI_Msg_Add_Error(_TL("could not create index file"));
652 
653  return( false );
654  }
655 
656  if( !fSHP.Open(SG_File_Make_Path("", File_Name, "shp"), SG_FILE_W, true) )
657  {
658  SG_UI_Msg_Add_Error(_TL("could not create shape file"));
659 
660  return( false );
661  }
662 
663  //-----------------------------------------------------
664  // Save Header...
665 
666  Make_Clean(); // polygons: first == last point, inner rings > anti-clockwise...
667 
668  Update();
669 
670  CSG_Buffer File_Header(100);
671 
672  File_Header.Set_Value( 0, 9994 , true ); // Byte 0 Integer Big File Code = 9994
673  File_Header.Set_Value( 4, 0 , true ); // Byte 4 Integer Big unused
674  File_Header.Set_Value( 8, 0 , true ); // Byte 8 Integer Big unused
675  File_Header.Set_Value(12, 0 , true ); // Byte 12 Integer Big unused
676  File_Header.Set_Value(16, 0 , true ); // Byte 16 Integer Big unused
677  File_Header.Set_Value(20, 0 , true ); // Byte 20 Integer Big unused
678  File_Header.Set_Value(24, 0 , true ); // Byte 24 Integer Big File Length
679  File_Header.Set_Value(28, 1000 , false); // Byte 28 Integer Little Version = 1000
680  File_Header.Set_Value(32, Type , false); // Byte 32 Integer Little Shape Type
681  File_Header.Set_Value(36, m_Extent.Get_XMin(), false); // Byte 36 Double Little Bounding Box Xmin
682  File_Header.Set_Value(44, m_Extent.Get_YMin(), false); // Byte 44 Double Little Bounding Box Ymin
683  File_Header.Set_Value(52, m_Extent.Get_XMax(), false); // Byte 52 Double Little Bounding Box Xmax
684  File_Header.Set_Value(60, m_Extent.Get_YMax(), false); // Byte 60 Double Little Bounding Box Ymax
685  File_Header.Set_Value(68, Get_ZMin(), false); // Byte 68 Double Little Bounding Box Zmin
686  File_Header.Set_Value(76, Get_ZMax(), false); // Byte 76 Double Little Bounding Box Zmax
687  File_Header.Set_Value(84, Get_MMin(), false); // Byte 84 Double Little Bounding Box Mmin
688  File_Header.Set_Value(92, Get_MMax(), false); // Byte 92 Double Little Bounding Box Mmax
689 
690  fSHP.Write(File_Header.Get_Data(), sizeof(char), 100);
691  fSHX.Write(File_Header.Get_Data(), sizeof(char), 100);
692 
693  int fSHP_Size = 50; // file size measured in 16-bit words...
694  int fSHX_Size = 50; // file size measured in 16-bit words...
695 
696  //-----------------------------------------------------
697  // Save Shapes...
698 
699  for(sLong iShape=0; iShape<Get_Count() && SG_UI_Process_Set_Progress(iShape, Get_Count()); iShape++)
700  {
701  CSG_Shape *pShape = Get_Shape(iShape);
702 
703  //-------------------------------------------------
704  // geometries...
705 
706  CSG_Buffer Record_Header(8), Content;
707 
708  Record_Header.Set_Value(0, (int)iShape + 1, true); // record number
709 
710  //-------------------------------------------------
711  switch( m_Type ) // write content header
712  {
713  default: break;
714 
715  //-------------------------------------------------
716  case SHAPE_TYPE_Point:
717 
718  switch( Vertex_Type )
719  {
720  case SG_VERTEX_TYPE_XY : Set_Content_Length(10); break;
721  case SG_VERTEX_TYPE_XYZ : Set_Content_Length(14); break;
722  case SG_VERTEX_TYPE_XYZM: Set_Content_Length(18); break;
723  }
724 
725  fSHP.Write_Int (Type);
726 
727  break;
728 
729  //-------------------------------------------------
730  case SHAPE_TYPE_Points:
731 
732  switch( Vertex_Type )
733  {
734  case SG_VERTEX_TYPE_XY : Set_Content_Length(20 + 8 * pShape->Get_Point_Count()); break;
735  case SG_VERTEX_TYPE_XYZ : Set_Content_Length(28 + 12 * pShape->Get_Point_Count()); break;
736  case SG_VERTEX_TYPE_XYZM: Set_Content_Length(36 + 16 * pShape->Get_Point_Count()); break;
737  }
738 
739  fSHP.Write_Int (Type);
740  fSHP.Write_Double(pShape->Get_Extent().Get_XMin());
741  fSHP.Write_Double(pShape->Get_Extent().Get_YMin());
742  fSHP.Write_Double(pShape->Get_Extent().Get_XMax());
743  fSHP.Write_Double(pShape->Get_Extent().Get_YMax());
744  fSHP.Write_Int (pShape->Get_Point_Count());
745 
746  break;
747 
748  //-------------------------------------------------
749  case SHAPE_TYPE_Line:
750  case SHAPE_TYPE_Polygon:
751 
752  switch( Vertex_Type )
753  {
754  case SG_VERTEX_TYPE_XY : Set_Content_Length(22 + 2 * pShape->Get_Part_Count() + 8 * pShape->Get_Point_Count()); break;
755  case SG_VERTEX_TYPE_XYZ : Set_Content_Length(30 + 2 * pShape->Get_Part_Count() + 12 * pShape->Get_Point_Count()); break;
756  case SG_VERTEX_TYPE_XYZM: Set_Content_Length(38 + 2 * pShape->Get_Part_Count() + 16 * pShape->Get_Point_Count()); break;
757  }
758 
759  fSHP.Write_Int (Type);
760  fSHP.Write_Double(pShape->Get_Extent().Get_XMin());
761  fSHP.Write_Double(pShape->Get_Extent().Get_YMin());
762  fSHP.Write_Double(pShape->Get_Extent().Get_XMax());
763  fSHP.Write_Double(pShape->Get_Extent().Get_YMax());
764  fSHP.Write_Int (pShape->Get_Part_Count());
765  fSHP.Write_Int (pShape->Get_Point_Count());
766 
767  for(int iPart=0, iPoint=0; iPart<pShape->Get_Part_Count(); iPoint+=pShape->Get_Point_Count(iPart++))
768  {
769  fSHP.Write_Int(iPoint);
770  }
771 
772  break;
773  }
774 
775  //-------------------------------------------------
776  TSG_Point Point;
777 
778  switch( m_Type ) // write point data
779  {
780  default: break;
781 
782  //-------------------------------------------------
783  case SHAPE_TYPE_Point :
784 
785  fSHP.Write(&(Point = pShape->Get_Point()), sizeof(TSG_Point));
786 
787  //---------------------------------------------
788  if( Vertex_Type != SG_VERTEX_TYPE_XY )
789  {
790  fSHP.Write_Double(pShape->Get_Z(0));
791 
792  if( Vertex_Type == SG_VERTEX_TYPE_XYZM )
793  {
794  fSHP.Write_Double(pShape->Get_M(0));
795  }
796  }
797 
798  break;
799 
800  //-------------------------------------------------
801  case SHAPE_TYPE_Points :
802  case SHAPE_TYPE_Line :
803  case SHAPE_TYPE_Polygon:
804 
805  for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
806  {
807  for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
808  {
809  fSHP.Write(&(Point = pShape->Get_Point(iPoint, iPart)), sizeof(TSG_Point));
810  }
811  }
812 
813  //---------------------------------------------
814  if( Vertex_Type != SG_VERTEX_TYPE_XY )
815  {
816  fSHP.Write_Double(pShape->Get_ZMin());
817  fSHP.Write_Double(pShape->Get_ZMax());
818 
819  for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
820  {
821  for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
822  {
823  fSHP.Write_Double(pShape->Get_Z(iPoint, iPart));
824  }
825  }
826 
827  if( Vertex_Type == SG_VERTEX_TYPE_XYZM )
828  {
829  fSHP.Write_Double(pShape->Get_MMin());
830  fSHP.Write_Double(pShape->Get_MMax());
831 
832  for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
833  {
834  for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
835  {
836  fSHP.Write_Double(pShape->Get_M(iPoint, iPart));
837  }
838  }
839  }
840  }
841  }
842 
843  //-------------------------------------------------
844  // attributes...
845 
846  DBase.Add_Record();
847 
848  for(int iField=0; iField<Get_Field_Count(); iField++)
849  {
850  if( pShape->is_NoData(iField) )
851  {
852  DBase.Set_NoData(iField);
853  }
854  else switch( DBase.Get_Field_Type(iField) )
855  {
856  default:
857  DBase.Set_Value(iField, pShape->asString(iField));
858  break;
859 
860  case DBF_FT_FLOAT: case DBF_FT_NUMERIC:
861  DBase.Set_Value(iField, pShape->asDouble(iField));
862  break;
863  }
864  }
865 
866  DBase.Flush_Record();
867  }
868 
869  //-----------------------------------------------------
870  // File Sizes...
871 
872  fSHP.Seek(24);
873  fSHP.Write_Int(fSHP_Size, true);
874 
875  fSHX.Seek(24);
876  fSHX.Write_Int(fSHX_Size, true);
877 
878  //-----------------------------------------------------
879  Get_Projection().Save(SG_File_Make_Path("", File_Name, "prj"));
880 
881  //-----------------------------------------------------
882  CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
883 
884  if( !pFields )
885  {
886  pFields = Get_MetaData_DB().Add_Child("FIELDS");
887  }
888 
889  pFields->Del_Children();
890 
891  for(int iField=0; iField<Get_Field_Count(); iField++)
892  {
893  pFields->Add_Child("FIELD", Get_Field_Name(iField))->Add_Property("TYPE", gSG_Data_Type_Identifier[Get_Field_Type(iField)]);
894  }
895 
896  Get_MetaData().Del_Child("GDAL_DRIVER");
897 
898  Save_MetaData(File_Name);
899 
900  //-----------------------------------------------------
901  return( true );
902 }
903 
904 
906 // //
907 // //
908 // //
910 
911 //---------------------------------------------------------
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:1001
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
DBF_FT_FLOAT
#define DBF_FT_FLOAT
Definition: table_dbase.h:77
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Shapes::On_Delete
virtual bool On_Delete(void)
Definition: shapes_io.cpp:72
CSG_Projection::Save
bool Save(const CSG_String &File, ESG_CRS_Format Format=ESG_CRS_Format::WKT) const
Definition: projections.cpp:261
CSG_MetaData::Del_Child
bool Del_Child(int Index)
Definition: metadata.cpp:321
_TL
#define _TL(s)
Definition: api_core.h:1507
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:366
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:483
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:777
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:147
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
SG_Shapes_Get_File_Extension_Default
CSG_String SG_Shapes_Get_File_Extension_Default(void)
Definition: shapes_io.cpp:124
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:132
CSG_Shapes::On_Reload
virtual bool On_Reload(void)
Definition: shapes_io.cpp:66
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:193
data_manager.h
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:506
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1523
CSG_File::Seek
bool Seek(sLong Offset, int Origin=SG_FILE_START) const
Definition: api_file.cpp:241
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:1091
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:681
CSG_Shapes::Get_MMin
double Get_MMin(void)
Definition: shapes.h:815
CSG_Buffer::asDouble
double asDouble(int Offset, bool bBigEndian=false) const
Definition: api_core.h:271
CSG_Tool
Definition: tool.h:151
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:258
SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:260
CSG_Table_DBase::Open_Write
bool Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
Definition: table_dbase.cpp:307
CSG_Buffer::Set_Value
void Set_Value(int Offset, char Value, bool bBigEndian=false)
Definition: api_core.h:262
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:361
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:995
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Data_Manager::Shapes
CSG_Data_Collection & Shapes(void) const
Definition: data_manager.h:137
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:472
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:148
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1111
SSG_Point
Definition: geo_tools.h:128
CSG_Buffer::Set_Size
bool Set_Size(size_t Size, bool bShrink=true)
Definition: api_memory.cpp:732
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:337
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:865
CSG_Shapes::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:813
gSG_Shape_File_Format_Default
static TSG_Shape_File_Format gSG_Shape_File_Format_Default
Definition: shapes_io.cpp:100
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_File
Definition: api_core.h:1126
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1106
SG_Shapes_Set_File_Format_Default
bool SG_Shapes_Set_File_Format_Default(int Format)
Definition: shapes_io.cpp:103
Set_Content_Length
#define Set_Content_Length(n)
Definition: shapes_io.cpp:586
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:402
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1140
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1524
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:354
CSG_Table_DBase
Definition: table_dbase.h:91
CSG_Buffer
Definition: api_core.h:224
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Buffer::asInt
int asInt(int Offset, bool bBigEndian=false) const
Definition: api_core.h:269
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:362
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:507
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shapes::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: shapes_io.cpp:141
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:381
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:471
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_DBase::Get_Field_Type
char Get_Field_Type(int iField)
Definition: table_dbase.h:111
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:195
SHAPE_FILE_FORMAT_GeoPackage
@ SHAPE_FILE_FORMAT_GeoPackage
Definition: shapes.h:117
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:194
CSG_File::Open
virtual bool Open(const SG_Char *FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:112
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:397
SG_Shapes_Get_File_Format_Default
TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default(void)
Definition: shapes_io.cpp:118
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:390
CSG_Table_DBase::Add_Record
void Add_Record(void)
Definition: table_dbase.cpp:612
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:209
CSG_File::Close
virtual bool Close(void)
Definition: api_file.cpp:163
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1112
CSG_Projection::Load
bool Load(const CSG_String &File)
Definition: projections.cpp:253
SHAPE_FILE_FORMAT_Undefined
@ SHAPE_FILE_FORMAT_Undefined
Definition: shapes.h:115
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:210
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:460
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table_DBase::Flush_Record
void Flush_Record(void)
Definition: table_dbase.cpp:630
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:640
CSG_File::Write_Double
bool Write_Double(double Value, bool bBigEndian=false)
Definition: api_file.cpp:479
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Table::Set_Field_Name
bool Set_Field_Name(int iField, const SG_Char *Name)
Definition: table.cpp:604
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:474
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1040
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false, bool bWithCMD=true) const
Definition: tool_library.cpp:836
TSG_Shape_File_Format
TSG_Shape_File_Format
Definition: shapes.h:114
table_dbase.h
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:1097
CSG_Table::_Save_DBase
bool _Save_DBase(const CSG_String &File)
Definition: table_io.cpp:560
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:229
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
SHAPE_FILE_FORMAT_GeoJSON
@ SHAPE_FILE_FORMAT_GeoJSON
Definition: shapes.h:118
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_Table_DBase::Set_Value
bool Set_Value(int iField, double Value)
Definition: table_dbase.cpp:771
CSG_String
Definition: api_core.h:563
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Data_Manager
Definition: data_manager.h:129
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Get_MetaData_DB
CSG_MetaData & Get_MetaData_DB(void) const
Definition: dataobject.h:235
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:621
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:286
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:211
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:255
CSG_File::Write_Int
bool Write_Int(int Value, bool bBigEndian=false)
Definition: api_file.cpp:453
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:234
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_File::Read_Line
bool Read_Line(CSG_String &Line) const
Definition: api_file.cpp:394
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:508
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:654
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:505
SHAPE_FILE_FORMAT_ESRI
@ SHAPE_FILE_FORMAT_ESRI
Definition: shapes.h:116
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Table_DBase::Set_NoData
bool Set_NoData(int iField)
Definition: table_dbase.cpp:904
CSG_Shapes::Make_Clean
bool Make_Clean(void)
Definition: shapes.cpp:525
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:192
CSG_Table::Create
bool Create(void)
Definition: table.cpp:153
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:1058
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:369
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:305
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:166
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:556
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:363
DBF_FT_NUMERIC
#define DBF_FT_NUMERIC
Definition: table_dbase.h:78
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:550
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:552
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:208
CSG_Shape
Definition: shapes.h:141
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:637
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
CSG_Table::_Save_Text
bool _Save_Text(const CSG_String &File, bool bHeadline, const SG_Char Separator)
Definition: table_io.cpp:490
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
CSG_File::Tell
sLong Tell(void) const
Definition: api_file.cpp:264
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:502