Package com.geophile.z

Examples of com.geophile.z.Space


            boolean equal = expected.rowType().nFields() == actual.rowType().nFields();
            if (!equal)
                return false;
            nFields = actual.rowType().nFields();
        }
        Space space = space(expected.rowType());
        if (space != null) {
            nFields = nFields - space.dimensions() + 1;
        }
        for (int actualPosition = 0, expectedPosition = 0;
             actualPosition < nFields && expectedPosition < nFields;
             actualPosition++, expectedPosition++) {
            if(skipInternalColumns) {
View Full Code Here


        return (col != null) && col.isInternalColumn();
    }

    private static Space space(RowType rowType)
    {
        Space space = null;
        if (rowType instanceof IndexRowType) {
            Index index = ((IndexRowType)rowType).index();
            if (index.isSpatial()) {
                space = index.space();
            }
View Full Code Here

        @Override
        protected void estimateCost() {
            int nscans = 1;
            FunctionExpression func = (FunctionExpression)index.getLowComparand();
            List<ExpressionNode> operands = func.getOperands();
            Space space = index.getIndex().space();
            if ("_center".equals(func.getFunction())) {
                nscans = 2;     // One in each direction.
                costEstimate = costEstimator.costIndexScan(index.getIndex(),
                                                           index.getEqualityComparands(),
                                                           null, true,
                                                           null, true);
            } else if ("_center_radius".equals(func.getFunction())) {
                BigDecimal lat = decimalConstant(operands.get(0));
                BigDecimal lon = decimalConstant(operands.get(1));
                BigDecimal r = decimalConstant(operands.get(2));
                if ((lat != null) && (lon != null) && (r != null)) {
                    SpatialObject box = BoxLatLon.newBox(lat.subtract(r).doubleValue(),
                                                         lat.add(r).doubleValue(),
                                                         lon.subtract(r).doubleValue(),
                                                         lon.add(r).doubleValue());
                    long[] zValues = new long[box.maxZ()];
                    space.decompose(box, zValues);
                    for (int i = 0; i < box.maxZ(); i++) {
                        long z = zValues[i];
                        if (z != -1L) {
                            ExpressionNode lo = new ConstantExpression(Space.zLo(z), InternalIndexTypes.LONG.instance(true));
                            ExpressionNode hi =  new ConstantExpression(Space.zHi(z), InternalIndexTypes.LONG.instance(true));
View Full Code Here

        super(context, iterationHelper);
        assert keyRange.spatial();
        this.iterationHelper = iterationHelper;
        IndexRowType physicalIndexRowType = keyRange.indexRowType().physicalRowType();
        Index index = keyRange.indexRowType().index();
        Space space = index.space();
        int latColumn = index.firstSpatialArgument();
        int lonColumn = latColumn + 1;
        // The index column selector needs to select all the columns before the z column, and the z column itself.
        IndexRowPrefixSelector indexColumnSelector = new IndexRowPrefixSelector(latColumn + 1);
        IndexBound loBound = keyRange.lo();
View Full Code Here

        indexRow.append(row.value(flattenedIndex), column.getType());
    }

    private void copyZValueToIndexRow(GroupIndex groupIndex, Row row, IndexRowComposition irc) {
        BigDecimal[] coords = new BigDecimal[Spatial.LAT_LON_DIMENSIONS];
        Space space = groupIndex.space();
        int firstSpatialColumn = groupIndex.firstSpatialArgument();
        boolean zNull = false;
        for(int d = 0; d < Spatial.LAT_LON_DIMENSIONS; d++) {
            if(!zNull) {
                ValueSource columnValue = row.value(irc.getFieldPosition(firstSpatialColumn + d));
View Full Code Here

TOP

Related Classes of com.geophile.z.Space

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.