R measuring distance from a coastline

前端 未结 3 1826
花落未央
花落未央 2021-02-08 11:09

I have a set of coordinates:

d1 <- data_frame(
title = c(\"base1\", \"base2\", \"base3\", \"base4\"),
lat = c(57.3, 58.8, 47.2, 57.8, 65.4, 56.7, 53.3),
long          


        
3条回答
  •  后悔当初
    2021-02-08 11:31

    First you need a file containing coastlines of UK.

    You can use the method provided in this question to know whether a point falls inside the UK coastlines or outside.

    Then, for points that fall into the UK, you can compute the Haversine distance between them and the coast line points, to determine if they are in your 3 miles from the coast.

提交回复
热议问题