Statistics
| Revision:

root / trunk / extensions / extGeoProcessing / src / com / iver / cit / gvsig / geoprocess / dissolve / fmap / IDissolveCriteria.java @ 5412

History | View | Annotate | Download (3.92 KB)

1
/*
2
 * Created on 12-may-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: IDissolveCriteria.java 5412 2006-05-24 21:15:07Z azabala $
47
* $Log$
48
* Revision 1.1  2006-05-24 21:11:14  azabala
49
* primera version en cvs despues de refactoring orientado a crear un framework extensible de geoprocessing
50
*
51
*
52
*/
53
package com.iver.cit.gvsig.geoprocess.dissolve.fmap;
54

    
55
import java.util.ArrayList;
56
import java.util.Iterator;
57
import java.util.List;
58
import java.util.Map;
59

    
60
import com.iver.cit.gvsig.fmap.DriverException;
61
import com.iver.cit.gvsig.fmap.core.IFeature;
62
import com.iver.cit.gvsig.fmap.core.IGeometry;
63
import com.iver.cit.gvsig.fmap.drivers.FieldDescription;
64
import com.iver.cit.gvsig.fmap.drivers.ILayerDefinition;
65
import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition;
66
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
67
import com.iver.cit.gvsig.geoprocess.core.fmap.DefinitionUtils;
68
import com.iver.cit.gvsig.geoprocess.core.fmap.SummarizationFunction;
69
import com.iver.cit.gvsig.geoprocess.core.fmap.XTypes;
70
/**
71
 * Implementations has the responsability of decide if Dissolver must
72
 * dissolve two features.
73
 * <br>
74
 * Because this decision could depend of one (or many) attribute values
75
 * of compared features, and resulting features of dissolve must have
76
 * all dissolving fields, implementations of this interface must have
77
 * the responsability of creating new resulting features of a dissolve.
78
 * @author azabala
79
 * 
80
 */
81
public interface IDissolveCriteria {
82
        /**
83
         * Returns if we must dissolve feature of index "featureindex1" with
84
         * feature of index "featureindex2"
85
         * @param featureIndex1
86
         * @param featureIndex2
87
         * @return
88
         */
89
        public boolean verifyIfDissolve(int featureIndex1, int featureIndex2);
90
        
91
        /**
92
         * Builds features from a dissolve operation.
93
         * @author azabala
94
         *
95
         */
96
        public interface IDissolvedFeatureBuilder {
97
                /**
98
                 * Create a new feature from geometry g, and the index of
99
                 * the 'seed' (first feature of the dissolve group) feature
100
                 * (useful for fetching dissolve fields value, etc.)
101
                 * @param g
102
                 * @param index
103
                 * @param fid
104
                 * @return
105
                 */
106
                public IFeature createFeature(IGeometry g, int index, int fid);
107
                /**
108
                 * 
109
                 * @param newGeometry
110
                 * @param sumarizedValues
111
                 * @param newFid
112
                 * @param index
113
                 * @return
114
                 */
115
                public IFeature createFeature(IGeometry newGeometry, 
116
                                List sumarizedValues, int newFid, int index);
117
        }
118
        
119
        
120
        public IDissolvedFeatureBuilder getFeatureBuilder();
121
        
122
        /**
123
         * Clear all state information about dissolving
124
         * (usually a criteria could cache dissolve information to 
125
         * avoid reading dissolve fields value always)
126
         *
127
         */
128
        public void clear();
129
        
130
        /**
131
         * Returns a LayerDefinition for the result layer of those
132
         * dissolve geoprocesses where this criteria applies.
133
         * 
134
         * @return
135
         */
136
        public ILayerDefinition createLayerDefinition(Map numFields_SumFunc);
137
}
138

    
139