Skip to contents

[Stable]

Return the nearest stations information to the given coordinates.

Usage

nearest_station(longitude, latitude, geometry = NULL)

pick_neighbor_stations(
  longitude,
  latitude,
  distance = 1,
  .unit = "m",
  geometry = NULL
)

pick_neighbor_tide_stations(
  year,
  longitude,
  latitude,
  distance = 100,
  .unit = "km",
  geometry = NULL
)

Arguments

longitude

Longitude.

latitude

Latitude.

geometry

XY sf::sf object.

distance

Distance from station to station to adjustment.

.unit

Unit used for extraction from the point of interest. Default m (meters). This value is passed to units::as_units.

year

For tide level data. Restricted to the observation points in the target year.

Value

an object of class sf.

Details

  • nearest_station(): Return single station data.

  • pick_neighbor_stations(): Pick-up neighbourhood stations.

  • pick_neighbor_tide_stations(): Pick-up neighbourhood tidal observation stations. Filter by distance from target point.

Examples

nearest_station(142.9313, 43.70417)
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 142.9167 ymin: 43.75 xmax: 142.9167 ymax: 43.75
#> Geodetic CRS:  WGS 84
#> # A tibble: 1 × 6
#>   area  station_no station_name block_no distance         geometry
#>   <chr>      <int> <chr>        <chr>         [m]      <POINT [°]>
#> 1 上川       12471 層雲峡       1049        5230. (142.9167 43.75)

pick_neighbor_stations(140.10, 36.08, 300000)
#> Simple feature collection with 394 features and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 136.8167 ymin: 34.07333 xmax: 141.45 ymax: 38.75
#> Geodetic CRS:  WGS 84
#> # A tibble: 394 × 6
#>    area  station_no station_name block_no distance            geometry
#>    <chr>      <int> <chr>        <chr>         [m]         <POINT [°]>
#>  1 茨城       40336 つくば       47646       3432.  (140.125 36.05667)
#>  2 茨城       40341 土浦         0324       10799. (140.2167 36.10333)
#>  3 茨城       40281 下妻         0322       17803. (139.9333 36.16667)
#>  4 茨城       40241 柿岡         1012       18619. (140.1833 36.23333)
#>  5 茨城       40326 坂東         0323       20109.   (139.8833 36.035)
#>  6 茨城       40231 下館         1530       23249. (139.9833 36.26667)
#>  7 茨城       40426 龍ケ崎       1014       23647.    (140.2 35.88333)
#>  8 茨城       40391 江戸崎       0911       24263.    (140.3167 35.95)
#>  9 千葉       45061 我孫子       0376       25591.      (140.11 35.85)
#> 10 茨城       40251 美野里       1013       25867. (140.3167 36.23333)
#> # ℹ 384 more rows

d <-
  pick_neighbor_stations(140.10, 36.08, 30, "km")
pick_neighbor_stations(geometry = sf::st_point(c(140.1833, 36.23333)),
                       distance = 100)
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 140.1833 ymin: 36.23333 xmax: 140.1833 ymax: 36.23333
#> Geodetic CRS:  WGS 84
#> # A tibble: 1 × 6
#>   area  station_no station_name block_no distance            geometry
#>   <chr>      <int> <chr>        <chr>         [m]         <POINT [°]>
#> 1 茨城       40241 柿岡         1012         3.01 (140.1833 36.23333)

pick_neighbor_tide_stations(longitude = 133.4375, latitude = 34.45833,
                            year = 2020,
                            distance = 100, .unit = "km")
#> Simple feature collection with 3 features and 7 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 132.7167 ymin: 33.86666 xmax: 134.05 ymax: 34.48333
#> Geodetic CRS:  WGS 84
#> # A tibble: 3 × 8
#>   year  id    stn   station_name address                  type   distance
#>   <chr> <chr> <chr> <chr>        <chr>                    <chr>       [m]
#> 1 2020  38    UN    宇野         岡山県 玉野市 宇野1丁目 電波式   47063.
#> 2 2020  40    TA    高松         香川県 高松市 北浜町     電波式   57470.
#> 3 2020  39    MT    松山         愛媛県 松山市 海岸通     電波式   93419.
#> # ℹ 1 more variable: geometry <POINT [°]>