1 
2 ///////////////////////////////////////////////////////////
3 //                                                       //
4 //                         SAGA                          //
5 //                                                       //
6 //      System for Automated Geoscientific Analyses      //
7 //                                                       //
8 //                     Tool Library                      //
9 //                       io_gdal                         //
10 //                                                       //
11 //-------------------------------------------------------//
12 //                                                       //
13 //                   TLB_Interface.cpp                   //
14 //                                                       //
15 //                 Copyright (C) 2003 by                 //
16 //                        Author                         //
17 //                                                       //
18 //-------------------------------------------------------//
19 //                                                       //
20 // This file is part of 'SAGA - System for Automated     //
21 // Geoscientific Analyses'. SAGA is free software; you   //
22 // can redistribute it and/or modify it under the terms  //
23 // of the GNU General Public License as published by the //
24 // Free Software Foundation, either version 2 of the     //
25 // License, or (at your option) any later version.       //
26 //                                                       //
27 // SAGA is distributed in the hope that it will be       //
28 // useful, but WITHOUT ANY WARRANTY; without even the    //
29 // implied warranty of MERCHANTABILITY or FITNESS FOR A  //
30 // PARTICULAR PURPOSE. See the GNU General Public        //
31 // License for more details.                             //
32 //                                                       //
33 // You should have received a copy of the GNU General    //
34 // Public License along with this program; if not, see   //
35 // <http://www.gnu.org/licenses/>.                       //
36 //                                                       //
37 //-------------------------------------------------------//
38 //                                                       //
39 //    e-mail:     author@email.de                        //
40 //                                                       //
41 //    contact:    Author                                 //
42 //                Sesame Street 7                        //
43 //                12345 Metropolis                       //
44 //                Nirwana                                //
45 //                                                       //
46 ///////////////////////////////////////////////////////////
47 
48 
49 ///////////////////////////////////////////////////////////
50 //														 //
51 //           The Tool Link Library Interface             //
52 //														 //
53 ///////////////////////////////////////////////////////////
54 
55 //---------------------------------------------------------
56 // 1. Include the appropriate SAGA-API header...
57 
58 #include "gdal_driver.h"
59 
60 
61 //---------------------------------------------------------
62 // 2. Place general tool library informations here...
63 
Get_Info(int i)64 CSG_String Get_Info(int i)
65 {
66 	switch( i )
67 	{
68 	case TLB_INFO_Name:	default:
69 		return( _TL("GDAL/OGR") );
70 
71 	case TLB_INFO_Category:
72 		return( _TL("Import/Export") );
73 
74 	case TLB_INFO_Author:
75 		return( _TL("SAGA User Group Associaton (c) 2008-21" ));
76 
77 	case TLB_INFO_Description:
78 		return( CSG_String::Format(SG_T("%s\n%s %s\n%s: %s"),
79 			_TL("Interface to Frank Warmerdam's Geospatial Data Abstraction Library (GDAL)."),
80 			_TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str(),
81 			_TL("Homepage"), SG_T("<a target=\"_blank\" href=\"http://www.gdal.org/\">www.gdal.org</a>\n")
82 		));
83 
84 	case TLB_INFO_Version:
85 		return( "2.0" );
86 
87 	case TLB_INFO_Menu_Path:
88 		return( _TL("File") );
89 	}
90 }
91 
92 
93 //---------------------------------------------------------
94 // 3. Include the headers of your tools here...
95 
96 #include "gdal_import.h"
97 #include "gdal_export.h"
98 #include "gdal_export_geotiff.h"
99 #include "gdal_import_netcdf.h"
100 #include "gdal_import_wms.h"
101 #include "gdal_import_aster.h"
102 #include "gdal_catalogue.h"
103 
104 #ifdef GDAL_V2_1_OR_NEWER
105 #include "gdal_buildvrt.h"
106 #endif
107 #include "gdal_import_vrt.h"
108 
109 #include "ogr_import.h"
110 #include "ogr_export.h"
111 #include "ogr_export_kml.h"
112 
113 #include "gdal_formats.h"
114 
115 
116 //---------------------------------------------------------
117 // 4. Allow your tools to be created here...
118 
Create_Tool(int i)119 CSG_Tool *		Create_Tool(int i)
120 {
121 	switch( i )
122 	{
123 	default:	return( TLB_INTERFACE_SKIP_TOOL );
124 
125 	case  0:	return( new CGDAL_Import );
126 	case  1:	return( new CGDAL_Export );
127 	case  2:	return( new CGDAL_Export_GeoTIFF );
128 
129 	case  7:	return( new CGDAL_Catalogue );
130 	case  8:	return( new CGDAL_Catalogues );
131 
132 	case  3:	return( new COGR_Import );
133 	case  4:	return( new COGR_Export );
134 
135 	case  5:	return( new COGR_Export_KML );
136 
137 	case  6:	return( SG_Get_GDAL_Drivers().Get_Driver("netCDF") ? new CGDAL_Import_NetCDF : TLB_INTERFACE_SKIP_TOOL );
138 
139 	case  9:	return( new CGDAL_Import_WMS );
140 	case 11:	return( new CGDAL_Import_ASTER );
141 
142 #ifdef GDAL_V2_1_OR_NEWER
143 	case 12:	return( new CGDAL_BuildVRT );
144 #endif
145 	case 13:	return( new CGDAL_Import_VRT );
146 
147 	case 10:	return( new CGDAL_Formats );
148 
149 
150 	//-----------------------------------------------------
151 	case 14:	// initializations
152 
153 		CPLSetErrorHandler(CPLQuietErrorHandler);
154 
155 		return( NULL );
156 	}
157 }
158 
159 
160 ///////////////////////////////////////////////////////////
161 //														 //
162 //														 //
163 //														 //
164 ///////////////////////////////////////////////////////////
165 
166 //---------------------------------------------------------
167 //{{AFX_SAGA
168 
169 	TLB_INTERFACE
170 
171 //}}AFX_SAGA
172