Hello,
You may be able to do better than issuing two queries, but GeoMesa's
support for that type of query is not entirely robust right now. For
the future, it may be fully answerable using the idea of a
trajectory API, which is something that the GeoMesa team has been
interested in for a while, but hasn't yet had the time/funding to
pursue.
For now, you may be able to get closer by storing each track in a
single feature. GeoMesa supports List-type attributes, so you could
store your positions as a single LineString, and then have a
corresponding List[Date] which stores the time for each point. Then
you could query for features that were in both positions and both
times - you would still have to do some manual comparisons to ensure
that the times and positions align, but the first query should
substantially narrow down the results. You could probably only take
advantage of either a spatial or temporal index, but not both as
GeoMesa doesn't currently have an index on time durations (although
our existing XZ3 index could support that, it hasn't been
implemented). In addition, you may hit some issues when you query on
multiple dates, as there are some places that we check for
'disjoint' queries, which may not account for having multiple dates
(e.g. generally dtg == today AND dtg == yesterday would never return
a result, however in the case of a List[Date] attribute it could) -
I am not sure if that is handled correctly, you would likely have to
try it out to see. If not, then you could potentially query for both
positions and one date, then do the second date and alignments
checks post-query.
One note, if you are writing frequent updates to a single track, you
may hit throughput issues writing to the database. The GeoMesa
Lambda data store is designed to solve this problem[1].
Thanks,
Emilio
[1] https://www.geomesa.org/documentation/user/lambda/index.html
On 4/28/19 7:54 AM, Yoav Zibin wrote:
Hi,
I'm looking for a SpatialTemporal
DB that can track moving objects and answer queries of the
form: find all objects that were in position X at time X' and
also were in position Y at time Y'.
Is it possible to write such a
query?
The closest query I could find
is:
BBOX(geom,0,0,10,10) AND dtg DURING 2017-01-01T00:00:00.000Z/2017-01-02T00:00:00.000Z
I could issue two such queries,
and do the intersection of the two results, but I was hoping
for a better way (because each query could return millions
of results, but the intersection is much much smaller).
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-users
|