Revision 26883
branches/v2_0_0_prep/libraries/libGeocoding/.classpath | ||
---|---|---|
5 | 5 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
6 | 6 |
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> |
7 | 7 |
<classpathentry kind="lib" path="/_fwAndami/lib/iver-utiles.jar" sourcepath="/libIverUtiles"/> |
8 |
<classpathentry combineaccessrules="false" kind="src" path="/libStorage"/> |
|
9 |
<classpathentry combineaccessrules="false" kind="src" path="/libFMap"/> |
|
10 |
<classpathentry kind="lib" path="/_fwAndami/lib/log4j-1.2.8.jar"/> |
|
11 |
<classpathentry kind="lib" path="/libFMap/lib/geoapi-2.0.jar"/> |
|
12 |
<classpathentry kind="lib" path="/libFMap/lib/jts-1.9.jar"/> |
|
8 |
<classpathentry kind="lib" path="/_fwAndami/lib/log4j-1.2.15.jar"/> |
|
9 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/jts-1.9.jar"/> |
|
10 |
<classpathentry kind="lib" path="/_fwAndami/lib/org.gvsig.tools-2.0-20090213.102351-2.jar"/> |
|
11 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/org.gvsig.fmap.dal-impl.jar"/> |
|
12 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/org.gvsig.fmap.dal.jar"/> |
|
13 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/org.gvsig.fmap.geometry.jar"/> |
|
13 | 14 |
<classpathentry kind="output" path="bin"/> |
14 | 15 |
</classpath> |
branches/v2_0_0_prep/libraries/libGeocoding/src/org/gvsig/geocoding/geommatches/CrossLineMatcher.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.geocoding.geommatches; |
29 | 29 |
|
30 |
|
|
30 | 31 |
import java.util.ArrayList; |
31 | 32 |
import java.util.HashMap; |
32 | 33 |
import java.util.HashSet; |
... | ... | |
36 | 37 |
import java.util.Set; |
37 | 38 |
|
38 | 39 |
import org.apache.log4j.Logger; |
39 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
|
40 | 40 |
import org.gvsig.fmap.geom.Geometry; |
41 | 41 |
import org.gvsig.fmap.geom.primitive.Point2D; |
42 | 42 |
|
... | ... | |
63 | 63 |
|
64 | 64 |
// Group first features collection by one field |
65 | 65 |
HashMap geomstreets1 = groupFeaturesByAttribute(this |
66 |
.getGroupFieldPosition(), (FeatureCollection) this
|
|
66 |
.getGroupFieldPosition(), (List) this
|
|
67 | 67 |
.getFeatures().get(0)); |
68 | 68 |
List streets1 = new ArrayList(); |
69 | 69 |
Iterator itt1 = geomstreets1.entrySet().iterator(); |
... | ... | |
85 | 85 |
|
86 | 86 |
// Group second features collection by one field |
87 | 87 |
HashMap geomstreets2 = groupFeaturesByAttribute(this |
88 |
.getGroupFieldPosition(), (FeatureCollection) this
|
|
88 |
.getGroupFieldPosition(), (List) this
|
|
89 | 89 |
.getFeatures().get(1)); |
90 | 90 |
List streets2 = new ArrayList(); |
91 | 91 |
Iterator itt2 = geomstreets2.entrySet().iterator(); |
branches/v2_0_0_prep/libraries/libGeocoding/src/org/gvsig/geocoding/geommatches/SimpleLineMatcher.java | ||
---|---|---|
31 | 31 |
import java.util.ArrayList; |
32 | 32 |
import java.util.HashMap; |
33 | 33 |
import java.util.Iterator; |
34 |
import java.util.List; |
|
34 | 35 |
import java.util.Map; |
35 | 36 |
|
36 |
import org.gvsig.fmap.data.feature.*;
|
|
37 |
import org.gvsig.fmap.dal.feature.Feature;
|
|
37 | 38 |
import org.gvsig.fmap.geom.Geometry; |
38 | 39 |
import org.gvsig.fmap.geom.primitive.Curve2D; |
39 | 40 |
import org.gvsig.fmap.geom.primitive.Point2D; |
... | ... | |
62 | 63 |
|
63 | 64 |
// Group the geometries by one field |
64 | 65 |
HashMap geomstreets1 = groupFeaturesByAttribute(this |
65 |
.getGroupFieldPosition(), (FeatureCollection) this
|
|
66 |
.getGroupFieldPosition(), (List) this
|
|
66 | 67 |
.getFeatures().get(0)); |
67 | 68 |
Iterator it = geomstreets1.entrySet().iterator(); |
68 | 69 |
Point2D[] points = new Point2D[geomstreets1.size()]; |
... | ... | |
175 | 176 |
@SuppressWarnings("unchecked") |
176 | 177 |
private Point2D getOffsetPosition(Point2D linePoint, double dist) { |
177 | 178 |
|
178 |
FeatureCollection feats = (FeatureCollection) getFeatures().get(0);
|
|
179 |
List feats = (List) getFeatures().get(0);
|
|
179 | 180 |
Geometry[] geoms = new Geometry[feats.size()]; |
180 | 181 |
Iterator it = feats.iterator(); |
181 | 182 |
int cont = 0; |
branches/v2_0_0_prep/libraries/libGeocoding/src/org/gvsig/geocoding/geommatches/GeomMatcher.java | ||
---|---|---|
33 | 33 |
import java.util.List; |
34 | 34 |
|
35 | 35 |
import org.apache.log4j.Logger; |
36 |
import org.gvsig.fmap.dal.feature.Feature; |
|
37 |
import org.gvsig.fmap.geom.DefaultGeometryManager; |
|
38 |
import org.gvsig.fmap.geom.Geometry; |
|
39 |
import org.gvsig.fmap.geom.GeometryManager; |
|
40 |
import org.gvsig.fmap.geom.operation.GeometryOperation; |
|
41 |
import org.gvsig.fmap.geom.operation.GeometryOperationContext; |
|
42 |
import org.gvsig.fmap.geom.operation.tojts.ToJTS; |
|
36 | 43 |
|
37 | 44 |
import com.vividsolutions.jts.operation.overlay.OverlayOp; |
38 | 45 |
|
... | ... | |
49 | 56 |
|
50 | 57 |
public Logger log = Logger.getLogger(GeomMatcher.class); |
51 | 58 |
|
52 |
@SuppressWarnings({ "unused", "unchecked" }) |
|
59 |
@SuppressWarnings( { "unused", "unchecked" })
|
|
53 | 60 |
private List listFeats; |
54 | 61 |
private MatchesParams params; |
55 | 62 |
private int fieldPosition; |
... | ... | |
124 | 131 |
|
125 | 132 |
com.vividsolutions.jts.geom.Geometry[] geomsjts = new com.vividsolutions.jts.geom.Geometry[geoms.length]; |
126 | 133 |
|
127 |
GeometryManager gm = GeometryManager.getInstance();
|
|
134 |
GeometryManager gm = new DefaultGeometryManager();
|
|
128 | 135 |
GeometryOperation geomOp = null; |
129 | 136 |
|
130 | 137 |
try { |
... | ... | |
140 | 147 |
} |
141 | 148 |
|
142 | 149 |
} catch (Exception e) { |
143 |
log.debug("Error parsing geometries to JTS"); |
|
144 |
e.printStackTrace(); |
|
150 |
log.debug("Error parsing geometries to JTS",e); |
|
145 | 151 |
} |
146 | 152 |
log.debug("Geometry parsed"); |
147 | 153 |
return geomsjts; |
... | ... | |
286 | 292 |
* @return |
287 | 293 |
*/ |
288 | 294 |
@SuppressWarnings("unchecked") |
289 |
protected HashMap groupFeaturesByAttribute(int fieldPosition, |
|
290 |
FeatureCollection feats) { |
|
295 |
protected HashMap groupFeaturesByAttribute(int fieldPosition, List feats) { |
|
291 | 296 |
|
292 | 297 |
HashMap coleccion = new HashMap(); |
293 | 298 |
Iterator it = feats.iterator(); |
branches/v2_0_0_prep/libraries/libGeocoding/src/org/gvsig/geocoding/geommatches/PolygonMatcher.java | ||
---|---|---|
3 | 3 |
import java.util.ArrayList; |
4 | 4 |
import java.util.HashMap; |
5 | 5 |
import java.util.Iterator; |
6 |
import java.util.List; |
|
6 | 7 |
import java.util.Map; |
7 | 8 |
|
8 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
|
9 | 9 |
import org.gvsig.fmap.geom.Geometry; |
10 | 10 |
import org.gvsig.fmap.geom.primitive.Point2D; |
11 | 11 |
|
... | ... | |
21 | 21 |
public Geometry[] match() { |
22 | 22 |
|
23 | 23 |
HashMap polys = groupFeaturesByAttribute(this.getGroupFieldPosition(), |
24 |
(FeatureCollection) this.getFeatures().get(0));
|
|
24 |
(List) this.getFeatures().get(0));
|
|
25 | 25 |
Iterator it = polys.entrySet().iterator(); |
26 | 26 |
Geometry[] mPoints = new Geometry[polys.size()]; |
27 | 27 |
int position = 0; |
28 | 28 |
while (it.hasNext()) { |
29 | 29 |
Map.Entry e = (Map.Entry) it.next(); |
30 | 30 |
ArrayList geomss = (ArrayList) e.getValue(); |
31 |
|
|
31 |
|
|
32 | 32 |
// Insert geometries of one street into array |
33 | 33 |
Geometry[] arrGeoms = new Geometry[geomss.size()]; |
34 | 34 |
for (int i = 0; i < geomss.size(); i++) { |
35 |
Geometry ggeom = (Geometry) geomss.get(i);
|
|
35 |
Geometry ggeom = (Geometry) geomss.get(i); |
|
36 | 36 |
arrGeoms[i] = ggeom; |
37 | 37 |
} |
38 | 38 |
// Parse geometries to JTS |
... | ... | |
43 | 43 |
Point2D pts = getCenterOfPolygon(geomsjts[j]); |
44 | 44 |
mPoints[position] = pts; |
45 | 45 |
position++; |
46 |
}
|
|
46 |
} |
|
47 | 47 |
} |
48 | 48 |
return mPoints; |
49 | 49 |
} |
branches/v2_0_0_prep/libraries/libGeocoding/src/org/gvsig/geocoding/geommatches/DoubleCrossLineMatcher.java | ||
---|---|---|
33 | 33 |
import java.util.List; |
34 | 34 |
import java.util.Map; |
35 | 35 |
|
36 |
import org.gvsig.fmap.data.feature.*;
|
|
36 |
import org.gvsig.fmap.dal.feature.Feature;
|
|
37 | 37 |
import org.gvsig.fmap.geom.Geometry; |
38 | 38 |
import org.gvsig.fmap.geom.primitive.Curve2D; |
39 | 39 |
import org.gvsig.fmap.geom.util.Converter; |
... | ... | |
57 | 57 |
|
58 | 58 |
// Group first features collection |
59 | 59 |
HashMap geomstreets1 = groupFeaturesByAttribute(this |
60 |
.getGroupFieldPosition(), (FeatureCollection) this |
|
61 |
.getFeatures().get(0)); |
|
60 |
.getGroupFieldPosition(), (List) this.getFeatures().get(0)); |
|
62 | 61 |
List streets1 = new ArrayList(); |
63 | 62 |
Iterator it1 = geomstreets1.entrySet().iterator(); |
64 | 63 |
while (it1.hasNext()) { |
... | ... | |
78 | 77 |
} |
79 | 78 |
// Group second features collection by one field |
80 | 79 |
HashMap geomstreets2 = groupFeaturesByAttribute(this |
81 |
.getGroupFieldPosition(), (FeatureCollection) this
|
|
80 |
.getGroupFieldPosition(), (List) this
|
|
82 | 81 |
.getFeatures().get(1)); |
83 | 82 |
List streets2 = new ArrayList(); |
84 | 83 |
Iterator it2 = geomstreets2.entrySet().iterator(); |
... | ... | |
99 | 98 |
} |
100 | 99 |
// Group third features collection |
101 | 100 |
HashMap ppalstreets = groupFeaturesByAttribute(this |
102 |
.getGroupFieldPosition(), (FeatureCollection) this
|
|
101 |
.getGroupFieldPosition(), (List) this
|
|
103 | 102 |
.getFeatures().get(2)); |
104 | 103 |
List streets3 = new ArrayList(); |
105 | 104 |
Iterator it3 = ppalstreets.entrySet().iterator(); |
... | ... | |
159 | 158 |
} |
160 | 159 |
} |
161 | 160 |
} |
162 |
}
|
|
161 |
} |
|
163 | 162 |
|
164 |
FeatureCollection ppalFeats = (FeatureCollection) getFeatures().get(2);
|
|
163 |
List ppalFeats = (List) getFeatures().get(2);
|
|
165 | 164 |
List results = new ArrayList(); |
166 | 165 |
|
167 | 166 |
Iterator it7 = ppalFeats.iterator(); |
Also available in: Unified diff