diff --git a/.Rbuildignore b/.Rbuildignore index 33cc41e..91fb891 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,4 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..ed7650c --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index e4972eb..d4ec2b8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ README_cache/ .DS_Store *.Rapp.history +docs diff --git a/DESCRIPTION b/DESCRIPTION index 6586ce4..a5eaf1d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,6 +20,7 @@ Imports: httr, sf, progress -URL: https://github.com/e-kotov/wikimapR/ +URL: https://github.com/e-kotov/wikimapR/, + http://www.ekotov.pro/wikimapR/ BugReports: https://github.com/e-kotov/wikimapR/issues RoxygenNote: 7.2.3 diff --git a/_pkgdown.yml b/_pkgdown.yml index e7b4a7b..392de71 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: ~ +url: http://www.ekotov.pro/wikimapR/ template: bootstrap: 5 news: diff --git a/docs/404.html b/docs/404.html index 756abd4..c700d4c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,23 +6,23 @@ Page not found (404) • wikimapR - - - + + + - + - Skip to contents + Skip to contents
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 02fb855..15539f8 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,8 @@ pandoc: 2.19.2 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2023-05-14T11:10Z +last_built: 2023-05-14T14:05Z +urls: + reference: http://www.ekotov.pro/wikimapR/reference + article: http://www.ekotov.pro/wikimapR/articles diff --git a/docs/reference/wikimapR.html b/docs/reference/wikimapR.html index 29f8d1c..0ae6a29 100644 --- a/docs/reference/wikimapR.html +++ b/docs/reference/wikimapR.html @@ -59,6 +59,7 @@ diff --git a/docs/search.json b/docs/search.json index 32185b0..37b847f 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"The MIT License (MIT)","title":"The MIT License (MIT)","text":"Copyright © 2018 Egor Kotov Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Egor Kotov. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kotov (2018). wikimapR: Import Wikimapia Data Simple Features via API. DOI: 10.5281/zenodo.3459878. https://github.com/e-kotov/wikimapR Kotov E (2018). wikimapR: Import Wikimapia Data Simple Features via API. doi:10.5281/zenodo.3459878, R package version 0.1.2, https://github.com/e-kotov/wikimapR.","code":"@Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, doi = {10.5281/zenodo.3459878}, year = {2018}, url = {https://github.com/e-kotov/wikimapR}, } @Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, year = {2018}, note = {R package version 0.1.2}, doi = {10.5281/zenodo.3459878}, url = {https://github.com/e-kotov/wikimapR}, }"},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Import Wikimapia Data as Simple Features via API","text":"install: load package check version: Load additional packages:","code":"# Install the development version # install.packages(\"remotes\") remotes::install_github(\"e-kotov/wikimapR\") library(wikimapR) packageVersion(\"wikimapR\") #> [1] '0.1.2' library(sf) library(magrittr) library(dplyr) library(purrr) library(progress)"},{"path":"/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Import Wikimapia Data as Simple Features via API","text":"Set API key. API key ‘example’ ’s used testing page https://wikimapia.org/api/?action=examples. limited one request every 30 seconds. Get API key https://wikimapia.org/api/?action=my_keys get 100 requests 5 minutes.","code":"# change to your own key set_wikimapia_api_key(\"your_key\") # set_wikimapia_api_key(\"example) # use 'example' key with 1 request per 30 seconds rate limit"},{"path":"/index.html","id":"choose-a-bbox","dir":"","previous_headings":"Usage","what":"Choose a bbox","title":"Import Wikimapia Data as Simple Features via API","text":"look https://boundingbox.klokantech.com choose bounding box. example: -1.617122,53.764541,-1.467519,53.831568 Leeds ’s surroundings.","code":"bbox <- c(-1.669629,53.739816,-1.422465,53.869239) # Leeds"},{"path":"/index.html","id":"get-the-number-of-objects-in-this-bounding-box","dir":"","previous_headings":"Usage","what":"Get the number of objects in this bounding box","title":"Import Wikimapia Data as Simple Features via API","text":"Use box API function get number features area interest. Now know many objects bounding box. page count parameters Wikimapia API, request objects bounding box beyond 10 000 matter high set page parameter. subdivide large bounding box smaller bounding boxes maximum 10 000 objects .","code":"wm <- wm_get_from_bbox(x = bbox, get_location = FALSE, meta_only = TRUE) wm$found #> [1] 1320"},{"path":"/index.html","id":"subdivide-the-bounding-box-into-smaller-ones","dir":"","previous_headings":"Usage","what":"Subdivide the bounding box into smaller ones","title":"Import Wikimapia Data as Simple Features via API","text":"subdivide_bbox() subdivides large bounding box smaller ones returns sf polygons, bbox objects . good large areas defaults tuned cities like Moscow. example bounding box cell size degrees (need somehow fix work meters across globe). Default 0.045 degrees reasonably large, roughly equivalent 2845x5010 meters. proved fit < 10 000 objects per cell Moscow, density objects quite high. less object-dense cities may able get away larger grid bounding boxes. ideal convenient create subdivision using precise metric, fine now.","code":"small_bboxes <- subdivide_bbox(x = bbox, bbox_cell_size = 0.1, return_bbox_or_sf = \"both\") #> 6 bounding boxes created with approximate cell size of 6577x11120 meters. plot(small_bboxes$sf$geometry)"},{"path":"/index.html","id":"check-then-number-of-objects-per-cell","dir":"","previous_headings":"Usage","what":"Check then number of objects per cell","title":"Import Wikimapia Data as Simple Features via API","text":"Just sure every bounding box generated <= 10 000 objects, let us query bounding boxes. current example 6 take 3 minutes, “example” API key cool-30 seconds. Now look histogram number objects small bounding boxes maximum value: Since maximum well within 10 000, can proceed collect objects IDs download attributes individual features. download detailed objects features one--one box API returns object ID, name URL. strategy getting object details make list object IDs using box API use place.getbyid.","code":"# get objects in every bbox, but no need to get the location for now objects_in_bboxes <- small_bboxes$bbox %>% purrr::map( ~wm_get_from_bbox(x = .x, get_location = FALSE), .progress = T ) n_by_bbox <- objects_in_bboxes %>% purrr::map_int(~ .x$meta$found) # extract the number of found objects for every bounding box max(n_by_bbox) #> [1] 718 hist(n_by_bbox)"},{"path":"/index.html","id":"create-a-list-of-ids-to-fetch","dir":"","previous_headings":"Usage","what":"Create a list of IDs to fetch","title":"Import Wikimapia Data as Simple Features via API","text":"Now list 461 object IDs want get details .","code":"id_list <- objects_in_bboxes %>% purrr::map(~ .x$df$id) %>% # pull object IDs from individual bbox query results data.frames unlist() # bind together str(id_list) #> chr [1:461] \"1869857\" \"25258348\" \"14406815\" \"25257158\" \"25259631\" ... head(id_list) #> [1] \"1869857\" \"25258348\" \"14406815\" \"25257158\" \"25259631\" \"14406851\""},{"path":"/index.html","id":"get-detailed-data-for-wikimapia-objects","dir":"","previous_headings":"Usage","what":"Get detailed data for Wikimapia objects","title":"Import Wikimapia Data as Simple Features via API","text":"Let’s take just 3 first objects example. take 1.5 minutes fetch details using ‘example’ API.","code":"short_list <- id_list[1:3] wm_objects <- wm_get_by_id(ids = short_list)"},{"path":"/index.html","id":"we-have-the-objects","dir":"","previous_headings":"Usage","what":"We have the objects!","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"str(wm_objects, max.level = 1, nchar.max = 50) #> Classes 'sf' and 'data.frame': 3 obs. of 25 variables: #> $ id : int 1869857 25258348 14406815 #> $ object_type : int 1 1 1 #> $ language_id : int 0 0 0 #> $ language_iso : chr \"en\" \"en\" \"en\" #> $ language_name : chr \"English\" \"English\" \"English\" #> $ urlhtml : chr \" $ title : chr \"Pudsey\" \"Farnley\" \"Morley\" #> $ description : chr \"Pudsey is a market town in West Y\"| __truncated__ \"District of the city of Leeds.\" \"The small West Yorkshire town of \"| __truncated__ #> $ wikipedia : chr \"http://en.wikipedia.org/wiki/Pudsey\" \"http://en.wikipedia.org/wiki/Farnley,_Leeds\" \"http://en.wikipedia.org/wiki/morley\" #> $ is_building : logi FALSE FALSE FALSE #> $ is_region : logi FALSE FALSE FALSE #> $ is_deleted : logi FALSE FALSE FALSE #> $ parent_id : chr \"0\" \"0\" \"0\" #> $ x : chr \"-16639084\" \"-16233262\" \"-15956783\" #> $ y : chr \"537924232\" \"537853660\" \"537441159\" #> $ pl : num 32078 25832 22310 #> $ is_protected : logi FALSE FALSE FALSE #> $ user_id : chr \"904949\" \"904949\" \"539863\" #> $ user_name : chr \"Timea\" \"Timea\" \"jagpalpur\" #> $ date : chr \"1427742742\" \"1427742836\" \"1258319330\" #> $ deletion_state : chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ is_in_deletion_queue : chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ is_in_undeletion_queue: chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ details :List of 3 #> $ geometry :sfc_POLYGON of length 3; first list element: List of 1 #> ..- attr(*, \"class\")= chr [1:3] \"XY\" \"POLYGON\" \"sfg\" #> - attr(*, \"sf_column\")= chr \"geometry\" #> - attr(*, \"agr\")= Factor w/ 3 levels \"constant\",\"aggregate\",..: NA NA NA NA NA NA NA NA NA NA ... #> ..- attr(*, \"names\")= chr [1:24] \"id\" \"object_type\" \"language_id\" \"language_iso\" ..."},{"path":"/index.html","id":"we-can-now-plot-them","dir":"","previous_headings":"Usage > We have the objects!","what":"We can now plot them","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"plot(wm_objects$geometry)"},{"path":"/index.html","id":"we-can-explore-the-attributes","dir":"","previous_headings":"Usage > We have the objects!","what":"We can explore the attributes","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"names(wm_objects) #> [1] \"id\" \"object_type\" \"language_id\" #> [4] \"language_iso\" \"language_name\" \"urlhtml\" #> [7] \"title\" \"description\" \"wikipedia\" #> [10] \"is_building\" \"is_region\" \"is_deleted\" #> [13] \"parent_id\" \"x\" \"y\" #> [16] \"pl\" \"is_protected\" \"user_id\" #> [19] \"user_name\" \"date\" \"deletion_state\" #> [22] \"is_in_deletion_queue\" \"is_in_undeletion_queue\" \"details\" #> [25] \"geometry\""},{"path":"/index.html","id":"most-of-the-details-are-currently-in-a-nested-list-for-every-object","dir":"","previous_headings":"Usage > We have the objects!","what":"Most of the details are currently in a nested list for every object","title":"Import Wikimapia Data as Simple Features via API","text":"can use purrr /rlist packages pull details nested lists.","code":"str(wm_objects$details[[1]], max.level = 1) #> List of 5 #> $ tags :List of 1 #> $ photos : list() #> $ comments : list() #> $ location :List of 15 #> $ availableLanguages:List of 1"},{"path":"/index.html","id":"to-do-list","dir":"","previous_headings":"","what":"To-Do List","title":"Import Wikimapia Data as Simple Features via API","text":"Rewrite subdivide_bbox() accept metric values bbox dimensions (critical, may useful projects) Create helper functions abstract user calls purrr simple things like getting number found objects, getting number objects per bounding box (see examples Usage section) Create hidden environment variable storing API key using automatically package functions Implement rest Wikimapia API functions Fix bugs Make code robust Write unit tests suggestions welcome via GitHub issues package Submit package CRAN someday..?","code":""},{"path":"/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Import Wikimapia Data as Simple Features via API","text":"cite wikimapR publications, please use: Kotov (2018). wikimapR: Import Wikimapia Data Simple Features via API. DOI: 10.5281/zenodo.3459878. https://github.com/e-kotov/wikimapR BibTeX entry LaTeX users :","code":"citation(\"wikimapR\") print(citation(\"wikimapR\"), bibtex=TRUE) @Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, doi = {10.5281/zenodo.3459878}, year = {2018}, url = {https://github.com/e-kotov/wikimapR}, }"},{"path":"/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Import Wikimapia Data as Simple Features via API","text":"MIT License (MIT) + License File Copyright © 2018 Egor Kotov Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"/paper.html","id":null,"dir":"","previous_headings":"","what":"Summary","title":"Summary","text":"proof concept integration GitHub [@GitHub] repo figshare [@figshare] effort get DOI GitHub repository. repository tagged release GitHub, Fidgit [@Fidgit] import release figshare thus giving code bundle DOI. somewhat meta fashion, Fidgit publishing figshare DOI ‘https://doi.org/10.6084/m9.figshare.828487’ [@figshare_archive].","code":""},{"path":[]},{"path":"/reference/set_wikimapia_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Wikimapia API Key — set_wikimapia_api_key","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"Sets API key make available wikimapR functions calls. See details","code":""},{"path":"/reference/set_wikimapia_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"","code":"set_wikimapia_api_key(api_key)"},{"path":"/reference/set_wikimapia_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"api_key Wikimapia API key","code":""},{"path":"/reference/set_wikimapia_api_key.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"Use set_wikimapia_api_key make API keys available Wikimapia API calls session keep specifying wm_api_key argument time.","code":""},{"path":"/reference/set_wikimapia_api_key.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"mapdeck https://github.com/SymbolixAU/mapdeck code related API key handling used template.","code":""},{"path":"/reference/subdivide_bbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Subdivide large bounding box into smaller ones — subdivide_bbox","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"Subdivide large bounding box smaller ones.","code":""},{"path":"/reference/subdivide_bbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"","code":"subdivide_bbox( x, bbox_cell_size = 0.045, return_bbox_or_sf = \"bbox\", out_crs = 4326 )"},{"path":"/reference/subdivide_bbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"x numeric vector length four, xmin, ymin, xmax ymax values; `bbox` object output st_bbox. values must WGS 84 (EPSG 4326) bbox_cell_size bounding box cell size degrees (need somehow fix work meters across globe). Default 0.045 reasonably large, roughly equivalent 2845x5010 meters. grid created WGS84 coordinate reference system transformed CRS set `out_crs`, also WGS84 default (EPSG:4326). return_bbox_or_sf object type retun. set default \"bbox\", returns objects type `bbox`, \"sf\" - returns `sf polygons` (good plotting), \"\" - returns list length 2 `bbox` `sf` named accorgingly. out_crs EPSG code proj4 string desired coordinate reference system output bounding box coordinates. grid created WGS84 coordinate reference system transformed CRS set `out_crs`. Default value 4326 WGS84.","code":""},{"path":"/reference/subdivide_bbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"`sf` object grid consequtive IDs. Also prints message number bounding boxes average cell dimensions meters.","code":""},{"path":"/reference/wikimapR.html","id":null,"dir":"Reference","previous_headings":"","what":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","title":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","text":"Download import 'Wikimapia' data 'sf' objects. 'Wikimapia' data extracted via 'Wikimapia' API converted `sf` objects retaining recevied fields.","code":""},{"path":[]},{"path":"/reference/wikimapR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","text":"Egor Kotov kotov.egor@gmail.com","code":""},{"path":"/reference/wm_get_by_id.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Wikimapia Objects by ID — wm_get_by_id","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"Retrieves Wikimapia objects ID.","code":""},{"path":"/reference/wm_get_by_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"","code":"wm_get_by_id( ids, language = \"en\", wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), data_blocks = \"main,geometry,edit,location,attached,photos,comments,translate\" )"},{"path":"/reference/wm_get_by_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"ids numeric character vector Wikimapia object IDs fetch. can get list objects fetch using wm_get_from_bbox language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . data_blocks comma-separated blocks data want return: main, geometry, edit, location, attached, photos, comments, translate, similar_places, nearest_places, nearest_comments, nearest_streets, nearest_hotels. Default \"main,geometry,edit,location,attached,photos,comments,translate\".","code":""},{"path":"/reference/wm_get_by_id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"`sf` objects nested details.","code":""},{"path":"/reference/wm_get_by_id.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"Uses [`place.getbyid`](http://wikimapia.org/api#placegetbyid) Wikimapia API function retrieve full object details.","code":""},{"path":"/reference/wm_get_by_id_single.html","id":null,"dir":"Reference","previous_headings":"","what":"Get one Wikimapia object by ID — wm_get_by_id_single","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"Retrieves single Wikimapia object ID.","code":""},{"path":"/reference/wm_get_by_id_single.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"","code":"wm_get_by_id_single( id, language = \"en\", wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), data_blocks = \"main,geometry,edit,location,attached,photos,comments,translate\" )"},{"path":"/reference/wm_get_by_id_single.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"id numeric characted vector length 1 Wikimapia object ID fetch. can get list objects fetch using wm_get_from_bbox language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . data_blocks comma-separated blocks data want return: main, geometry, edit, location, attached, photos, comments, translate, similar_places, nearest_places, nearest_comments, nearest_streets, nearest_hotels. Default \"main,geometry,edit,location,attached,photos,comments,translate\".","code":""},{"path":"/reference/wm_get_by_id_single.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"`sf` object nested details.","code":""},{"path":"/reference/wm_get_by_id_single.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"Uses [`place.getbyid`](http://wikimapia.org/api#placegetbyid) Wikimapia API function retrieve full object details.","code":""},{"path":"/reference/wm_get_from_bbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"Retrieves objects given boundary box either without geometry. May also fetch just metadata.","code":""},{"path":"/reference/wm_get_from_bbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"","code":"wm_get_from_bbox( x, page = 1, n_per_page = 100, language = \"en\", category = NULL, get_location = TRUE, wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), meta_only = FALSE )"},{"path":"/reference/wm_get_from_bbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"x numeric vector length 4, xmin, ymin, xmax ymax values; `bbox` object output st_bbox. values must WGS 84 (EPSG 4326) page page number. 1 default. usually objects bounding box limit 100 objects per page. Therefore need specify page 1 get objects. returned list object contains number found features required number pages retrieve . n_per_page variable determines number results per page. 100 default (5 min, 100 max). `count` parameter Wikimapia terminilogy, different name used conflict `dplyr::count()` function. language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. category wikimapia category code: category=17 - Shop, category=203 - School etc. (detailed list published later) category text query UTF-8: category=School, category=Church etc. Default NULL get categories. get_location Specifies whether get location (centroid) polygon geometry. may want disable using wm_get_from_bbox estimate number objects reduce returned object size. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . meta_only return metadata response, return feature attributes geometry.","code":""},{"path":"/reference/wm_get_from_bbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"`meta_only = FALSE` returns list data.frame object attributes (object geometry `get_location = TRUE`). `meta_only = TRUE` returns metadata responce: number objects bounding box (`found`), version, language, current page, current `n_per_page`. `get_location = TRUE` returns list object `sf polygons` object attributes, `sf points` object attributes (centroids), also metadata described .","code":""},{"path":"/reference/wm_get_from_bbox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"Currenlty supports bbox parameter, &lon_min, &lat_min, &lon_max, &lat_max &x, &y, &z tiles. `Box`` endpoint claimed deprecated, `Place.Getbyarea` seem work properly.","code":""},{"path":[]},{"path":"/news/index.html","id":"new-features-0-1-2","dir":"Changelog","previous_headings":"","what":"New features","title":"wikimapR 0.1.2 (2023-05-14)","text":"Added set_wikimapia_api_key() make API keys available Wikimapia API calls session don’t keep specifying wm_api_key argument time","code":""},{"path":"/news/index.html","id":"breaking-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"wikimapR 0.1.2 (2023-05-14)","text":"wm_get_by_id() changed main argument x ids. intuitive, since function accepts vectors length > 1. also nwo easier debug code. Help section fixed accordingly","code":""},{"path":"/news/index.html","id":"minor-improvements-and-fixes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"wikimapR 0.1.2 (2023-05-14)","text":"Fixed issue/bug #1 (errors due deprecation dplyr::progress_estimated() ) Removed unneeded dependencies (lwgeom, rlist), add progress dependency due deprecation dplyr::progress_estimated()","code":""},{"path":"/news/index.html","id":"wikimapr-011-2018-12-17","dir":"Changelog","previous_headings":"","what":"wikimapR 0.1.1 (2018-12-17)","title":"wikimapR 0.1.1 (2018-12-17)","text":"Initial public release","code":""}] +[{"path":"http://www.ekotov.pro/wikimapR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"The MIT License (MIT)","title":"The MIT License (MIT)","text":"Copyright © 2018 Egor Kotov Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://www.ekotov.pro/wikimapR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Egor Kotov. Author, maintainer.","code":""},{"path":"http://www.ekotov.pro/wikimapR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kotov (2018). wikimapR: Import Wikimapia Data Simple Features via API. DOI: 10.5281/zenodo.3459878. https://github.com/e-kotov/wikimapR Kotov E (2018). wikimapR: Import Wikimapia Data Simple Features via API. doi:10.5281/zenodo.3459878, R package version 0.1.2, https://github.com/e-kotov/wikimapR.","code":"@Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, doi = {10.5281/zenodo.3459878}, year = {2018}, url = {https://github.com/e-kotov/wikimapR}, } @Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, year = {2018}, note = {R package version 0.1.2}, doi = {10.5281/zenodo.3459878}, url = {https://github.com/e-kotov/wikimapR}, }"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Import Wikimapia Data as Simple Features via API","text":"install: load package check version: Load additional packages:","code":"# Install the development version # install.packages(\"remotes\") remotes::install_github(\"e-kotov/wikimapR\") library(wikimapR) packageVersion(\"wikimapR\") #> [1] '0.1.2' library(sf) library(magrittr) library(dplyr) library(purrr) library(progress)"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Import Wikimapia Data as Simple Features via API","text":"Set API key. API key ‘example’ ’s used testing page https://wikimapia.org/api/?action=examples. limited one request every 30 seconds. Get API key https://wikimapia.org/api/?action=my_keys get 100 requests 5 minutes.","code":"# change to your own key set_wikimapia_api_key(\"your_key\") # set_wikimapia_api_key(\"example) # use 'example' key with 1 request per 30 seconds rate limit"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"choose-a-bbox","dir":"","previous_headings":"Usage","what":"Choose a bbox","title":"Import Wikimapia Data as Simple Features via API","text":"look https://boundingbox.klokantech.com choose bounding box. example: -1.617122,53.764541,-1.467519,53.831568 Leeds ’s surroundings.","code":"bbox <- c(-1.669629,53.739816,-1.422465,53.869239) # Leeds"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"get-the-number-of-objects-in-this-bounding-box","dir":"","previous_headings":"Usage","what":"Get the number of objects in this bounding box","title":"Import Wikimapia Data as Simple Features via API","text":"Use box API function get number features area interest. Now know many objects bounding box. page count parameters Wikimapia API, request objects bounding box beyond 10 000 matter high set page parameter. subdivide large bounding box smaller bounding boxes maximum 10 000 objects .","code":"wm <- wm_get_from_bbox(x = bbox, get_location = FALSE, meta_only = TRUE) wm$found #> [1] 1320"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"subdivide-the-bounding-box-into-smaller-ones","dir":"","previous_headings":"Usage","what":"Subdivide the bounding box into smaller ones","title":"Import Wikimapia Data as Simple Features via API","text":"subdivide_bbox() subdivides large bounding box smaller ones returns sf polygons, bbox objects . good large areas defaults tuned cities like Moscow. example bounding box cell size degrees (need somehow fix work meters across globe). Default 0.045 degrees reasonably large, roughly equivalent 2845x5010 meters. proved fit < 10 000 objects per cell Moscow, density objects quite high. less object-dense cities may able get away larger grid bounding boxes. ideal convenient create subdivision using precise metric, fine now.","code":"small_bboxes <- subdivide_bbox(x = bbox, bbox_cell_size = 0.1, return_bbox_or_sf = \"both\") #> 6 bounding boxes created with approximate cell size of 6577x11120 meters. plot(small_bboxes$sf$geometry)"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"check-then-number-of-objects-per-cell","dir":"","previous_headings":"Usage","what":"Check then number of objects per cell","title":"Import Wikimapia Data as Simple Features via API","text":"Just sure every bounding box generated <= 10 000 objects, let us query bounding boxes. current example 6 take 3 minutes, “example” API key cool-30 seconds. Now look histogram number objects small bounding boxes maximum value: Since maximum well within 10 000, can proceed collect objects IDs download attributes individual features. download detailed objects features one--one box API returns object ID, name URL. strategy getting object details make list object IDs using box API use place.getbyid.","code":"# get objects in every bbox, but no need to get the location for now objects_in_bboxes <- small_bboxes$bbox %>% purrr::map( ~wm_get_from_bbox(x = .x, get_location = FALSE), .progress = T ) n_by_bbox <- objects_in_bboxes %>% purrr::map_int(~ .x$meta$found) # extract the number of found objects for every bounding box max(n_by_bbox) #> [1] 718 hist(n_by_bbox)"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"create-a-list-of-ids-to-fetch","dir":"","previous_headings":"Usage","what":"Create a list of IDs to fetch","title":"Import Wikimapia Data as Simple Features via API","text":"Now list 461 object IDs want get details .","code":"id_list <- objects_in_bboxes %>% purrr::map(~ .x$df$id) %>% # pull object IDs from individual bbox query results data.frames unlist() # bind together str(id_list) #> chr [1:461] \"1869857\" \"25258348\" \"14406815\" \"25257158\" \"25259631\" ... head(id_list) #> [1] \"1869857\" \"25258348\" \"14406815\" \"25257158\" \"25259631\" \"14406851\""},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"get-detailed-data-for-wikimapia-objects","dir":"","previous_headings":"Usage","what":"Get detailed data for Wikimapia objects","title":"Import Wikimapia Data as Simple Features via API","text":"Let’s take just 3 first objects example. take 1.5 minutes fetch details using ‘example’ API.","code":"short_list <- id_list[1:3] wm_objects <- wm_get_by_id(ids = short_list)"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"we-have-the-objects","dir":"","previous_headings":"Usage","what":"We have the objects!","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"str(wm_objects, max.level = 1, nchar.max = 50) #> Classes 'sf' and 'data.frame': 3 obs. of 25 variables: #> $ id : int 1869857 25258348 14406815 #> $ object_type : int 1 1 1 #> $ language_id : int 0 0 0 #> $ language_iso : chr \"en\" \"en\" \"en\" #> $ language_name : chr \"English\" \"English\" \"English\" #> $ urlhtml : chr \" $ title : chr \"Pudsey\" \"Farnley\" \"Morley\" #> $ description : chr \"Pudsey is a market town in West Y\"| __truncated__ \"District of the city of Leeds.\" \"The small West Yorkshire town of \"| __truncated__ #> $ wikipedia : chr \"http://en.wikipedia.org/wiki/Pudsey\" \"http://en.wikipedia.org/wiki/Farnley,_Leeds\" \"http://en.wikipedia.org/wiki/morley\" #> $ is_building : logi FALSE FALSE FALSE #> $ is_region : logi FALSE FALSE FALSE #> $ is_deleted : logi FALSE FALSE FALSE #> $ parent_id : chr \"0\" \"0\" \"0\" #> $ x : chr \"-16639084\" \"-16233262\" \"-15956783\" #> $ y : chr \"537924232\" \"537853660\" \"537441159\" #> $ pl : num 32078 25832 22310 #> $ is_protected : logi FALSE FALSE FALSE #> $ user_id : chr \"904949\" \"904949\" \"539863\" #> $ user_name : chr \"Timea\" \"Timea\" \"jagpalpur\" #> $ date : chr \"1427742742\" \"1427742836\" \"1258319330\" #> $ deletion_state : chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ is_in_deletion_queue : chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ is_in_undeletion_queue: chr \"FALSE\" \"FALSE\" \"FALSE\" #> $ details :List of 3 #> $ geometry :sfc_POLYGON of length 3; first list element: List of 1 #> ..- attr(*, \"class\")= chr [1:3] \"XY\" \"POLYGON\" \"sfg\" #> - attr(*, \"sf_column\")= chr \"geometry\" #> - attr(*, \"agr\")= Factor w/ 3 levels \"constant\",\"aggregate\",..: NA NA NA NA NA NA NA NA NA NA ... #> ..- attr(*, \"names\")= chr [1:24] \"id\" \"object_type\" \"language_id\" \"language_iso\" ..."},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"we-can-now-plot-them","dir":"","previous_headings":"Usage > We have the objects!","what":"We can now plot them","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"plot(wm_objects$geometry)"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"we-can-explore-the-attributes","dir":"","previous_headings":"Usage > We have the objects!","what":"We can explore the attributes","title":"Import Wikimapia Data as Simple Features via API","text":"","code":"names(wm_objects) #> [1] \"id\" \"object_type\" \"language_id\" #> [4] \"language_iso\" \"language_name\" \"urlhtml\" #> [7] \"title\" \"description\" \"wikipedia\" #> [10] \"is_building\" \"is_region\" \"is_deleted\" #> [13] \"parent_id\" \"x\" \"y\" #> [16] \"pl\" \"is_protected\" \"user_id\" #> [19] \"user_name\" \"date\" \"deletion_state\" #> [22] \"is_in_deletion_queue\" \"is_in_undeletion_queue\" \"details\" #> [25] \"geometry\""},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"most-of-the-details-are-currently-in-a-nested-list-for-every-object","dir":"","previous_headings":"Usage > We have the objects!","what":"Most of the details are currently in a nested list for every object","title":"Import Wikimapia Data as Simple Features via API","text":"can use purrr /rlist packages pull details nested lists.","code":"str(wm_objects$details[[1]], max.level = 1) #> List of 5 #> $ tags :List of 1 #> $ photos : list() #> $ comments : list() #> $ location :List of 15 #> $ availableLanguages:List of 1"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"to-do-list","dir":"","previous_headings":"","what":"To-Do List","title":"Import Wikimapia Data as Simple Features via API","text":"Rewrite subdivide_bbox() accept metric values bbox dimensions (critical, may useful projects) Create helper functions abstract user calls purrr simple things like getting number found objects, getting number objects per bounding box (see examples Usage section) Create hidden environment variable storing API key using automatically package functions Implement rest Wikimapia API functions Fix bugs Make code robust Write unit tests suggestions welcome via GitHub issues package Submit package CRAN someday..?","code":""},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Import Wikimapia Data as Simple Features via API","text":"cite wikimapR publications, please use: Kotov (2018). wikimapR: Import Wikimapia Data Simple Features via API. DOI: 10.5281/zenodo.3459878. https://github.com/e-kotov/wikimapR BibTeX entry LaTeX users :","code":"citation(\"wikimapR\") print(citation(\"wikimapR\"), bibtex=TRUE) @Manual{, title = {wikimapR: Import Wikimapia Data as Simple Features via API}, author = {Egor Kotov}, doi = {10.5281/zenodo.3459878}, year = {2018}, url = {https://github.com/e-kotov/wikimapR}, }"},{"path":"http://www.ekotov.pro/wikimapR/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Import Wikimapia Data as Simple Features via API","text":"MIT License (MIT) + License File Copyright © 2018 Egor Kotov Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://www.ekotov.pro/wikimapR/paper.html","id":null,"dir":"","previous_headings":"","what":"Summary","title":"Summary","text":"proof concept integration GitHub [@GitHub] repo figshare [@figshare] effort get DOI GitHub repository. repository tagged release GitHub, Fidgit [@Fidgit] import release figshare thus giving code bundle DOI. somewhat meta fashion, Fidgit publishing figshare DOI ‘https://doi.org/10.6084/m9.figshare.828487’ [@figshare_archive].","code":""},{"path":[]},{"path":"http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Wikimapia API Key — set_wikimapia_api_key","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"Sets API key make available wikimapR functions calls. See details","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"","code":"set_wikimapia_api_key(api_key)"},{"path":"http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"api_key Wikimapia API key","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"Use set_wikimapia_api_key make API keys available Wikimapia API calls session keep specifying wm_api_key argument time.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set Wikimapia API Key — set_wikimapia_api_key","text":"mapdeck https://github.com/SymbolixAU/mapdeck code related API key handling used template.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/subdivide_bbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Subdivide large bounding box into smaller ones — subdivide_bbox","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"Subdivide large bounding box smaller ones.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/subdivide_bbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"","code":"subdivide_bbox( x, bbox_cell_size = 0.045, return_bbox_or_sf = \"bbox\", out_crs = 4326 )"},{"path":"http://www.ekotov.pro/wikimapR/reference/subdivide_bbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"x numeric vector length four, xmin, ymin, xmax ymax values; `bbox` object output st_bbox. values must WGS 84 (EPSG 4326) bbox_cell_size bounding box cell size degrees (need somehow fix work meters across globe). Default 0.045 reasonably large, roughly equivalent 2845x5010 meters. grid created WGS84 coordinate reference system transformed CRS set `out_crs`, also WGS84 default (EPSG:4326). return_bbox_or_sf object type retun. set default \"bbox\", returns objects type `bbox`, \"sf\" - returns `sf polygons` (good plotting), \"\" - returns list length 2 `bbox` `sf` named accorgingly. out_crs EPSG code proj4 string desired coordinate reference system output bounding box coordinates. grid created WGS84 coordinate reference system transformed CRS set `out_crs`. Default value 4326 WGS84.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/subdivide_bbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subdivide large bounding box into smaller ones — subdivide_bbox","text":"`sf` object grid consequtive IDs. Also prints message number bounding boxes average cell dimensions meters.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wikimapR.html","id":null,"dir":"Reference","previous_headings":"","what":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","title":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","text":"Download import 'Wikimapia' data 'sf' objects. 'Wikimapia' data extracted via 'Wikimapia' API converted `sf` objects retaining recevied fields.","code":""},{"path":[]},{"path":"http://www.ekotov.pro/wikimapR/reference/wikimapR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import 'Wikimapia' Data as Simple Features via API — wikimapR","text":"Egor Kotov kotov.egor@gmail.com","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Wikimapia Objects by ID — wm_get_by_id","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"Retrieves Wikimapia objects ID.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"","code":"wm_get_by_id( ids, language = \"en\", wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), data_blocks = \"main,geometry,edit,location,attached,photos,comments,translate\" )"},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"ids numeric character vector Wikimapia object IDs fetch. can get list objects fetch using wm_get_from_bbox language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . data_blocks comma-separated blocks data want return: main, geometry, edit, location, attached, photos, comments, translate, similar_places, nearest_places, nearest_comments, nearest_streets, nearest_hotels. Default \"main,geometry,edit,location,attached,photos,comments,translate\".","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"`sf` objects nested details.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Wikimapia Objects by ID — wm_get_by_id","text":"Uses [`place.getbyid`](http://wikimapia.org/api#placegetbyid) Wikimapia API function retrieve full object details.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html","id":null,"dir":"Reference","previous_headings":"","what":"Get one Wikimapia object by ID — wm_get_by_id_single","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"Retrieves single Wikimapia object ID.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"","code":"wm_get_by_id_single( id, language = \"en\", wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), data_blocks = \"main,geometry,edit,location,attached,photos,comments,translate\" )"},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"id numeric characted vector length 1 Wikimapia object ID fetch. can get list objects fetch using wm_get_from_bbox language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . data_blocks comma-separated blocks data want return: main, geometry, edit, location, attached, photos, comments, translate, similar_places, nearest_places, nearest_comments, nearest_streets, nearest_hotels. Default \"main,geometry,edit,location,attached,photos,comments,translate\".","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"`sf` object nested details.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get one Wikimapia object by ID — wm_get_by_id_single","text":"Uses [`place.getbyid`](http://wikimapia.org/api#placegetbyid) Wikimapia API function retrieve full object details.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"Retrieves objects given boundary box either without geometry. May also fetch just metadata.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"","code":"wm_get_from_bbox( x, page = 1, n_per_page = 100, language = \"en\", category = NULL, get_location = TRUE, wm_api_key = getOption(\"wikimapia_api_key\", default = \"example\"), meta_only = FALSE )"},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"x numeric vector length 4, xmin, ymin, xmax ymax values; `bbox` object output st_bbox. values must WGS 84 (EPSG 4326) page page number. 1 default. usually objects bounding box limit 100 objects per page. Therefore need specify page 1 get objects. returned list object contains number found features required number pages retrieve . n_per_page variable determines number results per page. 100 default (5 min, 100 max). `count` parameter Wikimapia terminilogy, different name used conflict `dplyr::count()` function. language Wikimapia language retrieve. specified language ISO 639-1 format. Default language 'en'. category wikimapia category code: category=17 - Shop, category=203 - School etc. (detailed list published later) category text query UTF-8: category=School, category=Church etc. Default NULL get categories. get_location Specifies whether get location (centroid) polygon geometry. may want disable using wm_get_from_bbox estimate number objects reduce returned object size. wm_api_key wikimapia API Key. specified, default 'example' key used, however limited 1 request per 30 seconds testing purposes . meta_only return metadata response, return feature attributes geometry.","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"`meta_only = FALSE` returns list data.frame object attributes (object geometry `get_location = TRUE`). `meta_only = TRUE` returns metadata responce: number objects bounding box (`found`), version, language, current page, current `n_per_page`. `get_location = TRUE` returns list object `sf polygons` object attributes, `sf points` object attributes (centroids), also metadata described .","code":""},{"path":"http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Wikimapia Objects in a Bounding Box — wm_get_from_bbox","text":"Currenlty supports bbox parameter, &lon_min, &lat_min, &lon_max, &lat_max &x, &y, &z tiles. `Box`` endpoint claimed deprecated, `Place.Getbyarea` seem work properly.","code":""},{"path":[]},{"path":"http://www.ekotov.pro/wikimapR/news/index.html","id":"new-features-0-1-2","dir":"Changelog","previous_headings":"","what":"New features","title":"wikimapR 0.1.2 (2023-05-14)","text":"Added set_wikimapia_api_key() make API keys available Wikimapia API calls session don’t keep specifying wm_api_key argument time","code":""},{"path":"http://www.ekotov.pro/wikimapR/news/index.html","id":"breaking-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"wikimapR 0.1.2 (2023-05-14)","text":"wm_get_by_id() changed main argument x ids. intuitive, since function accepts vectors length > 1. also nwo easier debug code. Help section fixed accordingly","code":""},{"path":"http://www.ekotov.pro/wikimapR/news/index.html","id":"minor-improvements-and-fixes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"wikimapR 0.1.2 (2023-05-14)","text":"Fixed issue/bug #1 (errors due deprecation dplyr::progress_estimated() ) Removed unneeded dependencies (lwgeom, rlist), add progress dependency due deprecation dplyr::progress_estimated()","code":""},{"path":"http://www.ekotov.pro/wikimapR/news/index.html","id":"wikimapr-011-2018-12-17","dir":"Changelog","previous_headings":"","what":"wikimapR 0.1.1 (2018-12-17)","title":"wikimapR 0.1.1 (2018-12-17)","text":"Initial public release","code":""}] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index ee4daba..b059174 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,45 +1,45 @@ - /404.html + http://www.ekotov.pro/wikimapR/404.html - /LICENSE-text.html + http://www.ekotov.pro/wikimapR/LICENSE-text.html - /LICENSE.html + http://www.ekotov.pro/wikimapR/LICENSE.html - /authors.html + http://www.ekotov.pro/wikimapR/authors.html - /index.html + http://www.ekotov.pro/wikimapR/index.html - /news/index.html + http://www.ekotov.pro/wikimapR/news/index.html - /paper.html + http://www.ekotov.pro/wikimapR/paper.html - /reference/index.html + http://www.ekotov.pro/wikimapR/reference/index.html - /reference/set_wikimapia_api_key.html + http://www.ekotov.pro/wikimapR/reference/set_wikimapia_api_key.html - /reference/subdivide_bbox.html + http://www.ekotov.pro/wikimapR/reference/subdivide_bbox.html - /reference/wikimapR.html + http://www.ekotov.pro/wikimapR/reference/wikimapR.html - /reference/wm_get_by_id.html + http://www.ekotov.pro/wikimapR/reference/wm_get_by_id.html - /reference/wm_get_by_id_single.html + http://www.ekotov.pro/wikimapR/reference/wm_get_by_id_single.html - /reference/wm_get_from_bbox.html + http://www.ekotov.pro/wikimapR/reference/wm_get_from_bbox.html diff --git a/man/wikimapR.Rd b/man/wikimapR.Rd index 3967bd4..a0adc2a 100644 --- a/man/wikimapR.Rd +++ b/man/wikimapR.Rd @@ -14,6 +14,7 @@ converted to `sf` objects retaining all recevied fields. Useful links: \itemize{ \item \url{https://github.com/e-kotov/wikimapR/} + \item \url{http://www.ekotov.pro/wikimapR/} \item Report bugs at \url{https://github.com/e-kotov/wikimapR/issues} }