Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / gvsig / javadocs / scripting / gvsig.java @ 846

History | View | Annotate | Download (11.1 KB)

1
package scripting;
2

    
3
import org.cresques.cts.IProjection;
4
import org.gvsig.fmap.dal.DataStore;
5
import org.gvsig.fmap.dal.feature.FeatureType;
6
import org.gvsig.fmap.mapcontext.layers.FLayer;
7
import org.gvsig.scripting.app.extension.ScriptingExtension;
8

    
9
/**
10
 * Representa al modulo python "gvsig".
11
 *
12
 * Es el modulo base que nos facilita el acceso a todos los componentes de
13
 * gvSIG.
14
 *
15
 */
16
public class gvsig {
17

    
18
    public static int LOGGER_INFO = ScriptingExtension.INFO;
19
    public static int LOGGER_WARN = ScriptingExtension.WARN;
20
    public static int LOGGER_ERROR = ScriptingExtension.ERROR;
21

    
22
    /**
23
     * Returns a new and empty attributes definition.
24
     *
25
     * @return the new FeatureType
26
     */
27
    public static FeatureType createFeatureType() {
28
        return null;
29
    }
30

    
31
    /**
32
     * Returns a new and empty attributes definition based in an existing
33
     * FeatureType.
34
     *
35
     * All attributes in the feature type pased as parameters are created in the
36
     * new definition
37
     *
38
     * @param featureType from the new attributes are copied
39
     * @return The new FeatureType
40
     */
41
    public static FeatureType createFeatureType(FeatureType featureType) {
42
        return null;
43
    }
44

    
45
    /**
46
     * Create a new layer with the specified parameters.
47
     *
48
     * The paramaters are used to connect to the server type and create the
49
     * layer. These parameters are specific of each type of layer.
50
     *
51
     * Valid values of server type are:
52
     * <ul>
53
     * <li>FilesystemExplorer</li>
54
     * <li>PostgreSQLExplorer</li>
55
     * <li>WFSServerExplorer</li>
56
     * <li>Wms Store</li>
57
     * <li>...</li>
58
     * </ul>
59
     *
60
     * Valid values of layer type are:
61
     * <ul>
62
     * <li>Shape</li>
63
     * <li>Dbf</li>
64
     * <li>DXF</li>
65
     * <li>DGN</li>
66
     * <li>DWG</li>
67
     * <li>JExcel</li>
68
     * <li>PostgreSQL</li>
69
     * <li>WFSStore</li>
70
     * <li>Gdal Store</li>
71
     * <li>...</li>
72
     * </ul>
73
     *
74
     * Excamples of use:<br>
75
     * <code>
76
     * layer = createLayer(schema=schema,
77
     *                   servertype="FilesystemExplorer",
78
     *                   layertype="Shape",
79
     *                   shpFile="/home/osc/temp/test1.shp",
80
     *                   CRS="EPSG:25830",
81
     *                   geometryType=POINT
82
     *                   )
83
     * </code>
84
     *
85
     * @param schema the schema to use to create la layer.
86
     * @param serverType The server type (filesystem, BBDD, ...)
87
     * @param layerType The layer type to create (Shape, ...)
88
     * @param parameters the specific parameters to create the new layer
89
     * @return the new created layer
90
     *
91
     */
92
    public static FLayer createLayer(FeatureType schema, String serverType, String layerType, Object... parameters) {
93
        return null;
94
    }
95

    
96
    /**
97
     * Create a new layer with the specified parameters.
98
     *
99
     * Use as default serverType the "FilesystemExplorer".
100
     *
101
     * @param schema
102
     * @param layerType
103
     * @param parameters
104
     * @return
105
     */
106
    public static FLayer createLayer(FeatureType schema, String layerType, Object... parameters) {
107
        return null;
108
    }
109

    
110
    /**
111
     * Create a new shape with the specified parameters. If filename is not established, a temp filename will be set.
112
     * If CRS is None, it will be created with the CRS of the current view.
113
     *
114
     * Example:
115
     *     schema = createSchema()
116
     *     schema.append("ID", "INTEGER", 10)
117
     *     schema.append("GEOMETRY", "GEOMETRY")
118
     *     schema.get("GEOMETRY").setGeometryType(POINT, D2)
119
     *     newshape = createShape(schema, prefixname="newshape")
120
     *
121
     *
122
     * @param schema
123
     * @param filename, string, optional
124
     * @param geometryType, optional, integer, established in the schema
125
     * @param CRS, optional, string epsg code
126
     * @param prefixname, optional, string layer name with a prefix if filename is not established
127
     * @return
128
     */
129
    public static FLayer createShape(FeatureType schema, Object... parameters) {
130
        return null;
131
    }
132

    
133
    /**
134
     * Create a new table with the specified parameters.
135
     *
136
     * Use as default serverType the "FilesystemExplorer".
137
     *
138
     * @param schema
139
     * @param servertype
140
     * @param layerType
141
     * @param parameters
142
     * @return
143
     */
144
    public static FLayer createTable(FeatureType schema, String servertype, String layerType, Object... parameters) {
145
        return null;
146
    }
147
    
148
    /*
149
     * Create a new table with the specified parameters. If DbfFile is not established, a temp filename will be set.
150
     *
151
     * Example:
152
     *     schema = createSchema()
153
     *     schema.append("ID", "INTEGER", 10)
154
     *     newdbf = createDBF(schema, prefixname="newshape")
155
     *
156
     *
157
     * @param schema
158
     * @param DbfFile, optional, string
159
     * @param prefixname, optional, string layer name with a prefix if filename is not established
160
     * @return
161
     */
162
    public static FLayer createDBF(FeatureType schema, Object... parameters) {
163
        return null;
164
    }
165

    
166
    /**
167
     * Load an existing table file.
168
     *
169
     * @param dbffile, string, path to the table file to load
170
     * @return
171
     *
172
     */
173
    public static FLayer loadDBF(String dbffile) {
174
        return null;
175
    }
176

    
177
     /**
178
     * Load an existing table file.
179
     *
180
     * Example:
181
     *       table = loadTable(format="DBF",DbfFile=dbffile)
182
     *
183
     * @param format, string
184
     * @param path, string, path to the table file to load
185
     * @return
186
     *
187
     */
188
    public static FLayer loadTable(String format, Object... parameters) {
189
        return null;
190
    }
191

    
192
    /**
193
     * Load an existing shape file in the current view.
194
     *
195
     * @param path path to the shape file to load
196
     * @param projection to use to load the shape file
197
     * @return
198
     *
199
     */
200
    public static FLayer loadShapeFile(String path, String projection) {
201
        return null;
202
    }
203

    
204
    /**
205
     * Load an existing shape file in the current view.
206
     *
207
     * Use as default projection "CRS:84"
208
     *
209
     * @param path path to the shape file to load
210
     * @return
211
     *
212
     */
213
    public static FLayer loadShapeFile(String path) {
214
        return null;
215
    }
216

    
217
    /**
218
     * Load an existing raster file in the current view.
219
     *
220
     * @param path path to the raster file to load
221
     * @param projection to use to load the raster file
222
     * @return
223
     *
224
     */
225
    public static FLayer loadRasterFile(String path, String projection) {
226
        return null;
227
    }
228

    
229
    /**
230
     * Load an existing raster file in the current view.
231
     *
232
     * Use as default projection "CRS:84"
233
     *
234
     * @param path path to the raster file to load
235
     * @return
236
     *
237
     */
238
    public static FLayer loadRasterFile(String path) {
239
        return null;
240
    }
241

    
242
    /**
243
     * Load an existing layer and return it.
244
     *
245
     * Valid values of layer type are: 
246
     * - Shape 
247
     * - Gdal Store
248
     * - TODO
249
     *
250
     * Examples:
251
     *     loadLayer("Shape", shpFile=xfile, CRS="EPSG:25830")
252
     *     loadLayer("Gdal Store", uri=raster_uri)
253
     *
254
     * @param layerType
255
     * @param parameters
256
     * @return
257
     *
258
     */
259
    public static FLayer loadLayer(String layerType, Object... parameters) {
260
        return null;
261
    }
262

    
263
    /**
264
     * Send a message to the log system.
265
     *
266
     * The values of mode are:
267
     * <ul>
268
     * <li>LOGGER_INFO</li>
269
     * <li>LOGGER_WARN</li>
270
     * <li>LOGGER_ERROR</li>
271
     * </ul>
272
     *
273
     * @param msg to send to log
274
     * @param mode message type, is optional with default of LOGGER_INFO.
275
     * @param exception an exception to log, is optional.
276
     */
277
    public static void logger(String msg, int mode, Throwable exception) {
278

    
279
    }
280

    
281
    /**
282
     * Create the path to a resource.
283
     *
284
     * This function runs like the os.path.join, but if the first argument is a
285
     * full path name to a file, it only get the dirname of it.
286
     *
287
     * This is usefull to use with the variable __file__ as the first argument
288
     * to get a path name to a resource relative to the current module.
289
     *
290
     * Explample:<br>
291
     * <code>
292
     *  pathname = getResource(__file__,"data","icon.png")
293
     * </code>
294
     *
295
     * @param parameters parts of path to the resource.
296
     * @return the path name to the resource.
297
     */
298
    public String getResource(String... parameters) {
299
        return null;
300
    }
301

    
302
    /**
303
     * Open an existen data store an return it.
304
     *
305
     * The type of store depened of store to be opened. It can be:
306
     * <ul>
307
     * <li>Shape</li>
308
     * <li>Dbf</li>
309
     * <li>DXF</li>
310
     * <li>DGN</li>
311
     * <li>DWG</li>
312
     * <li>JExcel</li>
313
     * <li>PostgreSQL</li>
314
     * <li>WFSStore</li>
315
     * <li>Gdal Store</li>
316
     * </ul>
317
     *
318
     * Example with PostgreSQL connection:
319
     * <code>
320
     * from gvsig.utils import openStore
321
     *
322
     * os = openStore('PostgreSQL',_entity_='Persistence%3APostgreSQLStoreParameters',
323
     *                             port='5432',
324
     *                             JDBCDriverClass='org.postgresql.Driver',
325
     *                             UseSSL='false',
326
     *                             Schema='public',
327
     *                             Catalog='',
328
     *                             URL='jdbc%3Apostgresql%3A%2F%2Flocalhost%3A5432%2Fej1',
329
     *                             BaseOrder='',
330
     *                             Workingarea=None,
331
     *                             CRS='EPSG:23030',
332
     *                             PKFields='gid',
333
     *                             BaseFilter='',
334
     *                             DefaultGeometryField='geom',
335
     *                             Fields='gid%2Cnombre%2Cpoblacion%2Cgeom',
336
     *                             Table='ciudades',
337
     *                             SQL='',
338
     *                             password='postgres',
339
     *                             dbname='ej1',
340
     *                             host='localhost',
341
     *                             dbuser='postgres',
342
     *                             ProviderName='PostgreSQL')
343
     * </code>
344
     *
345
     * @param storeType the type of store to open.
346
     * @param parameters to open the store.
347
     * @return the opened data store
348
     */
349
    public DataStore openStore(String storeType, Object... parameters) {
350
        return null;
351
    }
352
    
353
    /**
354
     * Create a new projectionobject associated with the passed name of 
355
     * the projection.
356
     * 
357
     * Usually, the name is the abbreviation of the projection.
358
     * 
359
     * Is preferable to use this method <code>CRSFactory.getCRS(name)</code> instead.
360
     * 
361
     * @param name abbreviation of the projection
362
     * @return the projection object associated with the name
363
     */
364
    public IProjection getCRS(String name) {
365
        return null;
366
    }
367
    
368
    /**
369
     * Return the default data folder of gvSIG.
370
     * This is configured in the preferences of gvSIG.
371
     * 
372
     * @return the data folder of gvSIG
373
     */
374
    public String getDataFolder() {
375
        return null;
376
    }
377
    
378
    /**
379
     * Return the default projects folder of gvSIG.
380
     * This is configured in the preferences of gvSIG.
381
     * 
382
     * @return the projects folder of gvSIG.
383
     */
384
    public String getProjectsFolder() {
385
        return null;
386
    }
387
}