Examples of SortBy


Examples of org.opengis.filter.sort.SortBy

      }
      assertTrue(error);

      //sort by
      String prop = schema.getAttributeDescriptors().get(1).getLocalName();
      SortBy sb =filterFactory.sort(prop, SortOrder.ASCENDING);
      query = new DefaultQuery(schema.getTypeName());
      query.setSortBy(new SortBy[]{sb});
      error = false;
      try{
        features = cacheDataset.getFeatures(query);
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        }
       
        if(sortBy != null && sortBy.length > 0) {
        returnString.append("\n   [sort by: ");
            for (int i = 0; i < sortBy.length; i++) {
                SortBy sb = sortBy[i];
                if(sb == SortBy.NATURAL_ORDER) {
                    returnString.append("NATURAL");
                } else if(sb == SortBy.REVERSE_ORDER) {
                    returnString.append("REVERSE");
                } else {
                    returnString.append(sb.getPropertyName().getPropertyName());
                    returnString.append(" ");
                    returnString.append(sb.getSortOrder().name());
                }

                if (i < (sortBy.length - 1)) {
                    returnString.append(", ");
                }
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        catalog.add(l6);
        catalog.add(l7);
        catalog.add(l8);

        Filter filter;
        SortBy sortOrder;
        List<LayerInfo> expected;

        /*
        Layer   Style   Feature Type    SRS
        l4      s1      ft5     EPSG:1
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

            throw new IllegalArgumentException("Unknown type: " + of);
        }

        if (null != sortByList) {
            for (int i = sortByList.length - 1; i >=0 ; i--) {
              SortBy sortBy = sortByList[i];
              Ordering<Object> ordering = Ordering.from(comparator(sortBy));
              if (SortOrder.DESCENDING.equals(sortBy.getSortOrder())) {
                  ordering = ordering.reverse();
              }
              all = ordering.sortedCopy(all);
            }
        }
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        // unmap sortby
        SortBy[] unmappedSortBy = null;
        if (q.getSortBy() != null && q.getSortBy().length > 0) {
            unmappedSortBy = new SortBy[q.getSortBy().length];
            for (int i = 0; i < q.getSortBy().length; i++) {
                SortBy sortby = q.getSortBy()[i];
                Expression expr = (Expression) sortby.getPropertyName().accept(unmapper, null);

                if (!(expr instanceof PropertyName)) {
                    throw new IOException("Sorting on " + sortby.getPropertyName()
                            + " is not supported.");
                }

                unmappedSortBy[i] = new SortByImpl((PropertyName) expr, sortby.getSortOrder());

            }
        }
       
        if (q.getProperties() != null && q.getProperties().size() > 0) {
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        }       
       
        SortBy[] sortBy = query.getSortBy();
        if(sortBy != null && sortBy.length > 0) {           
            for (int i = 0; i < sortBy.length; i++) {
                SortBy sb = sortBy[i];
                if(!SortBy.NATURAL_ORDER.equals(sb) && !SortBy.REVERSE_ORDER.equals(sb)) {
                    sortBy[i] = new SortByImpl(MDQueryableFilterVisitor.property(sb.getPropertyName()), sb.getSortOrder());
                }
            }
            query.setSortBy(sortBy);
        }
       
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

           
            // encode layer groups
            CloseableIterator<LayerGroupInfo> layerGroups;
            {
                final Filter lgFilter = Predicates.acceptAll();
                SortBy layerGroupOrder = asc("name");
                layerGroups = catalog.list(LayerGroupInfo.class, lgFilter, null, null,
                        layerGroupOrder);
            }           
            try {
                layersAlreadyProcessed = handleLayerGroups(layerGroups);
            } catch (Exception e) {
                throw new RuntimeException("Can't obtain Envelope of Layer-Groups: "
                        + e.getMessage(), e);
            } finally {
                layerGroups.close();
            }           
           
            // now encode each layer individually
            SortBy layerOrder = asc("name");
            layers = catalog.list(LayerInfo.class, filter, null, null, layerOrder);
            try {
                handleLayerTree(layers, layersAlreadyProcessed);
            } finally {
                layers.close();
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        catalog.add(l3);

        assertEquals(3, catalog.getLayers().size());

        Filter filter;
        SortBy sortOrder;
        List<LayerInfo> expected;

        filter = acceptAll();
        sortOrder = asc("resource.name");
        expected = Lists.newArrayList(l1, l2, l3);
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

        // global sorting
        final SortParam sort = getSort();
        final Property<LayerInfo> property = getProperty(sort);

        SortBy sortOrder = null;
        if (sort != null) {
            if(property instanceof BeanProperty){
                final String sortProperty = ((BeanProperty<LayerInfo>)property).getPropertyPath();
                sortOrder = sortBy(sortProperty, sort.isAscending());
            }else if(property == ENABLED){
View Full Code Here

Examples of org.opengis.filter.sort.SortBy

       
        SortBy[] sortBy = query.getSortBy();
        if(sortBy != null && sortBy.length > 0) {
            CSWPropertyPathExtender extender = new CSWPropertyPathExtender();
            for (int i = 0; i < sortBy.length; i++) {
                SortBy sb = sortBy[i];
                if(!SortBy.NATURAL_ORDER.equals(sb) && !SortBy.REVERSE_ORDER.equals(sb)) {
                    PropertyName name = sb.getPropertyName();
                    PropertyName extended = extender.extendProperty(name, FF, NAMESPACES);
                    sortBy[i] = new SortByImpl(extended, sb.getSortOrder());
                }
            }
            query.setSortBy(sortBy);
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.