svn-gvsig-desktop / trunk / extensions / extGeoProcessing / src / com / iver / cit / gvsig / geoprocess / impl / dissolve / fmap / IDissolveCriteria.java @ 8214
History | View | Annotate | Download (4 KB)
1 | 5918 | azabala | /*
|
---|---|---|---|
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$
|
||
47 | * $Log$
|
||
48 | * Revision 1.1 2006-06-20 18:20:45 azabala
|
||
49 | * first version in cvs
|
||
50 | *
|
||
51 | * Revision 1.1 2006/05/24 21:11:14 azabala
|
||
52 | * primera version en cvs despues de refactoring orientado a crear un framework extensible de geoprocessing
|
||
53 | *
|
||
54 | *
|
||
55 | */
|
||
56 | package com.iver.cit.gvsig.geoprocess.impl.dissolve.fmap; |
||
57 | |||
58 | import java.util.ArrayList; |
||
59 | import java.util.Iterator; |
||
60 | import java.util.List; |
||
61 | import java.util.Map; |
||
62 | |||
63 | import com.iver.cit.gvsig.fmap.DriverException; |
||
64 | import com.iver.cit.gvsig.fmap.core.IFeature; |
||
65 | import com.iver.cit.gvsig.fmap.core.IGeometry; |
||
66 | import com.iver.cit.gvsig.fmap.drivers.FieldDescription; |
||
67 | import com.iver.cit.gvsig.fmap.drivers.ILayerDefinition; |
||
68 | import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition; |
||
69 | import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
||
70 | import com.iver.cit.gvsig.geoprocess.core.fmap.DefinitionUtils; |
||
71 | import com.iver.cit.gvsig.geoprocess.core.fmap.SummarizationFunction; |
||
72 | import com.iver.cit.gvsig.geoprocess.core.fmap.XTypes; |
||
73 | /**
|
||
74 | * Implementations has the responsability of decide if Dissolver must
|
||
75 | * dissolve two features.
|
||
76 | * <br>
|
||
77 | * Because this decision could depend of one (or many) attribute values
|
||
78 | * of compared features, and resulting features of dissolve must have
|
||
79 | * all dissolving fields, implementations of this interface must have
|
||
80 | * the responsability of creating new resulting features of a dissolve.
|
||
81 | * @author azabala
|
||
82 | *
|
||
83 | */
|
||
84 | public interface IDissolveCriteria { |
||
85 | /**
|
||
86 | * Returns if we must dissolve feature of index "featureindex1" with
|
||
87 | * feature of index "featureindex2"
|
||
88 | * @param featureIndex1
|
||
89 | * @param featureIndex2
|
||
90 | * @return
|
||
91 | */
|
||
92 | public boolean verifyIfDissolve(int featureIndex1, int featureIndex2); |
||
93 | |||
94 | /**
|
||
95 | * Builds features from a dissolve operation.
|
||
96 | * @author azabala
|
||
97 | *
|
||
98 | */
|
||
99 | public interface IDissolvedFeatureBuilder { |
||
100 | /**
|
||
101 | * Create a new feature from geometry g, and the index of
|
||
102 | * the 'seed' (first feature of the dissolve group) feature
|
||
103 | * (useful for fetching dissolve fields value, etc.)
|
||
104 | * @param g
|
||
105 | * @param index
|
||
106 | * @param fid
|
||
107 | * @return
|
||
108 | */
|
||
109 | public IFeature createFeature(IGeometry g, int index, int fid); |
||
110 | /**
|
||
111 | *
|
||
112 | * @param newGeometry
|
||
113 | * @param sumarizedValues
|
||
114 | * @param newFid
|
||
115 | * @param index
|
||
116 | * @return
|
||
117 | */
|
||
118 | public IFeature createFeature(IGeometry newGeometry,
|
||
119 | List sumarizedValues, int newFid, int index); |
||
120 | } |
||
121 | |||
122 | |||
123 | public IDissolvedFeatureBuilder getFeatureBuilder();
|
||
124 | |||
125 | /**
|
||
126 | * Clear all state information about dissolving
|
||
127 | * (usually a criteria could cache dissolve information to
|
||
128 | * avoid reading dissolve fields value always)
|
||
129 | *
|
||
130 | */
|
||
131 | public void clear(); |
||
132 | |||
133 | /**
|
||
134 | * Returns a LayerDefinition for the result layer of those
|
||
135 | * dissolve geoprocesses where this criteria applies.
|
||
136 | *
|
||
137 | * @return
|
||
138 | */
|
||
139 | public ILayerDefinition createLayerDefinition(Map numFields_SumFunc); |
||
140 | } |
||
141 |