提交 0dae0b0b authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting.

上级 73a69194
......@@ -3,7 +3,7 @@
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*
*
* Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* Support for the operator "&&" as an alias for SPATIAL_INTERSECTS
*/
......@@ -149,7 +149,7 @@ import org.h2.value.ValueTimestamp;
/**
* The parser is used to convert a SQL statement string to an command object.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
......@@ -22,7 +22,7 @@ import org.h2.value.ValueNull;
/**
* Example comparison expressions are ID=1, NAME=NAME, NAME IS NULL.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......@@ -329,7 +329,7 @@ public class Comparison extends Condition {
int type = getNotCompareType();
return new Comparison(session, type, left, right);
}
private int getNotCompareType() {
switch (compareType) {
case EQUAL:
......
......@@ -29,7 +29,7 @@ import org.h2.value.Value;
* A index condition object is made for each condition that can potentially use
* an index. This class does not extend expression, but in general there is one
* expression that maps to each index condition.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
......@@ -26,7 +26,7 @@ import org.h2.value.ValueNull;
/**
* The filter used to walk through an index. This class supports IN(..)
* and IN(SELECT ...) optimizations.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......@@ -182,7 +182,9 @@ public class IndexCursor implements Cursor {
if (row == null) {
row = table.getTemplateRow();
} else if (row.getValue(columnId) != null) {
// the union of the two envelopes
// if an object needs to overlap with both a and b,
// then it needs to overlap with the the union of a and b
// (not the intersection)
ValueGeometry vg = (ValueGeometry) row.getValue(columnId).convertTo(Value.GEOMETRY);
v = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getEnvelopeUnion(vg);
}
......
......@@ -35,7 +35,7 @@ import com.vividsolutions.jts.geom.Geometry;
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
*/
public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
private static final String MAP_PREFIX = "RTREE_";
private final MVRTreeMap<Long> treeMap;
......@@ -45,10 +45,10 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
private boolean closed;
private boolean needRebuild;
private boolean persistent;
/**
* Constructor.
*
*
* @param table the table instance
* @param id the index id
* @param indexName the index name
......@@ -127,13 +127,13 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
}
treeMap.add(getEnvelope(row), row.getKey());
}
private SpatialKey getEnvelope(SearchRow row) {
Value v = row.getValue(columnIds[0]);
Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometry();
Envelope env = g.getEnvelopeInternal();
return new SpatialKey(row.getKey(),
(float) env.getMinX(), (float) env.getMaxX(),
return new SpatialKey(row.getKey(),
(float) env.getMinX(), (float) env.getMaxX(),
(float) env.getMinY(), (float) env.getMaxY());
}
......@@ -160,7 +160,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
private Cursor find(Session session) {
return new SpatialCursor(treeMap.keySet().iterator(), tableData, session);
}
@Override
public Cursor findByGeometry(TableFilter filter, SearchRow intersection) {
if (intersection == null) {
......@@ -250,7 +250,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
* A cursor to iterate over spatial keys.
*/
private static final class SpatialCursor implements Cursor {
private final Iterator<SpatialKey> it;
private SpatialKey current;
private final RegularTable tableData;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论