我想使用sf包裹在都柏林机场附近绘制一个110海里(海里)的圆圈.(稍后我将通过st_intersectADS-B的航班位置报告与之相交.)
我为NM定义了一个新单元如下:
library(units)
library(tidyverse)
library(sf)
NM <- make_unit("NM")
install_conversion_constant("NM", "km", 1.852)
Run Code Online (Sandbox Code Playgroud)
然后定义都柏林机场坐标:
# DUB/EIDW location, see
# https://skyvector.com/airport/EIDW/Dublin-Airport
# Coordinates:
# N53°25.28' / W6°16.20' (Degrees Decimal Minutes (DDM) format)
# (-6.27, 53.421333) (lon/lat Decimal Degrees (DD))
# Elevation: 242.0 feet (MSL)
dub_lon <- -6.27
dub_lat <- 53.421333
dub_elv <- set_units(242.0, ft)
dub <- st_point( x = c(dub_lon, dub_lat, dub_elv), dim = "XYZ")
dub <- dub %>% st_sfc(crs = 4326)
Run Code Online (Sandbox Code Playgroud)
因此,定义了机场周围的圆的半径(以米为单位):
r110 <- set_units(110, NM) %>% set_units(km) …Run Code Online (Sandbox Code Playgroud)