root / trunk / extensions / extGeoProcessing / src / com / iver / gvsig / geoprocessing / operations / GeoProcessingTopologyOperations.java @ 2989
History | View | Annotate | Download (20.9 KB)
1 |
/*
|
---|---|
2 |
* Created on 02-jun-2005
|
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 |
package com.iver.gvsig.geoprocessing.operations; |
45 |
|
46 |
import java.util.BitSet; |
47 |
import java.util.Vector; |
48 |
|
49 |
import com.vividsolutions.jts.geom.Geometry; |
50 |
import com.vividsolutions.jts.geom.GeometryCollection; |
51 |
import com.vividsolutions.jts.geom.GeometryFactory; |
52 |
import com.vividsolutions.jts.geom.LineSegment; |
53 |
import com.vividsolutions.jts.geom.LineString; |
54 |
import com.vividsolutions.jts.geom.LinearRing; |
55 |
|
56 |
/**
|
57 |
* @author jmorell
|
58 |
*/
|
59 |
public final class GeoProcessingTopologyOperations { |
60 |
public static Geometry[] makeBuffers(Geometry[] geometries, double[] bufferDistances, int quadrantSegments) { |
61 |
Geometry[] buffers = new Geometry[geometries.length]; |
62 |
for (int i=0;i<geometries.length;i++) { |
63 |
Geometry geometry = geometries[i]; |
64 |
buffers[i] = geometry.buffer(bufferDistances[i], quadrantSegments); |
65 |
} |
66 |
return buffers;
|
67 |
} |
68 |
public static Geometry makeDissolveBuffer(Geometry[] geometries, double bufferDistance, int quadrantSegments) { |
69 |
GeometryFactory geometryFactory = new GeometryFactory();
|
70 |
GeometryCollection geometryCollection = new GeometryCollection(geometries,
|
71 |
geometryFactory); |
72 |
Geometry geometryCollectionBuffer = geometryCollection.buffer(bufferDistance, quadrantSegments); |
73 |
return geometryCollectionBuffer;
|
74 |
} |
75 |
public static Geometry makeDissolveBuffer(Geometry[] geometries, double[] bufferDistances, int quadrantSegments) { |
76 |
Geometry[] buffers = new Geometry[geometries.length]; |
77 |
for (int i=0;i<geometries.length;i++) { |
78 |
Geometry geometry = geometries[i]; |
79 |
buffers[i] = geometry.buffer(bufferDistances[i], quadrantSegments); |
80 |
} |
81 |
GeometryFactory geometryFactory = new GeometryFactory();
|
82 |
GeometryCollection geometryCollection = new GeometryCollection(buffers,
|
83 |
geometryFactory); |
84 |
// Hago un buffer con d=0 solo para poder devolver un POLYGON y no una GEOMETRYCOLLECTION
|
85 |
// Molar?a conseguir el mismo efecto de una manera m?s ortodoxa ... investigar ...
|
86 |
Geometry geometryCollectionBuffer = geometryCollection.buffer(0);
|
87 |
System.out.println("geometryCollection = " + geometryCollection); |
88 |
return geometryCollectionBuffer;
|
89 |
} |
90 |
/*public static Geometry[] makeDissolve(Geometry[] geometriesToDissolve, AlphanumericData lyr, String dissolveAttributeName) {
|
91 |
Vector resultGeometries = new Vector();
|
92 |
DataSource ds;
|
93 |
try {
|
94 |
ds = lyr.getRecordset();
|
95 |
int fieldId = ds.getFieldIndexByName(dissolveAttributeName);
|
96 |
Value[] fieldValues = new Value[(int)ds.getRowCount()];
|
97 |
//int j = 0;
|
98 |
for (int i=0;i<ds.getRowCount();i++) {
|
99 |
fieldValues[i] = ds.getFieldValue(i, fieldId);
|
100 |
}
|
101 |
for (int i=0;i<fieldValues.length;i++) {
|
102 |
Value valuei = fieldValues[i];
|
103 |
Geometry geometryi = geometriesToDissolve[i];
|
104 |
//Geometry jtsGeometryi = geometryi.toJTSGeometry();
|
105 |
for (int j=0;j<ds.getRowCount();j++) {
|
106 |
if (j!=i) {
|
107 |
Value valuej = ds.getFieldValue(j, fieldId);
|
108 |
if (((BooleanValue)(valuej.equals(valuei))).getValue()) {
|
109 |
Geometry geometryj = geometriesToDissolve[j];
|
110 |
//Geometry jtsGeometryj = geometryj.toJTSGeometry();
|
111 |
//if (jtsGeometryj.intersection(jtsGeometryi) instanceof LineString ||
|
112 |
// jtsGeometryj.intersection(jtsGeometryi) instanceof LinearRing) {
|
113 |
geometryi = geometryj.union(geometryi);
|
114 |
//FPolygon2D union = (FPolygon2D)FConverter.jts_to_java2d(jtsUnion);
|
115 |
//resultGeometries.add(ShapeFactory.createGeometry(union));
|
116 |
//}
|
117 |
}
|
118 |
}
|
119 |
}
|
120 |
resultGeometries.add(geometryi);
|
121 |
}
|
122 |
} catch (DriverException e) {
|
123 |
// TODO Auto-generated catch block
|
124 |
e.printStackTrace();
|
125 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
126 |
// TODO Auto-generated catch block
|
127 |
e.printStackTrace();
|
128 |
} catch (IncompatibleTypesException e) {
|
129 |
// TODO Auto-generated catch block
|
130 |
e.printStackTrace();
|
131 |
}
|
132 |
Geometry[] result = new Geometry[resultGeometries.size()];
|
133 |
for (int i=0;i<resultGeometries.size();i++) {
|
134 |
result[i] = (Geometry)resultGeometries.get(i);
|
135 |
}
|
136 |
return result;
|
137 |
}*/
|
138 |
/*public static Geometry[] makeClip(Geometry[] geometriesToClip, Geometry[] clippingGeometries) {
|
139 |
Vector geometriesClipped = new Vector();
|
140 |
int l=0;
|
141 |
for (int i=0;i<geometriesToClip.length;i++) {
|
142 |
Geometry geometryToClip = geometriesToClip[i];
|
143 |
int k=0;
|
144 |
for (int j=0;j<clippingGeometries.length;j++) {
|
145 |
Geometry clippingGeometry = clippingGeometries[j];
|
146 |
if (clippingGeometry.intersects(geometryToClip)) {
|
147 |
geometriesClipped.add(geometryToClip.intersection(clippingGeometry));
|
148 |
// Para hacer un clip y no un intersect ...
|
149 |
if (k>0) {
|
150 |
geometriesClipped.set(l, ((Geometry)geometriesClipped.get(l)).union((Geometry)geometriesClipped.get(l-1)));
|
151 |
}
|
152 |
k++;
|
153 |
l++;
|
154 |
}
|
155 |
}
|
156 |
}
|
157 |
Geometry[] result = new Geometry[geometriesClipped.size()];
|
158 |
for (int i=0;i<geometriesClipped.size();i++) {
|
159 |
result[i] = (Geometry)geometriesClipped.get(i);
|
160 |
}
|
161 |
return result;
|
162 |
}*/
|
163 |
//public static Geometry[] makeIntersect(Geometry[] geometriesToIntersect, Geometry[] intersectingGeometries) {
|
164 |
/*Vector jtsGeometriesIntersected = new Vector();
|
165 |
IGeometry[] result = new IGeometry[geometriesToIntersect.length];
|
166 |
Geometry[] jtsGeometriesToClip = new Geometry[geometriesToIntersect.length];
|
167 |
for (int i=0;i<geometriesToIntersect.length;i++) {
|
168 |
IGeometry geometryToClip = geometriesToIntersect[i];
|
169 |
jtsGeometriesToClip[i] = geometryToClip.toJTSGeometry();
|
170 |
}
|
171 |
Geometry[] jtsClippingGeometries = new Geometry[intersectingGeometries.length];
|
172 |
for (int i=0;i<intersectingGeometries.length;i++) {
|
173 |
IGeometry clippingGeometry = intersectingGeometries[i];
|
174 |
jtsClippingGeometries[i] = clippingGeometry.toJTSGeometry();
|
175 |
}
|
176 |
Selectable selectable = (Selectable)layerToIntersect;
|
177 |
FBitSet fBitSet = new FBitSet();
|
178 |
for (int i=0;i<jtsGeometriesToClip.length;i++) {
|
179 |
Geometry jtsGeometryToClip = jtsGeometriesToClip[i];
|
180 |
for (int j=0;j<jtsClippingGeometries.length;j++) {
|
181 |
Geometry jtsClippingGeometry = jtsClippingGeometries[j];
|
182 |
if (jtsClippingGeometry.intersects(jtsGeometryToClip)) {
|
183 |
fBitSet.set(i);
|
184 |
jtsGeometriesIntersected.add(jtsGeometryToClip.intersection(jtsClippingGeometry));
|
185 |
}
|
186 |
}
|
187 |
}
|
188 |
selectable.setSelection(fBitSet);
|
189 |
result = new IGeometry[jtsGeometriesIntersected.size()];
|
190 |
for (int i=0;i<jtsGeometriesIntersected.size();i++) {
|
191 |
FShape shapeResult = (FShape)FConverter.jts_to_java2d((Geometry)jtsGeometriesIntersected.get(i));
|
192 |
result[i] = ShapeFactory.createGeometry(shapeResult);
|
193 |
}
|
194 |
return result;*/
|
195 |
/*Vector geometriesIntersected = new Vector();
|
196 |
//FBitSet fBitSet = new FBitSet();
|
197 |
// Convertimos a JTS
|
198 |
//int l=0;
|
199 |
for (int i=0;i<geometriesToIntersect.length;i++) {
|
200 |
Geometry geometryToIntersect = geometriesToIntersect[i];
|
201 |
//int k=0;
|
202 |
for (int j=0;j<intersectingGeometries.length;j++) {
|
203 |
Geometry intersectingGeometry = intersectingGeometries[j];
|
204 |
if (intersectingGeometry.intersects(geometryToIntersect)) {
|
205 |
//fBitSet.set(i);
|
206 |
geometriesIntersected.add(geometryToIntersect.intersection(intersectingGeometry));
|
207 |
// Para hacer un clip y no un intersect ...
|
208 |
//if (k>0) {
|
209 |
// geometriesIntersected.set(l, ((Geometry)geometriesIntersected.get(l)).union((Geometry)geometriesIntersected.get(l-1)));
|
210 |
//}
|
211 |
//k++;
|
212 |
//l++;
|
213 |
}
|
214 |
}
|
215 |
}
|
216 |
Geometry[] result = new Geometry[geometriesIntersected.size()];
|
217 |
for (int i=0;i<geometriesIntersected.size();i++) {
|
218 |
result[i] = (Geometry)geometriesIntersected.get(i);
|
219 |
}
|
220 |
return result;
|
221 |
}*/
|
222 |
/*public static Geometry[] makeUnion(Geometry[] geometriesToUnion, Geometry[] uningGeometries) {
|
223 |
Geometry[] result = new Geometry[geometriesToUnion.length];
|
224 |
Vector geometriesUned = new Vector();
|
225 |
//Selectable selectable = (Selectable)layerToUnion;
|
226 |
//FBitSet fBitSet = new FBitSet();
|
227 |
for (int i=0;i<geometriesToUnion.length;i++) {
|
228 |
Geometry geometryToUnion = geometriesToUnion[i];
|
229 |
for (int j=0;j<uningGeometries.length;j++) {
|
230 |
Geometry uningGeometry = uningGeometries[j];
|
231 |
if (uningGeometry.intersects(geometryToUnion)) {
|
232 |
//fBitSet.set(i);
|
233 |
geometriesUned.add(geometryToUnion.intersection(uningGeometry));
|
234 |
//geometriesUned.add(geometryToUnion.difference(uningGeometry));
|
235 |
}
|
236 |
}
|
237 |
}
|
238 |
Vector geometriesUned2 = new Vector();
|
239 |
for (int i=0;i<geometriesUned.size();i++) {
|
240 |
geometriesUned2.add(geometriesUned.get(i));
|
241 |
}
|
242 |
int num = geometriesUned.size();
|
243 |
for (int i=0;i<geometriesToUnion.length;i++) {
|
244 |
Geometry geometryToUnion = geometriesToUnion[i];
|
245 |
boolean intersectsWithAnyGeometry = false;
|
246 |
for (int j=0;j<num;j++) {
|
247 |
Geometry geometryUned = (Geometry)geometriesUned.get(j);
|
248 |
if (geometryToUnion.intersects(geometryUned)) intersectsWithAnyGeometry = true;
|
249 |
}
|
250 |
if (intersectsWithAnyGeometry) {
|
251 |
//Geometry difference = geometryToUnion.difference(geometryUned);
|
252 |
//geometriesUned2.add(difference);
|
253 |
} else {
|
254 |
geometriesUned2.add(geometryToUnion);
|
255 |
}
|
256 |
}
|
257 |
for (int i=0;i<uningGeometries.length;i++) {
|
258 |
Geometry uningGeometry = uningGeometries[i];
|
259 |
boolean intersectsWithAnyGeometry = false;
|
260 |
for (int j=0;j<num;j++) {
|
261 |
Geometry geometryUned = (Geometry)geometriesUned.get(j);
|
262 |
if (uningGeometry.intersects(geometryUned)) intersectsWithAnyGeometry = true;
|
263 |
}
|
264 |
if (intersectsWithAnyGeometry) {
|
265 |
//Geometry difference = jtsUningGeometry.difference(jtsGeometryUned);
|
266 |
//jtsGeometriesUned2.add(difference);
|
267 |
} else {
|
268 |
geometriesUned2.add(uningGeometry);
|
269 |
}
|
270 |
}
|
271 |
System.out.println("geometriesUned2.size() = " + geometriesUned2.size());
|
272 |
// Le quito los cachos que ya tengo a los features que faltan
|
273 |
BitSet bitSet1 = new BitSet();
|
274 |
bitSet1.clear();
|
275 |
//int k1=0;
|
276 |
for (int i=0;i<geometriesUned2.size();i++) {
|
277 |
Geometry geometryUned2 = (Geometry)geometriesUned2.get(i);
|
278 |
for (int j=0;j<uningGeometries.length;j++) {
|
279 |
System.out.println("!(uningGeometries[j].equals(geometryUned2)) = " + !(uningGeometries[j].equals(geometryUned2)));
|
280 |
if (uningGeometries[j].intersects(geometryUned2) && !(uningGeometries[j].equals(geometryUned2))) {
|
281 |
uningGeometries[j] = uningGeometries[j].difference(geometryUned2);
|
282 |
//bitSet1.set(k1);
|
283 |
bitSet1.set(j);
|
284 |
}
|
285 |
//k1++;
|
286 |
}
|
287 |
}
|
288 |
// Le quito los cachos que ya tengo a los features que faltan
|
289 |
BitSet bitSet2 = new BitSet();
|
290 |
bitSet2.clear();
|
291 |
int k2=0;
|
292 |
for (int i=0;i<geometriesUned2.size();i++) {
|
293 |
Geometry geometryUned2 = (Geometry)geometriesUned2.get(i);
|
294 |
for (int j=0;j<geometriesToUnion.length;j++) {
|
295 |
System.out.println("!(geometriesToUnion[j].equals(geometryUned2)) = " + !(geometriesToUnion[j].equals(geometryUned2)));
|
296 |
if (geometriesToUnion[j].intersects(geometryUned2) && !(geometriesToUnion[j].equals(geometryUned2))) {
|
297 |
geometriesToUnion[j] = geometriesToUnion[j].difference(geometryUned2);
|
298 |
bitSet2.set(k2);
|
299 |
}
|
300 |
k2++;
|
301 |
}
|
302 |
}
|
303 |
for (int i=0;i<bitSet2.size();i++) {
|
304 |
System.out.println("bitSet2.get(" + i + ") = " + bitSet2.get(i));
|
305 |
}
|
306 |
// Ahora que les he quitado los cachos que ya ten?a, le meto los features que
|
307 |
// faltaban
|
308 |
for (int i=0;i<uningGeometries.length;i++) {
|
309 |
if (bitSet1.get(i)) {
|
310 |
geometriesUned2.add(uningGeometries[i]);
|
311 |
}
|
312 |
}
|
313 |
// Ahora que les he quitado los cachos que ya ten?a, le meto los features que
|
314 |
// faltaban
|
315 |
for (int i=0;i<geometriesToUnion.length;i++) {
|
316 |
if (bitSet2.get(i)) {
|
317 |
geometriesUned2.add(geometriesToUnion[i]);
|
318 |
}
|
319 |
}
|
320 |
//selectable.setSelection(fBitSet);
|
321 |
result = new Geometry[geometriesUned2.size()];
|
322 |
for (int i=0;i<geometriesUned2.size();i++) {
|
323 |
result[i] = (Geometry)geometriesUned2.get(i);
|
324 |
}
|
325 |
return result;
|
326 |
}*/
|
327 |
/*public static Geometry[] makeDissolve() {
|
328 |
Vector geometriesDissolved = new Vector();
|
329 |
for (int i=0;i<geometriesToDissolve.length;i++) {
|
330 |
Geometry geometryToDissolvei = geometriesToDissolve[i];
|
331 |
for (int j=0;j<geometriesToDissolve.length;j++) {
|
332 |
Geometry geometryToDissolvej = geometriesToDissolve[j];
|
333 |
if (i!=j && intersectingGeometry.intersects(geometryToIntersect)) {
|
334 |
geometriesIntersected.add(geometryToIntersect.intersection(intersectingGeometry));
|
335 |
}
|
336 |
}
|
337 |
}
|
338 |
Geometry[] result = new Geometry[geometriesIntersected.size()];
|
339 |
for (int i=0;i<geometriesIntersected.size();i++) {
|
340 |
result[i] = (Geometry)geometriesIntersected.get(i);
|
341 |
}
|
342 |
return result;*/
|
343 |
// Conseguimos las geometr?as
|
344 |
/*IGeometry[] geometries = new IGeometry[0];
|
345 |
Selectable inputSelectable = (Selectable)input;
|
346 |
SingleLayer inputLayer = (SingleLayer)input;
|
347 |
VectorialAdapter inputLayerVectorialAdapter = inputLayer.getSource();
|
348 |
try {
|
349 |
geometries = new IGeometry[inputLayerVectorialAdapter.getShapeCount()];
|
350 |
for (int i=0;i<inputLayerVectorialAdapter.getShapeCount();i++) {
|
351 |
geometries[i] = (IGeometry)inputLayerVectorialAdapter.getShape(i);
|
352 |
}
|
353 |
} catch (DriverIOException e1) {
|
354 |
// TODO Auto-generated catch block
|
355 |
e1.printStackTrace();
|
356 |
}
|
357 |
// Convertimos a JTS
|
358 |
Geometry[] jtsGeometries = new Geometry[geometries.length];
|
359 |
System.out.println("geometries.length = " + geometries.length);
|
360 |
for (int i=0;i<geometries.length;i++) {
|
361 |
IGeometry geometry = geometries[i];
|
362 |
jtsGeometries[i] = geometry.toJTSGeometry();
|
363 |
}
|
364 |
//
|
365 |
Vector resultGeometries = new Vector();
|
366 |
AlphanumericData lyr = (AlphanumericData)input;
|
367 |
DataSource ds;
|
368 |
try {
|
369 |
ds = lyr.getRecordset();
|
370 |
int fieldId = ds.getFieldIndexByName(fieldSelectedString);
|
371 |
Value[] fieldValues = new Value[(int)ds.getRowCount()];
|
372 |
int j = 0;
|
373 |
for (int i=0;i<ds.getRowCount();i++) {
|
374 |
fieldValues[i] = ds.getFieldValue(i, fieldId);
|
375 |
}
|
376 |
for (int i=0;i<fieldValues.length;i++) {
|
377 |
Value valuei = fieldValues[i];
|
378 |
IGeometry geometryi = geometries[i];
|
379 |
Geometry jtsGeometryi = geometryi.toJTSGeometry();
|
380 |
for (j=0;j<ds.getRowCount();j++) {
|
381 |
if (j!=i) {
|
382 |
Value valuej = ds.getFieldValue(j, fieldId);
|
383 |
if (((BooleanValue)(valuej.equals(valuei))).getValue()) {
|
384 |
IGeometry geometryj = geometries[j];
|
385 |
Geometry jtsGeometryj = geometryj.toJTSGeometry();
|
386 |
if (jtsGeometryj.intersection(jtsGeometryi) instanceof LineString ||
|
387 |
jtsGeometryj.intersection(jtsGeometryi) instanceof LinearRing) {
|
388 |
Geometry jtsUnion = jtsGeometryj.union(jtsGeometryi);
|
389 |
FPolygon2D union = (FPolygon2D)FConverter.jts_to_java2d(jtsUnion);
|
390 |
resultGeometries.add(ShapeFactory.createGeometry(union));
|
391 |
}
|
392 |
}
|
393 |
}
|
394 |
}
|
395 |
}
|
396 |
} catch (DriverException e) {
|
397 |
// TODO Auto-generated catch block
|
398 |
e.printStackTrace();
|
399 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
400 |
// TODO Auto-generated catch block
|
401 |
e.printStackTrace();
|
402 |
} catch (IncompatibleTypesException e) {
|
403 |
// TODO Auto-generated catch block
|
404 |
e.printStackTrace();
|
405 |
}
|
406 |
IGeometry[] result = new IGeometry[resultGeometries.size()];
|
407 |
for (int i=0;i<resultGeometries.size();i++) {
|
408 |
result[i] = (IGeometry)resultGeometries.get(i);
|
409 |
}
|
410 |
return result;*/
|
411 |
//}
|
412 |
/*public static IGeometry[] makeMerge(FLayer[] inputLayers, FLayer fixedLayer) {
|
413 |
int geometryCount = 0;
|
414 |
for (int i=0;i<inputLayers.length;i++) {
|
415 |
VectorialAdapter inputLayerVectorialAdapter = ((SingleLayer)inputLayers[i]).getSource();
|
416 |
try {
|
417 |
geometryCount = geometryCount + inputLayerVectorialAdapter.getShapeCount();
|
418 |
} catch (DriverIOException e) {
|
419 |
// TODO Auto-generated catch block
|
420 |
e.printStackTrace();
|
421 |
}
|
422 |
}
|
423 |
IGeometry[] geometries = new IGeometry[geometryCount];
|
424 |
int k=0;
|
425 |
for (int i=0;i<inputLayers.length;i++) {
|
426 |
VectorialAdapter inputLayerVectorialAdapter = ((SingleLayer)inputLayers[i]).getSource();
|
427 |
try {
|
428 |
for (int j=0;j<inputLayerVectorialAdapter.getShapeCount();j++) {
|
429 |
geometries[k] = inputLayerVectorialAdapter.getShape(j);
|
430 |
k++;
|
431 |
}
|
432 |
} catch (DriverIOException e) {
|
433 |
// TODO Auto-generated catch block
|
434 |
e.printStackTrace();
|
435 |
}
|
436 |
}
|
437 |
return geometries;
|
438 |
}*/
|
439 |
/*public static IGeometry[] makeSpatialJoin(FLayer layerToSJ, FLayer SJLayer) {
|
440 |
VectorialAdapter inputLayerVectorialAdapter = ((SingleLayer)layerToSJ).getSource();
|
441 |
int geometryCount=0;
|
442 |
IGeometry[] geometries = null;
|
443 |
try {
|
444 |
geometryCount = inputLayerVectorialAdapter.getShapeCount();
|
445 |
geometries = new IGeometry[geometryCount];
|
446 |
for (int j=0;j<inputLayerVectorialAdapter.getShapeCount();j++) {
|
447 |
geometries[j] = inputLayerVectorialAdapter.getShape(j);
|
448 |
}
|
449 |
} catch (DriverIOException e) {
|
450 |
// TODO Auto-generated catch block
|
451 |
e.printStackTrace();
|
452 |
}
|
453 |
return geometries;
|
454 |
}*/
|
455 |
/*private static FPolygon2D points2DToFPolygon2D(Point2D[] pts) {
|
456 |
GeneralPathX genPathX = new GeneralPathX();
|
457 |
genPathX.moveTo(pts[0].getX(), pts[0].getY());
|
458 |
for (int i=1; i<pts.length; i++) {
|
459 |
genPathX.lineTo(pts[i].getX(), pts[i].getY());
|
460 |
}
|
461 |
genPathX.closePath();
|
462 |
return new FPolygon2D(genPathX);
|
463 |
}*/
|
464 |
} |