Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Bug Report

Hi,

As an update to this, I did have a chance to reproduce the 'disappearing' features in the OpenLayers preview.  I believe GeoServer is painting the features in the order they arrive.  For the shapefile layers which ship with GeoServer, they are always painted in Feature ID order, and hence appear predictably.  For more details, I've started a thread on the GeoServer user list here: http://sourceforge.net/p/geoserver/mailman/geoserver-users/?viewmonth=201501&viewday=13

For the second issue, I am still use what the issue could be.  Perhaps you could try repeating with the geomesa 'export' tool?  http://www.geomesa.org/2014/10/09/geomesa-tools-ingest-export/

Thanks,

Jim

On 01/13/2015 11:17 AM, Jim Hughes wrote:
Hi,

I haven't had a chance to recreate your error/run your code, but I do have some suggestions/questions.

In general, the disappearing features issue could be happening in GeoServer, GeoMesa's caching layer or query planner, or Accumulo.  To help diagnose the problem, I'd ask if you can checks your logs.

1.  The logs for GeoServer will depend on your J2EE container.  I tend to suggest Tomcat or JBoss.  Do the container or GeoServer logs have any exceptions or other messages of note?

2.  The logs for Accumulo are distributed to the various tablet servers.  General messages are shared on the Accumulo on the master node in a webapp at 50095.  Does the monitor have any logs messages?  If it references a tablet server (usually by IP), go ahead and check out $ACCUMULO_HOME/logs on that server.

3.  Are all the tablet servers alive?  Also, how much memory do they have?  I might suggest increasing the memory from the default to at least 2 gigabytes. 

4.  In GeoServer, are the GeoMesa features registered with caching on or off? 

Anyhow, some of those questions may help us better understand the behavior you have observed. 

Thanks in advance for any more details and thanks for reporting your issue,

Jim

On 01/12/2015 10:37 PM, 焦小超 wrote:
Hi,
   I  imported the geoserver's data nyc:tiger_roads and nyc:landmarks into geomesa,  visualized those layer. 
and then the layer were opened in openlayers, when i drag the layer to see different part, i found some feature dispeared, as the following picture:
 


       While i wrote a Test code, according to the quickstart example , to read from the Positon layer(201600 features) in same query condition, and executed it every 5 seconds to continue query, unfortunately i got different results size, may be 20160, mat be 19592 or 18218 or others . key codes as the following:
     

 static Filter createFilter(String geomField, double x0, double y0,
            double x1, double y1, String dateField, String t0, String t1,
            String attributesQuery) throws CQLException, IOException {

        // there are many different geometric predicates that might be used;
        // here, we just use a bounding-box (BBOX) predicate as an example.
        // this is useful for a rectangular query area
        String cqlGeometry = "BBOX(" + geomField + ", " + x0 + ", " + y0 + ", "
                + x1 + ", " + y1 + ")";

        // there are also quite a few temporal predicates; here, we use a
        // "DURING" predicate, because we have a fixed range of times that
        // we want to query
        String cqlDates = "(" + dateField + " DURING " + t0 + "/" + t1 + ")";

        // there are quite a few predicates that can operate on other attribute
        // types; the GeoTools Filter constant "INCLUDE" is a default that means
        // to accept everything
        String cqlAttributes = attributesQuery == null ? "INCLUDE"
                : attributesQuery;

        String cql = /*cqlGeometry + " AND " + */cqlAttributes + " AND " + cqlDates;
        return CQL.toFilter(cql);
    }
static int queryFeatures(String simpleFeatureTypeName,
            DataStore dataStore, String geomField, double x0, double y0,
            double x1, double y1, String dateField, String t0, String t1,
            String attributesQuery) throws CQLException, IOException {

        // construct a (E)CQL filter from the search parameters,
        // and use that as the basis for the query
        Filter cqlFilter = createFilter(geomField, x0, y0, x1, y1, dateField,
                t0, t1, attributesQuery);
        Query query = new Query(simpleFeatureTypeName, cqlFilter);

        // submit the query, and get back an iterator over matching features
        FeatureSource featureSource =  dataStore.getFeatureSource(simpleFeatureTypeName);
        FeatureIterator featureItr =  featureSource.getFeatures(query).features();

//        AccumuloFeatureReader reader = ((AccumuloDataStore) dataStore)
//                .getFeatureReader(simpleFeatureTypeName, query);
////
//        reader.explainQuery(reader.explainQuery$default$1(),
//                reader.explainQuery$default$2());

        // loop through all results
        int n = 0;
        while (featureItr.hasNext()) {
            Feature feature = featureItr.next();
//            System.out.println((++n) + ".  "
//                    + feature.getProperty("simNumber").getValue() + "|"
//                    + feature.getProperty("geom").getValue() + "|"
//                    + feature.getProperty("timeStamp").getValue());
            ++n;
        }
        featureItr.close();
       
        return n/*featureSource.getCount(query)*/;
    }

public static void main(String[] args) throws Exception {
        // find out where -- in Accumulo -- the user wants to store data
        CommandLineParser parser = new BasicParser();
        Options options = getCommonRequiredOptions();
        CommandLine cmd = parser.parse(options, args);

        // verify that we can see this Accumulo destination in a GeoTools manner
        Map<String, String> dsConf = getAccumuloDataStoreConf(cmd);
        DataStore dataStore = DataStoreFinder.getDataStore(dsConf);
        assert dataStore != null;

        // establish specifics concerning the SimpleFeatureType to store
        String simpleFeatureTypeName = "Position";

        // query a few Features from this table
        List<Runnable> tasks = new ArrayList<Runnable>();
        int clients = 1;
       
        for(int i=0; i<clients; i++){
           tasks.add(new GeomesaQueryTask(simpleFeatureTypeName, dataStore));
        }
       
        ScheduledThreadPoolExecutor exec = new  ScheduledThreadPoolExecutor(clients);
        for(Runnable run : tasks){
           exec.scheduleAtFixedRate(run, 0 ,  5000 , TimeUnit.MILLISECONDS);
        }
       
    }
 
    static Random random = new Random(10);
   
    static String[] sims = new String[]{"013519171000", "013519171001", "013519171002", "013519171003", "013519171004", "013519171005", "013519171006", "013519171007", "013519171008", "013519171009"};

    private static class GeomesaQueryTask implements Runnable {
       
        private String featureName;
        private DataStore dataStore;

        public GeomesaQueryTask(String simpleFeatureTypeName, DataStore dataStore) {
            this.featureName = simpleFeatureTypeName;
            this.dataStore = dataStore;
        }

        public void run() {
           
            try {
                double lonStart =73.33;
                double latStart = 3.51;
                double lonEnd = 135.05;
                double latEnd = 53.33;
               
                long start = System.currentTimeMillis();
                String sim =  sims[random.nextInt(10)];

                int num = queryFeatures(featureName, dataStore, "geom", lonStart,latStart,
                        lonEnd, latEnd, "timeStamp", "2015-01-05T00:00:00",
                        "2015-01-14T23:59:59", "(simNumber = '"+sim+"')");
               
                long end = System.currentTimeMillis();
               
                System.out.println(Thread.currentThread().getName()+" read "+ num +" entries, consume " + (end -start) + "ms");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }










_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users



_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users


Back to the top