Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility `city_full_name` (omit to space) #22

Closed
uribo opened this issue Nov 20, 2018 · 2 comments
Closed

Incompatibility `city_full_name` (omit to space) #22

uribo opened this issue Nov 20, 2018 · 2 comments
Labels

Comments

@uribo
Copy link
Owner

@uribo uribo commented Nov 20, 2018

jpn_pref(download = ) の引数の指定により、 city_name_full の形式が異なる。

ex. 岡山市 北区岡山市北区, 勝田郡 勝央町勝田郡勝央町 (市と区、郡と町・村の間のスペースの有無)

library(jpndistrict)
#> Loading required package: jpmesh
#> This package provide map data is based on the Digital Map 25000
#> (Map Image) published by Geospatial Information Authority of Japan
#> (Approval No.603FY2017 information usage <http://www.gsi.go.jp>)
jpn_pref(33, download = FALSE)
#> Simple feature collection with 30 features and 4 fields
#> geometry type:  GEOMETRY
#> dimension:      XY
#> bbox:           xmin: 133.2667 ymin: 34.29839 xmax: 134.4132 ymax: 35.35286
#> epsg (SRID):    4326
#> proj4string:    +proj=longlat +datum=WGS84 +no_defs
#> # A tibble: 30 x 5
#>    pref_code prefecture city_code city                            geometry
#>    <chr>     <chr>      <chr>     <chr>                     <GEOMETRY [°]>
#>  1 33        岡山県     33101     岡山市 北区… POLYGON ((133.9098 34.948, 133.…
#>  2 33        岡山県     33102     岡山市 中区… MULTIPOLYGON (((133.9747 34.601…
#>  3 33        岡山県     33103     岡山市 東区… MULTIPOLYGON (((133.9958 34.613…
#>  4 33        岡山県     33104     岡山市 南区… MULTIPOLYGON (((133.9109 34.643…
#>  5 33        岡山県     33202     倉敷市  MULTIPOLYGON (((133.6414 34.504…
#>  6 33        岡山県     33203     津山市  POLYGON ((134.0871 35.30721, 13…
#>  7 33        岡山県     33204     玉野市  MULTIPOLYGON (((133.8985 34.456…
#>  8 33        岡山県     33205     笠岡市  MULTIPOLYGON (((133.5929 34.373…
#>  9 33        岡山県     33207     井原市  POLYGON ((133.3705 34.74212, 13…
#> 10 33        岡山県     33208     総社市  POLYGON ((133.6613 34.78109, 13…
#> # ... with 20 more rows
jpn_pref(33, download = TRUE)
#> options:        ENCODING=cp932 
#> Reading layer `N03-15_33_150101' from data source `/tmp/RtmpaPlFZK/33/N03-20150101_33_GML/N03-15_33_150101.shp' using driver `ESRI Shapefile'
#> Simple feature collection with 402 features and 5 fields
#> geometry type:  POLYGON
#> dimension:      XY
#> bbox:           xmin: 133.2668 ymin: 34.29833 xmax: 134.4132 ymax: 35.3529
#> epsg (SRID):    NA
#> proj4string:    +proj=longlat +ellps=GRS80 +no_defs
#> Simple feature collection with 78 features and 5 fields
#> geometry type:  POLYGON
#> dimension:      XY
#> bbox:           xmin: 133.2668 ymin: 34.29833 xmax: 134.4131 ymax: 35.35276
#> epsg (SRID):    4326
#> proj4string:    +proj=longlat +datum=WGS84 +no_defs
#> # A tibble: 78 x 6
#>    pref_name city_name_ city_name city_name_full city_code
#>    <chr>     <chr>      <chr>     <chr>          <chr>    
#>  1 岡山県    岡山市     北区      岡山市北区     33101    
#>  2 岡山県    岡山市     中区      岡山市中区     33102    
#>  3 岡山県    岡山市     東区      岡山市東区     33103    
#>  4 岡山県    岡山市     東区      岡山市東区     33103    
#>  5 岡山県    岡山市     東区      岡山市東区     33103    
#>  6 岡山県    岡山市     南区      岡山市南区     33104    
#>  7 岡山県    岡山市     南区      岡山市南区     33104    
#>  8 岡山県    <NA>       倉敷市    倉敷市         33202    
#>  9 岡山県    <NA>       倉敷市    倉敷市         33202    
#> 10 岡山県    <NA>       倉敷市    倉敷市         33202    
#> # ... with 68 more rows, and 1 more variable: geometry <POLYGON [°]>

Created on 2018-11-20 by the reprex package (v0.2.1)

@uribo uribo added the bug 💣 label Nov 20, 2018
@uribo
Copy link
Owner Author

@uribo uribo commented Nov 20, 2018

列の並びが違うのも問題?

@uribo
Copy link
Owner Author

@uribo uribo commented May 9, 2019

jpn_pref(download = TRUE) の時に city_name_full 列に対して cityname_reform() を適用。cityに名前を変更して、jpn_pref(download = FALSE) 時に合わせて列の並びを調整した。

library(jpndistrict)
#> Loading required package: jpmesh
#> This package provide map data is based on the Digital Map 25000
#> (Map Image) published by Geospatial Information Authority of Japan
#> (Approval No.603FY2017 information usage <http://www.gsi.go.jp>)
jpn_pref(33, download = FALSE)
#> Simple feature collection with 30 features and 4 fields
#> geometry type:  GEOMETRY
#> dimension:      XY
#> bbox:           xmin: 133.2667 ymin: 34.29839 xmax: 134.4132 ymax: 35.35286
#> epsg (SRID):    4326
#> proj4string:    +proj=longlat +datum=WGS84 +no_defs
#> # A tibble: 30 x 5
#>    pref_code prefecture city_code city                             geometry
#>    <chr>     <chr>      <chr>     <chr>                      <GEOMETRY [°]>
#>  1 33        岡山県     33101     岡山市 北区… POLYGON ((133.9098 34.948, 133.9…
#>  2 33        岡山県     33102     岡山市 中区… MULTIPOLYGON (((133.9747 34.6019…
#>  3 33        岡山県     33103     岡山市 東区… MULTIPOLYGON (((133.9958 34.6130…
#>  4 33        岡山県     33104     岡山市 南区… MULTIPOLYGON (((133.9109 34.6438…
#>  5 33        岡山県     33202     倉敷市  MULTIPOLYGON (((133.6414 34.5043…
#>  6 33        岡山県     33203     津山市  POLYGON ((134.0871 35.30721, 134…
#>  7 33        岡山県     33204     玉野市  MULTIPOLYGON (((133.8985 34.4566…
#>  8 33        岡山県     33205     笠岡市  MULTIPOLYGON (((133.5929 34.3739…
#>  9 33        岡山県     33207     井原市  POLYGON ((133.3705 34.74212, 133…
#> 10 33        岡山県     33208     総社市  POLYGON ((133.6613 34.78109, 133…
#> # … with 20 more rows
jpn_pref(33, download = TRUE)
#> options:        ENCODING=cp932 
#> Reading layer `N03-15_33_150101' from data source `/private/var/folders/79/85f_10c96bg65_s5y11ttxyc0000gp/T/Rtmp7V12fV/33/N03-20150101_33_GML/N03-15_33_150101.shp' using driver `ESRI Shapefile'
#> Simple feature collection with 402 features and 5 fields
#> geometry type:  POLYGON
#> dimension:      XY
#> bbox:           xmin: 133.2668 ymin: 34.29833 xmax: 134.4132 ymax: 35.3529
#> epsg (SRID):    4612
#> proj4string:    +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs
#> Simple feature collection with 80 features and 6 fields
#> geometry type:  POLYGON
#> dimension:      XY
#> bbox:           xmin: 133.2668 ymin: 34.29833 xmax: 134.4131 ymax: 35.35276
#> epsg (SRID):    4326
#> proj4string:    +proj=longlat +datum=WGS84 +no_defs
#> # A tibble: 80 x 7
#>    pref_code pref_name city_code city  city_name_ city_name
#>    <chr>     <chr>     <chr>     <chr> <chr>      <chr>    
#>  1 33        岡山県    33101     岡山市 … 岡山市     北区     
#>  2 33        岡山県    33102     岡山市 … 岡山市     中区     
#>  3 33        岡山県    33103     岡山市 … 岡山市     東区     
#>  4 33        岡山県    33103     岡山市 … 岡山市     東区     
#>  5 33        岡山県    33103     岡山市 … 岡山市     東区     
#>  6 33        岡山県    33103     岡山市 … 岡山市     東区     
#>  7 33        岡山県    33103     岡山市 … 岡山市     東区     
#>  8 33        岡山県    33104     岡山市 … 岡山市     南区     
#>  9 33        岡山県    33104     岡山市 … 岡山市     南区     
#> 10 33        岡山県    33202     倉敷市… <NA>       倉敷市   
#> # … with 70 more rows, and 1 more variable: geometry <POLYGON [°]>

Created on 2019-05-10 by the reprex package (v0.2.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.