Package com.browseengine.bobo.geosearch

Examples of com.browseengine.bobo.geosearch.CartesianCoordinateDocId


    @Override
    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


        if ((geoRecord.highOrder & (ONE_AS_LONG << highOrderPosition)) == 0) {
            z = z - Integer.MIN_VALUE;
        }
        highOrderPosition--;

        return new CartesianCoordinateDocId(x, y, z, docid);
    }
View Full Code Here

{

    @Override
    public int compare(Object o1, Object o2) {
        GeoConverter gc = new GeoConverter();
        CartesianCoordinateDocId ccdid1 = gc.toCartesianCoordinateDocId((CartesianGeoRecord)o1);
        CartesianCoordinateDocId ccdid2 = gc.toCartesianCoordinateDocId((CartesianGeoRecord)o2);
        int diff = ccdid1.docid - ccdid2.docid;
        if(diff < 0) {
            return 1;
        } else if (diff > 0) {
            return -1;
View Full Code Here

        this.centroidY = geoConverter.getYFromRadians(centroidLatitudeRadians, centroidLongitudeRadians);
        this.centroidZ = geoConverter.getZFromRadians(centroidLatitudeRadians);
       
        startDocidOfCurrentPartition = -1;
       
        CartesianCoordinateDocId minccd = buildMinCoordinate(rangeInKm, centroidX, centroidY, centroidZ, 0);
        CartesianCoordinateDocId maxccd = buildMaxCoordinate(rangeInKm, centroidX, centroidY, centroidZ, 0);
        this.cartesianBoundingBox = new int [] {minccd.x, maxccd.x, minccd.y, maxccd.y, minccd.z, maxccd.z};
       
    }
View Full Code Here

    public static CartesianCoordinateDocId buildMinCoordinate(float rangeInKm, int x, int y, int z, int docid) {
        int rangeInUnits = Conversions.radiusMetersToIntegerUnits(rangeInKm * 1000.0);
        int minX = Conversions.calculateMinimumCoordinate(x, rangeInUnits);
        int minY = Conversions.calculateMinimumCoordinate(y, rangeInUnits);
        int minZ = Conversions.calculateMinimumCoordinate(z, rangeInUnits);
        return new CartesianCoordinateDocId(minX, minY, minZ, docid);
    }
View Full Code Here

    public static CartesianCoordinateDocId buildMaxCoordinate(float rangeInKm, int x, int y, int z, int docid) {
        int rangeInUnits = Conversions.radiusMetersToIntegerUnits(rangeInKm * 1000.0);
        int maxX = Conversions.calculateMaximumCoordinate(x, rangeInUnits);
        int maxY = Conversions.calculateMaximumCoordinate(y, rangeInUnits);
        int maxZ = Conversions.calculateMaximumCoordinate(z, rangeInUnits);
        return new CartesianCoordinateDocId(maxX, maxY, maxZ, docid);
    }
View Full Code Here

        CartesianGeoRecord candidate = null;
        do {
            if (iteratorWithOriginalDocIds.hasNext()) {
                candidate = iteratorWithOriginalDocIds.next();
                if (null != candidate) {
                    CartesianCoordinateDocId rawInOriginalDocId = geoConverter.toCartesianCoordinateDocId(candidate);
                    if (deletedDocsThisPartition.get(rawInOriginalDocId.docid)) {
                        if (LOGGER.isDebugEnabled()) {
                            LOGGER.debug("skipping deleted docid before merge for raw "+rawInOriginalDocId);
                        }
                    } else {
View Full Code Here

    }
   
    private CartesianGeoRecord getGeoRecordInNewRange(CartesianGeoRecord candidate,
            CartesianCoordinateDocId rawInOriginalDocId) {
        // translate into merged space
        CartesianCoordinateDocId merged = rawInOriginalDocId.clone();
        int mergedDocId =
            findDocIdInMergedIndex(absoluteDocidOffset,
                    merged.docid,
                deletedDocsThisPartition);
        if (mergedDocId >= 0) {
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.geosearch.CartesianCoordinateDocId

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.