svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / SpatialCache.java @ 5226
History | View | Annotate | Download (937 Bytes)
1 |
package com.iver.cit.gvsig.fmap.layers; |
---|---|
2 |
|
3 |
import java.awt.geom.Rectangle2D; |
4 |
|
5 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
6 |
import com.iver.cit.gvsig.fmap.core.v02.FConverter; |
7 |
import com.vividsolutions.jts.geom.Envelope; |
8 |
import com.vividsolutions.jts.index.ItemVisitor; |
9 |
import com.vividsolutions.jts.index.quadtree.Quadtree; |
10 |
|
11 |
public class SpatialCache extends Quadtree { |
12 |
int maxFeatures = 1000; // Por defecto, pero se puede cambiar |
13 |
|
14 |
public int getMaxFeatures() { |
15 |
return maxFeatures;
|
16 |
} |
17 |
|
18 |
public void setMaxFeatures(int maxFeatures) { |
19 |
this.maxFeatures = maxFeatures;
|
20 |
} |
21 |
|
22 |
/**
|
23 |
* M?todo de conveniencia
|
24 |
*
|
25 |
* @param r
|
26 |
* @param igeometry
|
27 |
*/
|
28 |
public synchronized void insert(Rectangle2D bounds, IGeometry geom) { |
29 |
Envelope env = FConverter.convertRectangle2DtoEnvelope(bounds); |
30 |
this.insert(env, geom);
|
31 |
} |
32 |
|
33 |
public synchronized void query(Envelope searchEnv, ItemVisitor visitor) |
34 |
{ |
35 |
super.query(searchEnv, visitor);
|
36 |
} |
37 |
|
38 |
|
39 |
} |