Package com.browseengine.bobo.geosearch.bo

Examples of com.browseengine.bobo.geosearch.bo.CartesianGeoRecord


    public DocsSortedByDocId getBlock(GeoSegmentReader<CartesianGeoRecord> geoSegmentReader, IDeletedDocs deletedDocsWithinSegment,
            int minX, int maxX, int minY, int maxY, int minZ, int maxZ, int mindocid, int maxdocid)
            throws IOException {

        CartesianCoordinateDocId minccd = new CartesianCoordinateDocId(minX, minY, minZ, mindocid);
        CartesianGeoRecord minValue = geoConverter.toCartesianGeoRecord(minccd, CartesianGeoRecord.DEFAULT_FILTER_BYTE);
        CartesianCoordinateDocId maxccd = new CartesianCoordinateDocId(maxX, maxY, maxZ, maxdocid);
        CartesianGeoRecord maxValue = geoConverter.toCartesianGeoRecord(maxccd, CartesianGeoRecord.DEFAULT_FILTER_BYTE);
        Iterator<CartesianGeoRecord> iterator = geoSegmentReader.getIterator(minValue, maxValue);
        DocsSortedByDocId docs = new DocsSortedByDocId();

        while (iterator.hasNext()) {
            CartesianGeoRecord geoRecord = iterator.next();
            CartesianCoordinateDocId ccd  = geoConverter.toCartesianCoordinateDocId(geoRecord);
            if(minX <= ccd.x  && ccd.x <= maxX && minY <= ccd.y  && ccd.y <= maxY && minZ <= ccd.z  && ccd.z <= maxZ && mindocid <= ccd.docid  && ccd.docid <= maxdocid) {
                GeRecordAndCartesianDocId both = new GeRecordAndCartesianDocId(geoRecord, ccd);
                docs.add(ccd.docid, both);
            }
View Full Code Here


        lowOrderBits = interlaceToLong(docid, docIdPos, lowOrderBits, lowOrderPosition, 4);
        lowOrderBits = interlaceToLong(x, xPos, lowOrderBits, --lowOrderPosition, 4);
        lowOrderBits = interlaceToLong(y, yPos, lowOrderBits, --lowOrderPosition, 4);
        lowOrderBits = interlaceToLong(z, zPos, lowOrderBits, --lowOrderPosition, 4);
       
        return new CartesianGeoRecord(highOrderBits, lowOrderBits, filterByte);
    }
View Full Code Here

       
        LatitudeLongitudeDocId longLatDocId = new LatitudeLongitudeDocId(coordinate.getLatitude(),
                coordinate.getLongitude(), docID);
       
        IFieldNameFilterConverter fieldNameFilterConverter = geoConverter.makeFieldNameFilterConverter();
        CartesianGeoRecord geoRecord = geoConverter.toCartesianGeoRecord(fieldNameFilterConverter, fieldName, longLatDocId);
       
        //For now, we need to synchronize this since we can only safely have one thread at a
        //time adding an item to a treeset.  One alternative strategy is to add geoRecords to
        //an object with better concurrency while indexing and then sort using the TreeSet on
        //flush
View Full Code Here

        output.writeByte(record.filterByte);
    }

    @Override
    public CartesianGeoRecord readGeoRecord(IndexInput input, int recordByteCount) throws IOException {
        return new CartesianGeoRecord(input.readLong(),
                input.readLong(),
                input.readByte());
    }
View Full Code Here

    }
   
    private void buildTreeFromIterator(Iterator<CartesianGeoRecord> geoIter) throws IOException {
        int index = leftMostLeafIndex;
        while(geoIter.hasNext()) {
            CartesianGeoRecord geoRecord = geoIter.next();
            highOrders [index] = geoRecord.highOrder;
            lowOrders [index] = geoRecord.lowOrder;
            filterBytes [index] = geoRecord.filterByte;
            index = this.getNextIndex(index);
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public CartesianGeoRecord getValueAtIndex(int index) {
        return new CartesianGeoRecord(highOrders[index], lowOrders[index], filterBytes[index]);
    }
View Full Code Here

    private void advance() {
        if (!iteratorWithOriginalDocIds.hasNext()) {
            next = null;
            return;
        }
        CartesianGeoRecord geoRecordInNewRange = null;
        CartesianGeoRecord candidate = null;
        do {
            if (iteratorWithOriginalDocIds.hasNext()) {
                candidate = iteratorWithOriginalDocIds.next();
                if (null != candidate) {
                    CartesianCoordinateDocId rawInOriginalDocId = geoConverter.toCartesianCoordinateDocId(candidate);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public CartesianGeoRecord next() {
        CartesianGeoRecord next = this.next;
        advance();
        if (null != next) {
            return next;
        }
        throw new NoSuchElementException();
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.geosearch.bo.CartesianGeoRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.