Revision 40387
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/impl/SpatialIndexJTS.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.geom.impl; |
2 | 2 |
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Collection; |
|
3 | 5 |
import java.util.Iterator; |
4 | 6 |
import java.util.List; |
5 | 7 |
|
8 |
import org.gvsig.fmap.geom.Geometry; |
|
6 | 9 |
import org.gvsig.fmap.geom.SpatialIndex; |
10 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
7 | 11 |
import org.gvsig.fmap.geom.util.Converter; |
8 | 12 |
import org.gvsig.tools.visitor.Visitor; |
9 | 13 |
|
... | ... | |
102 | 106 |
index = new com.vividsolutions.jts.index.quadtree.Quadtree(); |
103 | 107 |
} |
104 | 108 |
|
109 |
public List queryAsList(Envelope envelope) { |
|
110 |
return IteratorToList( query(envelope) ); |
|
111 |
} |
|
112 |
|
|
113 |
public List queryAsList(Geometry geom) { |
|
114 |
return IteratorToList( query(geom) ); |
|
115 |
} |
|
116 |
|
|
117 |
public List queryAllAsList() { |
|
118 |
return IteratorToList( queryAll() ); |
|
119 |
} |
|
120 |
|
|
121 |
private List IteratorToList(Iterator it) { |
|
122 |
List l = new ArrayList(); |
|
123 |
while( it.hasNext() ) { |
|
124 |
l.add(it.next()); |
|
125 |
} |
|
126 |
return l; |
|
127 |
} |
|
105 | 128 |
} |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/SpatialIndex.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.geom; |
2 | 2 |
|
3 | 3 |
import java.util.Iterator; |
4 |
import java.util.List; |
|
4 | 5 |
|
5 | 6 |
import org.gvsig.fmap.geom.primitive.Envelope; |
6 | 7 |
import org.gvsig.tools.visitor.Visitor; |
... | ... | |
11 | 12 |
public Iterator query(Envelope envelope); |
12 | 13 |
public Iterator query(Geometry geom); |
13 | 14 |
public Iterator queryAll(); |
15 |
public List queryAsList(Envelope envelope); |
|
16 |
public List queryAsList(Geometry geom); |
|
17 |
public List queryAllAsList(); |
|
14 | 18 |
public void insert(Geometry geom); |
15 | 19 |
public void insert(Geometry geom, Object data); |
16 | 20 |
public void insert(Envelope envelope, Object data); |
Also available in: Unified diff