提交 2a106bae authored 作者: Sven Schrader's avatar Sven Schrader

added bounding box to null spatial keys

上级 2347709f
......@@ -213,7 +213,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
private SpatialKey getKey(SearchRow row) {
Value v = row.getValue(columnIds[0]);
if (v == ValueNull.INSTANCE) {
return new SpatialKey(row.getKey());
return new SpatialKey(row.getKey(),0,0,0,0);
}
Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
Envelope env = g.getEnvelopeInternal();
......
......@@ -243,22 +243,7 @@ public class SpatialDataType implements DataType {
public boolean contains(Object objA, Object objB) {
SpatialKey a = (SpatialKey) objA;
SpatialKey b = (SpatialKey) objB;
// if objB (the searched key) is a null spatial key, it is considered to
// be "contained everywhere". This means it will be
// always added/get/removed/set in the first searched node of the RTree
// (so usually at index 0).
// Thus, with many null-keys, the R-Tree will have a bias to the right,
// which could have an impact on performance.
//
// Otherwise, if objA (the key in which the search is performed) is a
// null spatial key, it is considered to never contain a
// not-null spatial key.
if (b.isNull()) {
return true;
}
else if (a.isNull()){
if (a.isNull() || b.isNull()) {
return false;
}
for (int i = 0; i < dimensions; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论