uribo / jpndistrict

🗾 Create Japansese Administration Area Maps
http://uribo.github.io/jpndistrict
Other
22 stars 3 forks source link

Error: reverse geocoding functions #10

Closed uribo closed 6 years ago

uribo commented 6 years ago

いくつかの条件でエラーが発生。 ポリゴンに含まれない座標の場合には0行のデータが返却されてほしい

library(jpndistrict)
find_pref(longitude = 130.4412895, latitude = 30.2984335)
# Simple feature collection with 1 feature and 2 fields
# geometry type:  MULTIPOLYGON
# dimension:      XY
# bbox:           xmin: 128.3947 ymin: 27.01758 xmax: 131.2065 ymax: 32.31167
# epsg (SRID):    4326
# proj4string:    +proj=longlat +datum=WGS84 +no_defs
# # A tibble: 1 x 3
# pref_code prefecture          geometry
# <chr>      <chr>  <simple_feature>
#   1        46   鹿児島県 <MULTIPOLYGON...>

find_pref(125.2468750000, 24.7145833333)
# Error: `.x` is empty, and no `.init` supplied

# こっちのエラーは別物  
find_city(141.3468, 35.68949)
# Error: `.x` is empty, and no `.init` supplied
# In addition: Warning message:
#   In jpmesh::coords_to_mesh(longitude, latitude, mesh_size = "80km") :
#   Longitude / Latitude values is out of range.

find_pref()以外にも ラップしてるfind_cityでもエラーはおこる