You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2015/08/13 00:34:06 UTC
svn commit: r1695616 - in
/lucene/dev/branches/lucene6699/lucene/spatial3d/src:
java/org/apache/lucene/bkdtree3d/ resources/META-INF/services/
test/org/apache/lucene/bkdtree3d/
Author: mikemccand
Date: Wed Aug 12 22:34:05 2015
New Revision: 1695616
URL: http://svn.apache.org/r1695616
Log:
LUCENE-6699: fix more names
Added:
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DBinaryDocValues.java
- copied, changed from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeBinaryDocValues.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesConsumer.java
- copied, changed from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesConsumer.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesFormat.java
- copied, changed from r1695494, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesFormat.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesProducer.java
- copied, changed from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesProducer.java
Removed:
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeBinaryDocValues.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesConsumer.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesFormat.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesProducer.java
Modified:
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DPointField.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/PointInGeo3DShapeQuery.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat
lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java
Copied: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DBinaryDocValues.java (from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeBinaryDocValues.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DBinaryDocValues.java?p2=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DBinaryDocValues.java&p1=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeBinaryDocValues.java&r1=1695370&r2=1695616&rev=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeBinaryDocValues.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DBinaryDocValues.java Wed Aug 12 22:34:05 2015
@@ -20,11 +20,11 @@ package org.apache.lucene.bkdtree3d;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.util.BytesRef;
-class BKD3DTreeBinaryDocValues extends BinaryDocValues {
+class Geo3DBinaryDocValues extends BinaryDocValues {
final BKD3DTreeReader bkdTreeReader;
final BinaryDocValues delegate;
- public BKD3DTreeBinaryDocValues(BKD3DTreeReader bkdTreeReader, BinaryDocValues delegate) {
+ public Geo3DBinaryDocValues(BKD3DTreeReader bkdTreeReader, BinaryDocValues delegate) {
this.bkdTreeReader = bkdTreeReader;
this.delegate = delegate;
}
Copied: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesConsumer.java (from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesConsumer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesConsumer.java?p2=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesConsumer.java&p1=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesConsumer.java&r1=1695370&r2=1695616&rev=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesConsumer.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesConsumer.java Wed Aug 12 22:34:05 2015
@@ -32,7 +32,7 @@ import org.apache.lucene.store.IndexOutp
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
-class BKD3DTreeDocValuesConsumer extends DocValuesConsumer implements Closeable {
+class Geo3DDocValuesConsumer extends DocValuesConsumer implements Closeable {
final DocValuesConsumer delegate;
final int maxPointsInLeafNode;
final int maxPointsSortInHeap;
@@ -40,15 +40,15 @@ class BKD3DTreeDocValuesConsumer extends
final Map<Integer,Long> fieldIndexFPs = new HashMap<>();
final SegmentWriteState state;
- public BKD3DTreeDocValuesConsumer(DocValuesConsumer delegate, SegmentWriteState state, int maxPointsInLeafNode, int maxPointsSortInHeap) throws IOException {
+ public Geo3DDocValuesConsumer(DocValuesConsumer delegate, SegmentWriteState state, int maxPointsInLeafNode, int maxPointsSortInHeap) throws IOException {
BKD3DTreeWriter.verifyParams(maxPointsInLeafNode, maxPointsSortInHeap);
this.delegate = delegate;
this.maxPointsInLeafNode = maxPointsInLeafNode;
this.maxPointsSortInHeap = maxPointsSortInHeap;
this.state = state;
- String datFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, BKD3DTreeDocValuesFormat.DATA_EXTENSION);
+ String datFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, Geo3DDocValuesFormat.DATA_EXTENSION);
out = state.directory.createOutput(datFileName, state.context);
- CodecUtil.writeIndexHeader(out, BKD3DTreeDocValuesFormat.DATA_CODEC_NAME, BKD3DTreeDocValuesFormat.DATA_VERSION_CURRENT,
+ CodecUtil.writeIndexHeader(out, Geo3DDocValuesFormat.DATA_CODEC_NAME, Geo3DDocValuesFormat.DATA_VERSION_CURRENT,
state.segmentInfo.getId(), state.segmentSuffix);
}
@@ -66,11 +66,11 @@ class BKD3DTreeDocValuesConsumer extends
}
}
- String metaFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, BKD3DTreeDocValuesFormat.META_EXTENSION);
+ String metaFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, Geo3DDocValuesFormat.META_EXTENSION);
IndexOutput metaOut = state.directory.createOutput(metaFileName, state.context);
success = false;
try {
- CodecUtil.writeIndexHeader(metaOut, BKD3DTreeDocValuesFormat.META_CODEC_NAME, BKD3DTreeDocValuesFormat.META_VERSION_CURRENT,
+ CodecUtil.writeIndexHeader(metaOut, Geo3DDocValuesFormat.META_CODEC_NAME, Geo3DDocValuesFormat.META_VERSION_CURRENT,
state.segmentInfo.getId(), state.segmentSuffix);
metaOut.writeVInt(fieldIndexFPs.size());
for(Map.Entry<Integer,Long> ent : fieldIndexFPs.entrySet()) {
@@ -109,9 +109,9 @@ class BKD3DTreeDocValuesConsumer extends
// nocommit what about multi-valued?
// 3 ints packed into byte[]
assert value.length == 12;
- int x = BKD3DTreeDocValuesFormat.readInt(value.bytes, value.offset);
- int y = BKD3DTreeDocValuesFormat.readInt(value.bytes, value.offset+4);
- int z = BKD3DTreeDocValuesFormat.readInt(value.bytes, value.offset+8);
+ int x = Geo3DDocValuesFormat.readInt(value.bytes, value.offset);
+ int y = Geo3DDocValuesFormat.readInt(value.bytes, value.offset+4);
+ int z = Geo3DDocValuesFormat.readInt(value.bytes, value.offset+8);
writer.add(x, y, z, docID);
}
Copied: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesFormat.java (from r1695494, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesFormat.java?p2=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesFormat.java&p1=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesFormat.java&r1=1695494&r2=1695616&rev=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesFormat.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesFormat.java Wed Aug 12 22:34:05 2015
@@ -28,8 +28,8 @@ import org.apache.lucene.index.SegmentWr
/**
* A {@link DocValuesFormat} to efficiently index geo-spatial 3D x,y,z points
- * from {@link BKD3DPointField} for fast shape intersection queries using
- * ({@code BKD3DShapeQuery}) // nocommit use link here
+ * from {@link Geo3DPointField} for fast shape intersection queries using
+ * ({@link PointInGeo3DShapeQuery})
*
* <p>This wraps {@link Lucene50DocValuesFormat}, but saves its own BKD tree
* structures to disk for fast query-time intersection. See <a
@@ -61,19 +61,17 @@ import org.apache.lucene.index.SegmentWr
*
* @lucene.experimental */
-// nocommit rename to Geo3DDVF
+public class Geo3DDocValuesFormat extends DocValuesFormat {
-public class BKD3DTreeDocValuesFormat extends DocValuesFormat {
-
- static final String DATA_CODEC_NAME = "BKD3DData";
+ static final String DATA_CODEC_NAME = "Geo3DData";
static final int DATA_VERSION_START = 0;
static final int DATA_VERSION_CURRENT = DATA_VERSION_START;
- static final String DATA_EXTENSION = "kd3d";
+ static final String DATA_EXTENSION = "g3dd";
- static final String META_CODEC_NAME = "BKD3DMeta";
+ static final String META_CODEC_NAME = "Geo3DMeta";
static final int META_VERSION_START = 0;
static final int META_VERSION_CURRENT = META_VERSION_START;
- static final String META_EXTENSION = "kd3m";
+ static final String META_EXTENSION = "g3dm";
private final int maxPointsInLeafNode;
private final int maxPointsSortInHeap;
@@ -81,7 +79,7 @@ public class BKD3DTreeDocValuesFormat ex
private final DocValuesFormat delegate = new Lucene50DocValuesFormat();
/** Default constructor */
- public BKD3DTreeDocValuesFormat() {
+ public Geo3DDocValuesFormat() {
this(BKD3DTreeWriter.DEFAULT_MAX_POINTS_IN_LEAF_NODE, BKD3DTreeWriter.DEFAULT_MAX_POINTS_SORT_IN_HEAP);
}
@@ -93,7 +91,7 @@ public class BKD3DTreeDocValuesFormat ex
* offline sort is used. The default is 128 * 1024.
*
* @lucene.experimental */
- public BKD3DTreeDocValuesFormat(int maxPointsInLeafNode, int maxPointsSortInHeap) {
+ public Geo3DDocValuesFormat(int maxPointsInLeafNode, int maxPointsSortInHeap) {
super("BKD3DTree");
BKD3DTreeWriter.verifyParams(maxPointsInLeafNode, maxPointsSortInHeap);
this.maxPointsInLeafNode = maxPointsInLeafNode;
@@ -102,12 +100,12 @@ public class BKD3DTreeDocValuesFormat ex
@Override
public DocValuesConsumer fieldsConsumer(final SegmentWriteState state) throws IOException {
- return new BKD3DTreeDocValuesConsumer(delegate.fieldsConsumer(state), state, maxPointsInLeafNode, maxPointsSortInHeap);
+ return new Geo3DDocValuesConsumer(delegate.fieldsConsumer(state), state, maxPointsInLeafNode, maxPointsSortInHeap);
}
@Override
public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException {
- return new BKD3DTreeDocValuesProducer(delegate.fieldsProducer(state), state);
+ return new Geo3DDocValuesProducer(delegate.fieldsProducer(state), state);
}
// nocommit is this ok? PlanetModel.WGS84 seems to have max 1.0011188180710464 ?
Copied: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesProducer.java (from r1695370, lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesProducer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesProducer.java?p2=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesProducer.java&p1=lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesProducer.java&r1=1695370&r2=1695616&rev=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeDocValuesProducer.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DDocValuesProducer.java Wed Aug 12 22:34:05 2015
@@ -43,7 +43,7 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.RamUsageEstimator;
-class BKD3DTreeDocValuesProducer extends DocValuesProducer {
+class Geo3DDocValuesProducer extends DocValuesProducer {
private final Map<String,BKD3DTreeReader> treeReaders = new HashMap<>();
private final Map<Integer,Long> fieldToIndexFPs = new HashMap<>();
@@ -54,10 +54,10 @@ class BKD3DTreeDocValuesProducer extends
private final DocValuesProducer delegate;
private final boolean merging;
- public BKD3DTreeDocValuesProducer(DocValuesProducer delegate, SegmentReadState state) throws IOException {
- String metaFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, BKD3DTreeDocValuesFormat.META_EXTENSION);
+ public Geo3DDocValuesProducer(DocValuesProducer delegate, SegmentReadState state) throws IOException {
+ String metaFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, Geo3DDocValuesFormat.META_EXTENSION);
ChecksumIndexInput metaIn = state.directory.openChecksumInput(metaFileName, state.context);
- CodecUtil.checkIndexHeader(metaIn, BKD3DTreeDocValuesFormat.META_CODEC_NAME, BKD3DTreeDocValuesFormat.META_VERSION_START, BKD3DTreeDocValuesFormat.META_VERSION_CURRENT,
+ CodecUtil.checkIndexHeader(metaIn, Geo3DDocValuesFormat.META_CODEC_NAME, Geo3DDocValuesFormat.META_VERSION_START, Geo3DDocValuesFormat.META_VERSION_CURRENT,
state.segmentInfo.getId(), state.segmentSuffix);
int fieldCount = metaIn.readVInt();
for(int i=0;i<fieldCount;i++) {
@@ -68,9 +68,9 @@ class BKD3DTreeDocValuesProducer extends
CodecUtil.checkFooter(metaIn);
metaIn.close();
- String datFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, BKD3DTreeDocValuesFormat.DATA_EXTENSION);
+ String datFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, Geo3DDocValuesFormat.DATA_EXTENSION);
datIn = state.directory.openInput(datFileName, state.context);
- CodecUtil.checkIndexHeader(datIn, BKD3DTreeDocValuesFormat.DATA_CODEC_NAME, BKD3DTreeDocValuesFormat.DATA_VERSION_START, BKD3DTreeDocValuesFormat.DATA_VERSION_CURRENT,
+ CodecUtil.checkIndexHeader(datIn, Geo3DDocValuesFormat.DATA_CODEC_NAME, Geo3DDocValuesFormat.DATA_VERSION_START, Geo3DDocValuesFormat.DATA_VERSION_CURRENT,
state.segmentInfo.getId(), state.segmentSuffix);
ramBytesUsed = new AtomicLong(RamUsageEstimator.shallowSizeOfInstance(getClass()));
maxDoc = state.segmentInfo.maxDoc();
@@ -78,8 +78,8 @@ class BKD3DTreeDocValuesProducer extends
merging = false;
}
- // clone for merge: we don't hang onto the BKD3DTrees we load
- BKD3DTreeDocValuesProducer(BKD3DTreeDocValuesProducer orig) throws IOException {
+ // clone for merge: we don't hang onto the Geo3Ds we load
+ Geo3DDocValuesProducer(Geo3DDocValuesProducer orig) throws IOException {
assert Thread.holdsLock(orig);
datIn = orig.datIn.clone();
ramBytesUsed = new AtomicLong(orig.ramBytesUsed.get());
@@ -129,7 +129,7 @@ class BKD3DTreeDocValuesProducer extends
}
}
- return new BKD3DTreeBinaryDocValues(treeReader, delegate.getBinary(field));
+ return new Geo3DBinaryDocValues(treeReader, delegate.getBinary(field));
}
@Override
@@ -160,7 +160,7 @@ class BKD3DTreeDocValuesProducer extends
@Override
public synchronized DocValuesProducer getMergeInstance() throws IOException {
- return new BKD3DTreeDocValuesProducer(this);
+ return new Geo3DDocValuesProducer(this);
}
@Override
Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DPointField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DPointField.java?rev=1695616&r1=1695615&r2=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DPointField.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/Geo3DPointField.java Wed Aug 12 22:34:05 2015
@@ -24,11 +24,11 @@ import org.apache.lucene.document.FieldT
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.util.BytesRef;
-// nocommit rename to Geo3DPointField?
-
// nocommit what about multi-valued?
-/** Add this to a document to index lat/lon point, but be sure to use {@link BKD3DTreeDocValuesFormat} for the field. */
+/** Add this to a document to index lat/lon point, but be sure to use {@link Geo3DDocValuesFormat} for the field.
+
+ * @lucene.experimental */
public final class Geo3DPointField extends Field {
public static final FieldType TYPE = new FieldType();
@@ -48,9 +48,9 @@ public final class Geo3DPointField exten
super(name, TYPE);
final GeoPoint point = new GeoPoint(planetModel, lat, lon);
byte[] bytes = new byte[12];
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(point.x), bytes, 0);
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(point.y), bytes, 4);
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(point.z), bytes, 8);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(point.x), bytes, 0);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(point.y), bytes, 4);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(point.z), bytes, 8);
fieldsData = new BytesRef(bytes);
}
@@ -62,9 +62,9 @@ public final class Geo3DPointField exten
public Geo3DPointField(String name, double x, double y, double z) {
super(name, TYPE);
byte[] bytes = new byte[12];
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(x), bytes, 0);
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(y), bytes, 4);
- BKD3DTreeDocValuesFormat.writeInt(BKD3DTreeDocValuesFormat.encodeValue(z), bytes, 8);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(x), bytes, 0);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(y), bytes, 4);
+ Geo3DDocValuesFormat.writeInt(Geo3DDocValuesFormat.encodeValue(z), bytes, 8);
fieldsData = new BytesRef(bytes);
}
}
Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/PointInGeo3DShapeQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/PointInGeo3DShapeQuery.java?rev=1695616&r1=1695615&r2=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/PointInGeo3DShapeQuery.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/PointInGeo3DShapeQuery.java Wed Aug 12 22:34:05 2015
@@ -47,7 +47,7 @@ import java.util.Set;
/** Finds all previously indexed points that fall within the specified polygon.
*
- * <p>The field must be indexed with {@link BKD3DTreeDocValuesFormat}, and {@link BKD3DPointField} added per document.
+ * <p>The field must be indexed with {@link Geo3DDocValuesFormat}, and {@link Geo3DPointField} added per document.
*
* <p>Because this implementation cannot intersect each cell with the polygon, it will be costly especially for large polygons, as every
* possible point must be checked.
@@ -88,10 +88,10 @@ public class PointInGeo3DShapeQuery exte
return null;
}
- if (bdv instanceof BKD3DTreeBinaryDocValues == false) {
- throw new IllegalStateException("field \"" + field + "\" was not indexed with BKD3DTreeBinaryDocValuesFormat: got: " + bdv);
+ if (bdv instanceof Geo3DBinaryDocValues == false) {
+ throw new IllegalStateException("field \"" + field + "\" was not indexed with Geo3DBinaryDocValuesFormat: got: " + bdv);
}
- BKD3DTreeBinaryDocValues treeDV = (BKD3DTreeBinaryDocValues) bdv;
+ Geo3DBinaryDocValues treeDV = (Geo3DBinaryDocValues) bdv;
BKD3DTreeReader tree = treeDV.getBKD3DTreeReader();
// TODO: make this more efficient: as we recurse the BKD tree we should check whether the
@@ -105,21 +105,21 @@ public class PointInGeo3DShapeQuery exte
}
assert bytes.length == 12;
- double x = BKD3DTreeDocValuesFormat.decodeValue(BKD3DTreeDocValuesFormat.readInt(bytes.bytes, bytes.offset));
- double y = BKD3DTreeDocValuesFormat.decodeValue(BKD3DTreeDocValuesFormat.readInt(bytes.bytes, bytes.offset+4));
- double z = BKD3DTreeDocValuesFormat.decodeValue(BKD3DTreeDocValuesFormat.readInt(bytes.bytes, bytes.offset+8));
+ double x = Geo3DDocValuesFormat.decodeValue(Geo3DDocValuesFormat.readInt(bytes.bytes, bytes.offset));
+ double y = Geo3DDocValuesFormat.decodeValue(Geo3DDocValuesFormat.readInt(bytes.bytes, bytes.offset+4));
+ double z = Geo3DDocValuesFormat.decodeValue(Geo3DDocValuesFormat.readInt(bytes.bytes, bytes.offset+8));
// True if x,y,z is within shape
return shape.isWithin(x,y,z);
}
@Override
public BKD3DTreeReader.Relation compare(int xMinEnc, int xMaxEnc, int yMinEnc, int yMaxEnc, int zMinEnc, int zMaxEnc) {
- double xMin = BKD3DTreeDocValuesFormat.decodeValue(xMinEnc);
- double xMax = BKD3DTreeDocValuesFormat.decodeValue(xMaxEnc);
- double yMin = BKD3DTreeDocValuesFormat.decodeValue(yMinEnc);
- double yMax = BKD3DTreeDocValuesFormat.decodeValue(yMaxEnc);
- double zMin = BKD3DTreeDocValuesFormat.decodeValue(zMinEnc);
- double zMax = BKD3DTreeDocValuesFormat.decodeValue(zMaxEnc);
+ double xMin = Geo3DDocValuesFormat.decodeValue(xMinEnc);
+ double xMax = Geo3DDocValuesFormat.decodeValue(xMaxEnc);
+ double yMin = Geo3DDocValuesFormat.decodeValue(yMinEnc);
+ double yMax = Geo3DDocValuesFormat.decodeValue(yMaxEnc);
+ double zMin = Geo3DDocValuesFormat.decodeValue(zMinEnc);
+ double zMax = Geo3DDocValuesFormat.decodeValue(zMaxEnc);
GeoArea xyzSolid = new XYZSolid(planetModel, xMin, xMax, yMin, yMax, zMin, zMax);
Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat?rev=1695616&r1=1695615&r2=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat Wed Aug 12 22:34:05 2015
@@ -13,5 +13,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-org.apache.lucene.bkdtree3d.BKD3DTreeDocValuesFormat
+org.apache.lucene.bkdtree3d.Geo3DDocValuesFormat
Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java?rev=1695616&r1=1695615&r2=1695616&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java Wed Aug 12 22:34:05 2015
@@ -38,7 +38,7 @@ import org.apache.lucene.util.TestUtil;
import java.util.ArrayList;
import java.util.List;
-import static org.apache.lucene.bkdtree3d.BKD3DTreeDocValuesFormat.encodeValue;
+import static org.apache.lucene.bkdtree3d.Geo3DDocValuesFormat.encodeValue;
public class TestGeo3DPointField extends LuceneTestCase {
@@ -47,7 +47,7 @@ public class TestGeo3DPointField extends
int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
IndexWriterConfig iwc = newIndexWriterConfig();
- iwc.setCodec(TestUtil.alwaysDocValuesFormat(new BKD3DTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap)));
+ iwc.setCodec(TestUtil.alwaysDocValuesFormat(new Geo3DDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap)));
IndexWriter w = new IndexWriter(dir, iwc);
Document doc = new Document();
doc.add(new Geo3DPointField("field", PlanetModel.WGS84, toRadians(50.7345267), toRadians(-97.5303555)));