本文整理汇总了Java中com.vividsolutions.jts.index.ItemVisitor类的典型用法代码示例。如果您正苦于以下问题:Java ItemVisitor类的具体用法?Java ItemVisitor怎么用?Java ItemVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemVisitor类属于com.vividsolutions.jts.index包,在下文中一共展示了ItemVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
private void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) {
List childBoundables = node.getChildBoundables();
for (Object childBoundable1 : childBoundables) {
Boundable childBoundable = (Boundable) childBoundable1;
if (!this.getIntersectsOp().intersects(childBoundable.getBounds(), searchBounds)) {
continue;
}
if (childBoundable instanceof AbstractNode) {
this.query(searchBounds, (AbstractNode) childBoundable, visitor);
} else if (childBoundable instanceof ItemBoundable) {
visitor.visitItem(((ItemBoundable) childBoundable).getItem());
} else {
Assert.shouldNeverReachHere();
}
}
}
示例2: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
private void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) {
List childBoundables = node.getChildBoundables();
for (int i = 0; i < childBoundables.size(); i++) {
Boundable childBoundable = (Boundable) childBoundables.get(i);
if (!getIntersectsOp().intersects(childBoundable.getBounds(), searchBounds)) {
continue;
}
if (childBoundable instanceof AbstractNode) {
query(searchBounds, (AbstractNode) childBoundable, visitor);
} else if (childBoundable instanceof ItemBoundable) {
visitor.visitItem(((ItemBoundable) childBoundable).getItem());
} else {
Assert.shouldNeverReachHere();
}
}
}
示例3: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
private void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) {
List childBoundables = node.getChildBoundables();
for (int i = 0; i < childBoundables.size(); i++) {
Boundable childBoundable = (Boundable) childBoundables.get(i);
if (! getIntersectsOp().intersects(childBoundable.getBounds(), searchBounds)) {
continue;
}
if (childBoundable instanceof AbstractNode) {
query(searchBounds, (AbstractNode) childBoundable, visitor);
}
else if (childBoundable instanceof ItemBoundable) {
visitor.visitItem(((ItemBoundable)childBoundable).getItem());
}
else {
Assert.shouldNeverReachHere();
}
}
}
示例4: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
@Override
public void query(double queryMin, double queryMax, ItemVisitor visitor) {
if (!this.intersects(queryMin, queryMax)) {
return;
}
visitor.visitItem(this.item);
}
示例5: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
@Override
public void query(double queryMin, double queryMax, ItemVisitor visitor) {
if (!this.intersects(queryMin, queryMax)) {
// System.out.println("Does NOT Overlap branch: " + this);
return;
}
// System.out.println("Overlaps branch: " + this);
if (this.node1 != null) {
this.node1.query(queryMin, queryMax, visitor);
}
if (this.node2 != null) {
this.node2.query(queryMin, queryMax, visitor);
}
}
示例6: visit
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
public void visit(Envelope searchEnv, ItemVisitor visitor) {
if (!this.isSearchMatch(searchEnv)) {
return;
}
// this node may have items as well as subnodes (since items may not
// be wholely contained in any single subnode
this.visitItems(searchEnv, visitor);
for (int i = 0; i < 4; i++) {
if (this.subnode[i] != null) {
this.subnode[i].visit(searchEnv, visitor);
}
}
}
示例7: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
/**
* Returns items whose bounds intersect the given envelope.
*/
@Override
public void query(Envelope searchEnv, ItemVisitor visitor) {
//Yes this method does something. It specifies that the bounds is an
//Envelope. super.query takes an Object, not an Envelope. [Jon Aquino 10/24/2003]
super.query(searchEnv, visitor);
}
示例8: getData
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
public Cancelable getData(final Envelope envelope,
final GetDataCallback callback, boolean forceUpdate) {
return awaitData(new DataCallback() {
@Override
public void onDataReceived() {
final List<SpatialEntity2<? extends Geometry>> resultList = new ArrayList<SpatialEntity2<? extends Geometry>>();
synchronized (mEntityIndex) {
mEntityIndex.query(envelope, new ItemVisitor() {
@Override
public void visitItem(Object item) {
@SuppressWarnings("unchecked")
SpatialEntity2<? extends Geometry> entity = (SpatialEntity2<? extends Geometry>) item;
if (envelope.intersects(entity.getEnvelope())) {
resultList.add(entity);
}
}
});
}
callback.onReceiveMeasurements(resultList);
}
@Override
public void onAbort(DataSourceErrorType reason) {
callback.onAbort(reason);
}
}, forceUpdate);
}
示例9: snap
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
/**
* Snaps (nodes) all interacting segments to this hot pixel.
* The hot pixel may represent a vertex of an edge,
* in which case this routine uses the optimization
* of not noding the vertex itself
*
* @param hotPixel the hot pixel to snap to
* @param parentEdge the edge containing the vertex, if applicable, or <code>null</code>
* @param hotPixelVertexIndex the index of the hotPixel vertex, if applicable, or -1
* @return <code>true</code> if a node was added for this pixel
*/
public boolean snap(HotPixel hotPixel, SegmentString parentEdge, int hotPixelVertexIndex) {
final Envelope pixelEnv = hotPixel.getSafeEnvelope();
final HotPixelSnapAction hotPixelSnapAction = new HotPixelSnapAction(hotPixel, parentEdge, hotPixelVertexIndex);
index.query(pixelEnv, new ItemVisitor() {
public void visitItem(Object item) {
MonotoneChain testChain = (MonotoneChain) item;
testChain.select(pixelEnv, hotPixelSnapAction);
}
}
);
return hotPixelSnapAction.isNodeAdded();
}
示例10: query
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
public void query(double queryMin, double queryMax, ItemVisitor visitor) {
if (!intersects(queryMin, queryMax)) {
// System.out.println("Does NOT Overlap branch: " + this);
return;
}
// System.out.println("Overlaps branch: " + this);
if (node1 != null) node1.query(queryMin, queryMax, visitor);
if (node2 != null) node2.query(queryMin, queryMax, visitor);
}
示例11: visit
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
public void visit(Envelope searchEnv, ItemVisitor visitor) {
if (!isSearchMatch(searchEnv))
return;
// this node may have items as well as subnodes (since items may not
// be wholely contained in any single subnode
visitItems(searchEnv, visitor);
for (int i = 0; i < 4; i++) {
if (subnode[i] != null) {
subnode[i].visit(searchEnv, visitor);
}
}
}
示例12: intersectingFeatures
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
/** */
public List<VectorFeature> intersectingFeatures (Geometry geom) {
final PreparedGeometry pGeom = PreparedGeometryFactory.prepare(geom);
final List<VectorFeature> result = new ArrayList<VectorFeature>();
_spatialIndex.query(geom.getEnvelopeInternal(), new ItemVisitor() {
public void visitItem (Object item) {
VectorFeature feature = (VectorFeature)item;
if (pGeom.intersects(feature.getGeometry())) {
result.add(feature);
}
}
});
return result;
}
示例13: visit
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
public void visit(Envelope searchEnv, ItemVisitor visitor)
{
if (! isSearchMatch(searchEnv))
return;
// this node may have items as well as subnodes (since items may not
// be wholely contained in any single subnode
visitItems(searchEnv, visitor);
for (int i = 0; i < 4; i++) {
if (subnode[i] != null) {
subnode[i].visit(searchEnv, visitor);
}
}
}
示例14: visitItems
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
private void visitItems(Envelope searchEnv, ItemVisitor visitor)
{
// would be nice to filter items based on search envelope, but can't until they contain an envelope
for (Iterator i = items.iterator(); i.hasNext(); ) {
visitor.visitItem(i.next());
}
}
示例15: snap
import com.vividsolutions.jts.index.ItemVisitor; //导入依赖的package包/类
/**
* Snaps (nodes) all interacting segments to this hot pixel.
* The hot pixel may represent a vertex of an edge,
* in which case this routine uses the optimization
* of not noding the vertex itself
*
* @param hotPixel the hot pixel to snap to
* @param parentEdge the edge containing the vertex, if applicable, or <code>null</code>
* @param hotPixelVertexIndex the index of the hotPixel vertex, if applicable, or -1
* @return <code>true</code> if a node was added for this pixel
*/
public boolean snap(HotPixel hotPixel, SegmentString parentEdge, int hotPixelVertexIndex)
{
final Envelope pixelEnv = hotPixel.getSafeEnvelope();
final HotPixelSnapAction hotPixelSnapAction = new HotPixelSnapAction(hotPixel, parentEdge, hotPixelVertexIndex);
index.query(pixelEnv, new ItemVisitor() {
public void visitItem(Object item) {
MonotoneChain testChain = (MonotoneChain) item;
testChain.select(pixelEnv, hotPixelSnapAction);
}
}
);
return hotPixelSnapAction.isNodeAdded();
}