Good Morning I am dealing with the following problem:
I have latitude and longitude for a set of drowning events occurred in the Mediterranean Sea, I also have the data, as a shape file, of the coastal border of Libya Tunisia and Egypt, what I would like to do is: compute all the possible distances between every single drownig event and the coastal border of the countries stated above.
For example I have that a boat (identified as event 4) capsized at coordinates: 32.6853649 (d_latitude) 25.9012421(d_longitude) I want then to compute all the pairwise distances from that point to each country border and then take the smllest of such distance.
I need that because after that I am gonna say that the boat departed from Libya (if libya is the closest country), and I will build a variable called number of events by departure point.
the dataset looks as follows:
_ID longitude latitude d_latitude d_longitude Year event_id
3 23.096664 32.575554 33.5784085 11.9031222 2016 1
3 19.919441 31.757496 32.6853649 25.9012421 2016 2
3 24.771942 30.303886 32.8708471 12.0631696 2016 3
3 9.398333 26.153332 37.2912498 13.2358149 2016 4
3 23.726387 32.174721 35.3626838 15.9465353 2016 5
3 19.92083 31.727215 33.5259117 8.0491191 2016 6
3 10.306389 31.713055 33.2286864 12.033724 2016 7
3 24.646664 32.021385 33.1328706 12.2549685 2016 8
where:
Does anyone knows a way to do this ??
I am using STATA 14
Kind regards,
Luca
I have latitude and longitude for a set of drowning events occurred in the Mediterranean Sea, I also have the data, as a shape file, of the coastal border of Libya Tunisia and Egypt, what I would like to do is: compute all the possible distances between every single drownig event and the coastal border of the countries stated above.
For example I have that a boat (identified as event 4) capsized at coordinates: 32.6853649 (d_latitude) 25.9012421(d_longitude) I want then to compute all the pairwise distances from that point to each country border and then take the smllest of such distance.
I need that because after that I am gonna say that the boat departed from Libya (if libya is the closest country), and I will build a variable called number of events by departure point.
the dataset looks as follows:
_ID longitude latitude d_latitude d_longitude Year event_id
3 23.096664 32.575554 33.5784085 11.9031222 2016 1
3 19.919441 31.757496 32.6853649 25.9012421 2016 2
3 24.771942 30.303886 32.8708471 12.0631696 2016 3
3 9.398333 26.153332 37.2912498 13.2358149 2016 4
3 23.726387 32.174721 35.3626838 15.9465353 2016 5
3 19.92083 31.727215 33.5259117 8.0491191 2016 6
3 10.306389 31.713055 33.2286864 12.033724 2016 7
3 24.646664 32.021385 33.1328706 12.2549685 2016 8
where:
- _ID identifies the Country LIbya=3 Tunisia=5 Egypt=2
- latitude and longitude are instead the coordinates that define the Lybian border (have them for all the countries)
- d_latitude d_longitude defines the coordinates of where the drowning event happened
- year goes from 2016 to 2000
- event_id: is the id of the drowning event
Does anyone knows a way to do this ??
I am using STATA 14
Kind regards,
Luca
Comment