Revision 10626 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/dissolve/fmap/SingleFieldAdjacencyDissolveCriteria.java
SingleFieldAdjacencyDissolveCriteria.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.1 2006-06-20 18:20:45 azabala |
|
48 |
* Revision 1.2 2007-03-06 16:47:58 caballero |
|
49 |
* Exceptions |
|
50 |
* |
|
51 |
* Revision 1.1 2006/06/20 18:20:45 azabala |
|
49 | 52 |
* first version in cvs |
50 | 53 |
* |
51 | 54 |
* Revision 1.1 2006/05/24 21:11:14 azabala |
... | ... | |
55 | 58 |
*/ |
56 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.dissolve.fmap; |
57 | 60 |
|
58 |
import org.cresques.cts.ICoordTrans; |
|
59 |
|
|
61 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
60 | 62 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
61 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
62 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
63 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
63 | 64 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
64 | 65 |
import com.vividsolutions.jts.geom.Geometry; |
65 |
import com.vividsolutions.jts.geom.IntersectionMatrix; |
|
66 | 66 |
|
67 | 67 |
/** |
68 | 68 |
* Its a SingleFieldCriteria that adds adjacency condition: |
... | ... | |
78 | 78 |
ISpatialDissolveCriteria*/{ |
79 | 79 |
|
80 | 80 |
// private IGeometry firstGeometry; |
81 |
//
|
|
81 |
// |
|
82 | 82 |
// private IGeometry secondGeometry; |
83 |
//
|
|
83 |
// |
|
84 | 84 |
// private ICoordTrans ct; |
85 | 85 |
/** |
86 | 86 |
* Cached jts geometry of the dissolve 'seed' |
87 | 87 |
*/ |
88 | 88 |
// private Geometry cachedJts; |
89 |
//
|
|
89 |
// |
|
90 | 90 |
// private Geometry cachedJts2; |
91 |
|
|
92 |
|
|
93 |
public SingleFieldAdjacencyDissolveCriteria(String dissolveField,
|
|
91 |
|
|
92 |
|
|
93 |
public SingleFieldAdjacencyDissolveCriteria(String dissolveField, |
|
94 | 94 |
FLyrVect layer) throws DriverException { |
95 | 95 |
super(dissolveField, layer); |
96 | 96 |
} |
97 |
|
|
98 |
|
|
97 |
|
|
98 |
|
|
99 | 99 |
// public IGeometry getFirstGeometry(){ |
100 | 100 |
//// return firstGeometry; |
101 | 101 |
// } |
102 |
//
|
|
102 |
// |
|
103 | 103 |
// public IGeometry getSecondGeometry(){ |
104 | 104 |
// return secondGeometry; |
105 | 105 |
// } |
106 |
|
|
107 |
|
|
106 |
|
|
107 |
|
|
108 | 108 |
public boolean verifyIfDissolve(int featureIndex1, int featureIndex2) { |
109 | 109 |
//first the alphanumeric criteria |
110 | 110 |
if(super.verifyIfDissolve(featureIndex1, featureIndex2)){ |
... | ... | |
117 | 117 |
try { |
118 | 118 |
g1 = layer.getSource().getShape(featureIndex1).toJTSGeometry(); |
119 | 119 |
g2 = layer.getSource().getShape(featureIndex2).toJTSGeometry(); |
120 |
} catch (DriverIOException e) {
|
|
120 |
} catch (ReadDriverException e) {
|
|
121 | 121 |
return false; |
122 |
} catch (ExpansionFileReadException e) { |
|
123 |
return false; |
|
122 | 124 |
} |
123 | 125 |
return g1.intersects(g2); |
124 | 126 |
// return cachedJts.intersects(cachedJts2); |
125 |
|
|
127 |
|
|
126 | 128 |
} |
127 | 129 |
return false; |
128 | 130 |
} |
129 |
|
|
131 |
|
|
130 | 132 |
/** |
131 | 133 |
* Verify if the geometry of the seed feature has been readed, |
132 | 134 |
* and reads it if not. |
... | ... | |
145 | 147 |
// } |
146 | 148 |
// } |
147 | 149 |
// } |
148 |
|
|
150 |
|
|
149 | 151 |
/** |
150 | 152 |
* Verify if the geometry of the seed feature has been readed, |
151 | 153 |
* and reads it if not. |
... | ... | |
165 | 167 |
// } |
166 | 168 |
// } |
167 | 169 |
|
168 |
|
|
170 |
|
|
169 | 171 |
public void clear() { |
170 | 172 |
super.clear(); |
171 | 173 |
// cachedJts = null; |
172 |
|
|
174 |
|
|
173 | 175 |
} |
174 | 176 |
|
175 | 177 |
|
... | ... | |
193 | 195 |
// public void setFirstJts(Geometry g) { |
194 | 196 |
// cachedJts = g; |
195 | 197 |
// } |
196 |
//
|
|
198 |
// |
|
197 | 199 |
// public Geometry getSecondJts(){ |
198 | 200 |
// return cachedJts2; |
199 | 201 |
// } |
Also available in: Unified diff