Package org.geotools.util

Examples of org.geotools.util.Range


                }
                if (domainType == DomainType.SINGLE_VALUE) {
                    // Domain made of single values
                    if(value instanceof Range){
                        // RANGE                       
                        final Range range= (Range)value;
                        filters.add(
                                ff.and(
                                        ff.lessOrEqual(
                                                ff.property(propertyName),
                                                ff.literal(range.getMaxValue())),
                                        ff.greaterOrEqual(
                                                ff.property(propertyName),
                                                ff.literal(range.getMinValue()))
                                ));
                    else {
                        // SINGLE value
                        filters.add(
                                ff.equal(
                                        ff.property(propertyName),
                                        ff.literal(value),true)
                                    );
                    }
                } else { //domainType == DomainType.RANGE
                    // Domain made of ranges such as (beginTime,endTime) , (beginElevation,endElevation) , ...
                    if(value instanceof Range){
                        // RANGE                       
                        final Range range= (Range)value;
                        final Comparable maxValue = range.getMaxValue();
                        final Comparable minValue = range.getMinValue();
                        if(maxValue.compareTo(minValue)!=0){
                            // logic comes from Range.intersectsNC(Range)
                            // in summary, requestedMax > min && requestedMin < max
                            Filter maxCondition = ff.greaterOrEqual(
                                                        ff.literal(maxValue),
View Full Code Here


     * Populate the set of minimal ranges as a set of Strings
     */
    protected void populateRange() {
        Iterator<Range> iterator = set.iterator();
        while (iterator.hasNext()) {
            Range range = iterator.next();
            minimalRanges.add((range.getMinValue() + "/" + range.getMaxValue()));
        }
    }
View Full Code Here

       
        // //
        // Setting up time filter
        // //
        if (time != null) {
            final Range range = (Range) time;
            // schema with only one time attribute. Consider adding code for schema with begin,end attributes
            filters.add(FeatureUtilities.DEFAULT_FILTER_FACTORY.and(
                    FeatureUtilities.DEFAULT_FILTER_FACTORY.lessOrEqual(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(timeFilterAttribute),
                            FeatureUtilities.DEFAULT_FILTER_FACTORY.literal(range.getMaxValue())),
                    FeatureUtilities.DEFAULT_FILTER_FACTORY.greaterOrEqual(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(timeFilterAttribute),
                            FeatureUtilities.DEFAULT_FILTER_FACTORY.literal(range.getMinValue()))));
        }
       
        // //
        // Setting up elevation filter
        // //
        if (elevation != null) {
            final Range range = (Range) elevation;
            // schema with only one elevation attribute. Consider adding code for schema with begin,end attributes
            filters.add(FeatureUtilities.DEFAULT_FILTER_FACTORY.and(
                    FeatureUtilities.DEFAULT_FILTER_FACTORY.lessOrEqual(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(elevationFilterAttribute),
                            FeatureUtilities.DEFAULT_FILTER_FACTORY.literal(range.getMaxValue())),
                    FeatureUtilities.DEFAULT_FILTER_FACTORY.greaterOrEqual(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(elevationFilterAttribute),
                            FeatureUtilities.DEFAULT_FILTER_FACTORY.literal(range.getMinValue()))));
        }

        if (requestFilter != null) {
            filters.add(requestFilter);
        }
View Full Code Here

            assertTrue("containsAll", list.containsAll(Arrays.asList(categories)));
            assertSame(list.geophysics(true), list.inverse());
            assertSame(list.geophysics(true).geophysics(false), list);
            assertSame(list.geophysics(false), list);

            final Range range = list.getRange();
            assertEquals("min", 0,   ((Number)range.getMinValue()).doubleValue(), 0);
            assertEquals("max", 120, ((Number)range.getMaxValue()).doubleValue(), 0);
            assertTrue  ("min included", range.isMinIncluded() == true);
            assertTrue  ("max included", range.isMaxIncluded() == false);
            /*
             * Checks category search.
             */
            assertSame"0", list.getCategory0), categories[0]);
            assertSame"7", list.getCategory7), categories[1]);
View Full Code Here

    Filter buildDimensionFilter(Object value, PropertyName attribute, PropertyName endAttribute) {
        Filter filter;
        if (value == null) {
            filter = Filter.INCLUDE;
        } else if (value instanceof Range) {
            Range range = (Range) value;
            if (endAttribute == null) {
                filter = ff.between(attribute, ff.literal(range.getMinValue()),
                        ff.literal(range.getMaxValue()));
            } else {
                // Range intersects valid range of feature
                // @todo adding another option to dimensionInfo allows contains, versus intersects
                Literal qlower = ff.literal(range.getMinValue());
                Literal qupper = ff.literal(range.getMaxValue());
                Filter lower = ff.lessOrEqual(attribute, qupper);
                Filter upper = ff.greaterOrEqual(endAttribute, qlower);
                return ff.and(lower, upper);
            }
        } else {
View Full Code Here

TOP

Related Classes of org.geotools.util.Range

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.