Skip to content

Commit

Permalink
documentation update for v 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed Aug 14, 2019
1 parent ed0b664 commit 035e0e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To load the package and check the version:
``` r
library(wikimapR)
packageVersion("wikimapR")
#> [1] '0.1.0'
#> [1] '0.1.1'
```

### Usage
Expand Down Expand Up @@ -59,7 +59,7 @@ wm <- wm_get_from_bbox(x = bbox, get_location = FALSE, meta_only = TRUE)
#> wikimapia.org/api?action=create_key .
# wm <- wm_get_from_bbox(x = bbox, get_location = F, wm_api_key = "XXXXXXX", object_count_only = T) # use with your own API key to perform more frequent requests and avoid the warning message
wm$found
#> [1] 20339
#> [1] 21015
```

Now we know how many objects we have in the bounding box.
Expand All @@ -74,12 +74,11 @@ bounding box that you have into smaller bounding boxes with a maximum of

`subdivide_bbox()` subdivides a large bounding box into smaller ones and
returns `sf polygons`, or `bbox` objects or both. It is good for large
areas with defaults tuned to cities like
Moscow.
areas with defaults tuned to cities like Moscow.

``` r
small_bboxes <- subdivide_bbox(x = bbox, bbox_cell_size = 0.1, return_bbox_or_sf = "both")
#> Linking to GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3
#> Linking to GEOS 3.7.2, GDAL 2.4.1, PROJ 6.1.1
#> 12 bounding boxes created with approximate cell size of 6698x11129 meters.
plot(small_bboxes$sf$geometry)
```
Expand Down Expand Up @@ -111,8 +110,7 @@ subdivision using precise metric, but this will do fine for now.
Just to be sure that every bounding box that we generated has \<= 10 000
objects, let us query all the bounding boxes. For the current example
with 12 it will take about 6 minutes, as with “example” API key the
cool-down is about 30
seconds.
cool-down is about 30 seconds.

``` r
pb <- dplyr::progress_estimated(length(small_bboxes$bbox)) # set the progress bar using dplyr
Expand All @@ -126,8 +124,7 @@ objects_in_bboxes <- small_bboxes$bbox %>% purrr::map( ~ {
```

Now we look at the histogram of the number of objects in the small
bounding boxes and the maximum
value:
bounding boxes and the maximum value:

``` r
n_by_bbox <- objects_in_bboxes %>% purrr::map_int(~ .x$meta$found) # extract the number of found objects for every bounding box
Expand Down Expand Up @@ -284,7 +281,7 @@ citation ("wikimapR")
#> To cite package 'wikimapR' in publications use:
#>
#> Egor Kotov (2018). wikimapR: Import Wikimapia Data as Simple
#> Features via API. R package version 0.1.0.
#> Features via API. R package version 0.1.1.
#> https://github.com/e-kotov/wikimapR/
#>
#> A BibTeX entry for LaTeX users is
Expand All @@ -293,7 +290,7 @@ citation ("wikimapR")
#> title = {wikimapR: Import Wikimapia Data as Simple Features via API},
#> author = {Egor Kotov},
#> year = {2018},
#> note = {R package version 0.1.0},
#> note = {R package version 0.1.1},
#> url = {https://github.com/e-kotov/wikimapR/},
#> }
```
Expand Down
7 changes: 5 additions & 2 deletions man/subdivide_bbox.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 035e0e1

Please sign in to comment.