1

I am trying to visualise the historic of a vehicle in a specific area , I am writing now a query to get all points off a this vehicle in this area with this :

    FeatureStore feature = (FeatureStore) dataStore.getFeatureSource("testone");
    SimpleFeatureSource source=dataStore.getFeatureSource("testone");
    SimpleFeatureCollection collection=source.getFeatures(CQL.toFilter("vehicleId = my_Id and DWITHIN(geom,myPointofInterest,200,meters)"));
    System.out.println(collection.size());
        while(iterator.hasNext()){
            // Here i will create the Polyline 
            System.out.println(iterator.next());

        }

is there a function in geomesa that aggregate points into one Polyline so i can do it in geomesa not in my server ? and for the visualisation , a vehicle can enter this area and leave it and re enter again , do you have any idea how can I detect this multiple Path ?

1

GeoMesa uses GeoTools and JTS as geospatial and geometry libraries, respectively. With the observations, you can build a LineString [1] and visualize that. If you can detect when the path leaves the area, you could build a MultiLineString instead.

[1] http://javadox.com/com.vividsolutions/jts/1.13/com/vividsolutions/jts/geom/GeometryFactory.html#createLineString(com.vividsolutions.jts.geom.Coordinate[])

  • I tried this approach but I am having another probleme : Exception in thread "main" java.lang.IllegalArgumentException: Points of LinearRing do not form a closed linestring I think the LineString Should be closed – DJAMEL DAHMANE Aug 18 '18 at 8:34
  • LineString must end with the starting point , it's not a path – DJAMEL DAHMANE Aug 18 '18 at 14:18
  • LineStrings should not have to be a closed ring. Are you calling createLineString? There are methods which will make a LinearRing and those do need to be closed. – GeoMesaJim Aug 18 '18 at 15:47
  • yes I am calling createLineString from GeometryFactory – DJAMEL DAHMANE Aug 18 '18 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.