4

For the interpretation of bird observations, I need to identify the position on a GPS-track (gpx-files), from which the position of a bird observation (other gpx-waypoint layer) was recorded.

The tracks are recorded on an Android device with the Locus app. When a bird is observed, a new point is created on the map in a different point layer.

For the interpretation of the findings later, it would be nice to be able to identify the position from where the observation was taken.

I am looking for ways to develop a tool, where one can select a point in the bird layer, click a button, and the corresponding track points are somehow highlighted.

To start with, I need to find out in general, how I can do a selection query across two layers with the value taken from a selected feature in the first layer. enter image description here The next problem would then be, that the timestamps of both layers are never completely the same, as you can see in the example, so in most cases, the exact time of the observation will be between two track points, so a hard comparison of the two layers is not possible.

2

I had a bit of a play with the aggregate functions and got something which may be useful. It doesn't do everything that you want but maybe it will be of some use.

I made two layers: one for the birds named "Sightings", with a column named "ObservationTime";

and another for the waypoints named "Tracks" with a column named "PositionTime"

I used the Field Calculator to add a calculated column to the Sightings layer with the expression:

aggregate('Tracks','max',PositionTime,
          PositionTime<=attribute(@parent,'ObservationTime'))

The function looks in the Tracks layers and retrieves the maximum PositionTime which is Less than or Equal to the ObservationTime.

I'm assuming that all the time values for the waypoints will be unique and thus the PositionTime would be a good way to identify a particular row.

I also assumed the PositionTime must be less than the ObservationTime because the observation couldn't have been made from a position before it has been reached. In reality I guess the waypoints are samples along a constantly changing path and a position with a time slightly after the observation may, in some cases, be a closer approximation of the true position. If that really matters you could add a second calculated column which selects the Minimum PositionTime which is Greater than the ObservationTime, so you have identified the two closest positons. You could combine both into a complicated expression with an if statement that chooses whether the earlier time or the later time is nearer to the ObservationTime.

Hope this helps.

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.