root / trunk / extensions / extGeoProcessing / src / com / iver / gvsig / geoprocessing / model / IGeoprocess.java @ 4447
History | View | Annotate | Download (4.14 KB)
1 |
/*
|
---|---|
2 |
* Created on 01-feb-2006
|
3 |
*
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Generalitat Valenciana
|
25 |
* Conselleria d'Infraestructures i Transport
|
26 |
* Av. Blasco Ib??ez, 50
|
27 |
* 46010 VALENCIA
|
28 |
* SPAIN
|
29 |
*
|
30 |
* +34 963862235
|
31 |
* gvsig@gva.es
|
32 |
* www.gvsig.gva.es
|
33 |
*
|
34 |
* or
|
35 |
*
|
36 |
* IVER T.I. S.A
|
37 |
* Salamanca 50
|
38 |
* 46005 Valencia
|
39 |
* Spain
|
40 |
*
|
41 |
* +34 963163400
|
42 |
* dac@iver.es
|
43 |
*/
|
44 |
/* CVS MESSAGES:
|
45 |
*
|
46 |
* $Id: IGeoprocess.java 4447 2006-03-15 18:35:56Z azabala $
|
47 |
* $Log$
|
48 |
* Revision 1.4 2006-03-15 18:34:50 azabala
|
49 |
* *** empty log message ***
|
50 |
*
|
51 |
* Revision 1.3 2006/03/14 18:32:46 fjp
|
52 |
* Cambio con LayerDefinition para que sea compatible con la definici?n de tablas tambi?n.
|
53 |
*
|
54 |
* Revision 1.2 2006/02/13 17:55:25 azabala
|
55 |
* *** empty log message ***
|
56 |
*
|
57 |
* Revision 1.1 2006/02/12 21:03:25 azabala
|
58 |
* *** empty log message ***
|
59 |
*
|
60 |
* Revision 1.3 2006/02/06 19:05:26 azabala
|
61 |
* Changes in creation of layer result
|
62 |
*
|
63 |
* Revision 1.2 2006/02/02 19:47:57 azabala
|
64 |
* Added method setResult
|
65 |
*
|
66 |
* Revision 1.1 2006/02/01 19:40:59 azabala
|
67 |
* First version in CVS
|
68 |
*
|
69 |
*
|
70 |
*/
|
71 |
package com.iver.gvsig.geoprocessing.model; |
72 |
|
73 |
import java.util.Map; |
74 |
|
75 |
import com.iver.cit.gvsig.fmap.drivers.ILayerDefinition; |
76 |
import com.iver.cit.gvsig.fmap.edition.ISchemaManager; |
77 |
import com.iver.cit.gvsig.fmap.edition.IWriter; |
78 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
79 |
import com.iver.utiles.swing.threads.IBackgroundExecution; |
80 |
|
81 |
/**
|
82 |
*
|
83 |
* Spatial process which operates with one or more
|
84 |
* vectorial layers to produce a new vectorial layer.
|
85 |
* So geoprocesses could be costly task, extends IBackgroundExecution
|
86 |
* interface that offers a method to run in background.
|
87 |
*
|
88 |
* @author azabala
|
89 |
*
|
90 |
* TODO Migrate to libGeoprocess all geoprocessing logic,
|
91 |
* and GUIS in extGeoprocessing
|
92 |
*
|
93 |
*
|
94 |
*
|
95 |
*/
|
96 |
public interface IGeoprocess extends IBackgroundExecution{ |
97 |
|
98 |
/**
|
99 |
* It sets geoprocess parameters
|
100 |
* @param params
|
101 |
* @throws geoprocess exception for invalid params
|
102 |
*/
|
103 |
public void setParameters(Map params) throws GeoprocessException; |
104 |
|
105 |
/**
|
106 |
* Many geoprocess has to verify some preconditions
|
107 |
* to run. If these checks doesnt pass, the geoprocess
|
108 |
* wont run.
|
109 |
* @return if entry params verify preconditions to run geoprocess
|
110 |
*/
|
111 |
public void checkPreconditions() throws GeoprocessException; |
112 |
|
113 |
/**
|
114 |
* process spatial layers to generate a new layer
|
115 |
*/
|
116 |
public void process() throws GeoprocessException; |
117 |
|
118 |
/**
|
119 |
* Allows to cancel large and computatinal costly proccesses.
|
120 |
*/
|
121 |
public void cancel(); |
122 |
|
123 |
/**
|
124 |
* Creates a new layer from geoprocess results
|
125 |
* @return a new vectorial layer
|
126 |
*/
|
127 |
public FLyrVect getResult() throws GeoprocessException; |
128 |
|
129 |
/**
|
130 |
* Allows "clients" of this geoprocess to set persistent datastore
|
131 |
* properties to save results
|
132 |
* @param adapter editable adapter to manage geometries' operations
|
133 |
* @param writer has the responsability to save final results
|
134 |
* @param schemaManager knows how to create datastore schema
|
135 |
*/
|
136 |
public void setResultLayerProperties( IWriter writer, |
137 |
ISchemaManager schemaManager); |
138 |
|
139 |
/**
|
140 |
* Geoprocess' result layer will be a function of geoprocess
|
141 |
* inputs layer, user selection (params) and geoprocess itself
|
142 |
* (data transforms that geoprocess will do). This method
|
143 |
* offers a LayerDefinition that is function of all of this
|
144 |
* causes.
|
145 |
*
|
146 |
* @return LayerDefinition that describes result layer.
|
147 |
*/
|
148 |
|
149 |
public ILayerDefinition createLayerDefinition();
|
150 |
} |
151 |
|