1

I am studying lions, and their kill sites.

I currently have around 900 historic kill site locations with the record date (with some attribute info). The data is old and I am looking to confirm the reliability of it (looking for additional proof) by looking at the collar (movement) data (multiple GPS locations) of the lions over the time around when the kills were recorded.

So, within a 300m radius of each Kill location I am looking to see what movement happened within the 300m area 3 months before and 2 weeks after the kill (date) was recorded.

I have tried all I know and can - buffer around each kill, have clipped the points that fall within the 300m area easily but cannot separate and sort them to confirm if there was a kill or not.

1 Answer 1

1

You can use DB Manager - Virtual Layer and SQL with the query:

select  row_number() over() as id,
        kill.killdate, 
        track.tracktime, 
        case 
            when track.geometry is null then 'No track within 300 m'
            when julianday(killdate)-julianday(tracktime) < -14 then '2 weeks after'
            when julianday(killdate)-julianday(tracktime) > 90 then '3 months before'
            else 'Unreliable kill'
        end validation,
        kill.geometry
from lionkillsite as kill
left join liongpstrack as track
on st_distance(kill.geometry, track.geometry) < 300

My kill table/layer is named lionkillsite, gps track table liongpstrack, my date field in kill table killdate, track date column tracktime. You need to modify these in the query to match your data.

One point/row will be created for each combination of kill-track that are within 300 m. So you will get multiple overlapping kill points at some locations. It is possible to modify the query to only select one unique kill point, if you can decide how it should be selected (like pick most recent / closest track etc.).

enter image description here

2
  • 1
    Great answer. If only I could upvote this more than once.
    – user2856
    Commented Jul 31, 2023 at 5:59
  • Thanks, I received the following error: "Query execution error on CREATE TEMP VIEW _tview AS select row_number() over() as id, kill.Killdate, track.Trackdate, case when track.geometry is null then 'No track within 300 m' when julianday(Killdate)-julianday(Trackdate) < -14 then '2 weeks after' when julianday(Killdate)-julianday(Trackdate) > 90 then '3 months before' else 'Unreliable kill' end validation, kill.geometry from KS_Hist. as kill left join Movements_Hist. as track on st_distance(kill.geometry, track.geometry) < 300: 1 - near "as": syntax error" Commented Jul 31, 2023 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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