Package org.geotools.data

Examples of org.geotools.data.DefaultQuery


     *         IOException
     *
     * @see org.geotools.data.FeatureSource#getFeatures(org.geotools.data.Query)
     */
    public SimpleFeatureCollection getFeatures(Query query) throws IOException {
        DefaultQuery mergedQuery = makeDefinitionQuery(query);
        SimpleFeatureCollection results = source.getFeatures(mergedQuery);

        // Get all the coordinate systems involved in the two queries
        CoordinateReferenceSystem cCs = constraintQuery.getCoordinateSystem();
        CoordinateReferenceSystem cCsr = constraintQuery.getCoordinateSystemReproject();
View Full Code Here


     *
     * @return @throws
     *         IOException
     */
    public SimpleFeatureCollection getFeatures(Filter filter) throws IOException {
        return getFeatures(new DefaultQuery(schema.getTypeName(),filter));
    }
View Full Code Here

     
   

     
      String[] ps = new String []{"wkb_geometry","statel","countyl","stater","countyr"};
      Query q = new DefaultQuery("county_boundary",or,ps);        
      
        
      FeatureReader fr = ds.getFeatureReader(q, new DefaultTransaction() );
  
        while (fr.hasNext())
View Full Code Here

            "name",
            "altname1","altname2","altname3","altname4","altname5",
            "altname6","altname7","altname8","altname9"
           
          };
      Query q = new DefaultQuery("delme_major",like,ps);        
      
        
      FeatureReader fr = ds.getFeatureReader(q, new DefaultTransaction() );
  
        while (fr.hasNext())
View Full Code Here

      cf.addLeftValue( ff.createAttributeExpression( null, "module") );
      cf.addRightValue( ff.createLiteralExpression(MODULE));
        
     
      String[] ps = new String []{"wkb_geometry","tlid"};
      Query q = new DefaultQuery("completechain",cf,ps);        
      
        
      FeatureReader fr = ds.getFeatureReader(q, new DefaultTransaction() );
  
        while (fr.hasNext())
View Full Code Here

      cf.addLeftValue( ff.createAttributeExpression( null, "module") );
      cf.addRightValue( ff.createLiteralExpression(MODULE));
        
     
      String[] ps = new String []{"polyidl","polyidr","tlid"};
      Query q = new DefaultQuery("polychainlink",cf,ps);        
      
        
      FeatureReader fr = ds.getFeatureReader(q, new DefaultTransaction() );
  
        while (fr.hasNext())
View Full Code Here

      cf.addLeftValue( ff.createAttributeExpression( null, "module") );
      cf.addRightValue( ff.createLiteralExpression(MODULE));
        
     
      String[] ps = new String []{"wkb_geometry","polyid"};
      Query q = new DefaultQuery("pip",cf,ps);        
      
        
      FeatureReader fr = ds.getFeatureReader(q, new DefaultTransaction() );
  
        while (fr.hasNext())
View Full Code Here

        OGRDataStore ods = new OGRDataStore(getAbsolutePath(STATE_POP), null, null);
        long start = System.currentTimeMillis();
        ods.getSchema(ods.getTypeNames()[0]);
        long end = System.currentTimeMillis();
        System.out.println("OGR schema: " + (end - start) / 1000.0);
        DefaultQuery query = new DefaultQuery(ods.getTypeNames()[0]);
        start = System.currentTimeMillis();
        FeatureReader ofr = ods.getFeatureReader(query, Transaction.AUTO_COMMIT);
        while (ofr.hasNext())
            ofr.next();
        ofr.close();
View Full Code Here

        long start = System.currentTimeMillis();
        sds.getSchema();
        long end = System.currentTimeMillis();
        System.out.println("SDS schema: " + (end - start) / 1000.0);

        DefaultQuery query = new DefaultQuery(sds.getTypeNames()[0]);
        start = System.currentTimeMillis();
        FeatureReader sfr = sds.getFeatureReader(query, Transaction.AUTO_COMMIT);
        while (sfr.hasNext())
            sfr.next();
        sfr.close();
View Full Code Here

            } else {
                //no post filter, we have a preFilter, or preFilter is null..
                // either way we can use the datastore optimization
                Connection cx = dataStore.getConnection(getState());
                try {
                    DefaultQuery q = new DefaultQuery(query);
                    q.setFilter(preFilter);
                    int count = dataStore.getCount(getSchema(), q, cx);
                    // if native support for limit and offset is not implemented, we have to ajust the result
                    if(!dataStore.getSQLDialect().isLimitOffsetSupported()) {
                        if(query.getStartIndex() != null && query.getStartIndex() > 0) {
                            if(query.getStartIndex() > count)
View Full Code Here

TOP

Related Classes of org.geotools.data.DefaultQuery

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.