Giter VIP home page Giter VIP logo

koenderks / rcityviews Goto Github PK

View Code? Open in Web Editor NEW
149.0 4.0 21.0 1.2 GB

rcityviews is a user-friendly R interface for creating stylized city maps using OpenStreetMap (www.openstreetmap.org) data, implemented as an R package and a Shiny web application.

Home Page: https://koenderks.github.io/rcityviews/

License: GNU General Public License v3.0

R 100.00%
r osm openstreetmap shiny maps cartography ggplot2 poster rstats

rcityviews's Introduction

R_build_status Bugs Licence

R City Views

logo

This repository is an homage to the programming language R, open-source geographic data and the art of map making. It provides code and examples to render customizable stylized city maps using data from OpenStreetMap. Take a look at the tutorial for a quick guide on how to get started.

Every three hours this repository creates and tweets a view of a random city. You can find all city views created so far at the twitter handle @rcityviews. Please do not hesitate to share your own creations using the hashtag #rcityviews!

Installation

The functionality in this repository is implemented in the R package rcityviews. This package is not available on CRAN but can be obtained via GitHub by running the command below in R.

# install.packages("remotes") # Uncomment if you do not have the 'remotes' package installed
remotes::install_github("koenderks/rcityviews", dependencies = TRUE)

After installation, you can load the package into the R session using the following command.

library(rcityviews)

Create your own in R

Finding a city to map

First, you can search for a city name in the package database using the list_cities() function. This function looks in the internal database and finds any city name that contains the expression in match.

list_cities(match = "Ams")
#>                  name         country   lat   long
#> 1356       Amstelveen The Netherlands 52.32   4.86
#> 1357        Amsterdam The Netherlands 52.37   4.89
#> 1358        Amstetten         Austria 48.13  14.86
#> 25857   New Amsterdam          Guyana  6.25 -57.53
#> 26031 Nieuw Amsterdam        Suriname  5.91 -55.07

If you cannot find your preferred city in the internal package database, you can use the new_city() function to manually specify a location using its latitude and longitude coordinates.

city <- new_city(name = "Lagos", country = "Portugal", lat = 37.10, long = -8.68)
#> Discovered the city of Lagos, Portugal at 37.1° / -8.68°!

Creating the map

Second, once you have obtained the name of the city you want to view or have specified a location of a city, you can use the cityview() function to create a ggplot2 object. Use the zoom argument to zoom in on your city (e.g., zoom > 1, decreases computation time) or zoom out of your city (e.g., zoom < 0.5, increases computation time).

p <- cityview(name = "Amsterdam", zoom = 1) # or cityview(name = city)
# see ?cityview for more input parameters of this function

Saving the map

Finally, render times in R or RStudio can be very long for crowded spatial images. It is therefore recommended to directly save the image in a 500mm x 500mm format. Typically, the ideal way to do this given a ggplot2 object named p is to execute the command below.

ggplot2::ggsave(filename = "Amsterdam.png", plot = p, height = 500, width = 500, units = "mm", dpi = 100)

However, you can also do this instantly by providing a filename directly to the cityview() function via its filename argument. To save rendering time, the image is exported in an appropriate size and the function does not return a ggplot2 object.

cityview(name = "Amsterdam", filename = "Amsterdam.png")

For personal (non-commercial) printing it is advised to use the option license = FALSE and save the image to a .pdf or .svg file. Afterwards, the image is best printed in a 500mm x 500mm format.

Styling the map

There are ten pre-specified themes that can be used to style the image. The image above is created using theme = "vintage" (the default), but other options for the theme argument include modern (top left), bright (top middle), delftware (top right), comic (middle left), rouge (middle middle), original (middle right), midearth (bottom left), batik (bottom middle) and vice (bottom right).



In addition to the ten pre-specified themes, the package provides full flexibility to customize the theme by providing a named list. This is demonstrated in the code block below.

# For example: black, beige and white theme, streets only
myTheme <- list(
  colors = list(
    background = "#232323",
    water = NA,
    landuse = NA,
    contours = NA,
    streets = "#d7b174",
    rails = c("#d7b174", "#232323"),
    buildings = NA,
    text = "#ffffff",
    waterlines = NA
  ),
  font = list(
    family = "serif",
    face = "bold",
    scale = 1,
    append = "\u2014"
  ),
  size = list(
    borders = list(
      contours = 0.15,
      water = 0.4,
      canal = 0.5,
      river = 0.6
    ),
    streets = list(
      path = 0.2,
      residential = 0.3,
      structure = 0.35,
      tertiary = 0.4,
      secondary = 0.5,
      primary = 0.6,
      motorway = 0.8,
      rails = 0.65,
      runway = 3
    )
  )
)
cityview(name = "Rio de Janeiro", zoom = 0.5, theme = myTheme, border = "square", filename = "Rio.png")

Enclosing the map

There are several types of borders that can be used to enclose the city. The image above is created using border = "square", but other options for the border argument include none (the default), circle (left), rhombus (middle), square, hexagon, octagon, decagon and bbox (right).

Other display options

There are three other arguments to the cityview() function that can be used to tailor the image to your liking. First, the argument halftone allows you to add a colored dotted dither to the image (e.g., halftone = "#ffffff", left). Second, setting legend = TRUE adds a distance measurer and a compass to the image (middle). Third, the argument places takes an integer and adds that amount of names of towns, villages, suburbs, quarters and neighbourhoods to the image (e.g., places = 10, right).

Create your own in Shiny

You can make your own images without having to code using an R Shiny implementation of the package. A live version of the application can be found here but it is also easily accessible from within R by calling the function cityview_shiny().

Acknowledgements

The data is available under the Open Database License.

rcityviews's People

Contributors

github-actions[bot] avatar koenderks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rcityviews's Issues

Disable certain type of buildings (or other OSM features)

I'd like to disable (not hide but avoid downloading and processing) of certain types of buildings from Overpass API server. In osmdata's documentation for add_osm_feature function (https://docs.ropensci.org/osmdata/reference/add_osm_feature.html) I found how to do that in "pure" osmdata package:

value
value for feature key; can be negated with an initial exclamation mark, value = "!this", and can also be a vector, value = c ("this", "that").

But I don't know the valid syntax for calling this in rcityviews. Piece of code in builders.R say:

obj <- .getOsmFeatures(bbox, cropped, border, features = "\"building\"")

But how to add features I don't want?

Cannot map Tokyo

First of all, this is a really fun tool! Thanks for creating it.

I'm trying to draw a map of Tokyo, but I came across the following error.

My code

> cityview(
+   name = "Tokyo", zoom = 1,
+   theme = "vintage",
+   border = "circle",
+   legend = TRUE,
+   filename = "~/Desktop/Tokyo_vint_circ.png")

Error message:

Requesting © OpenStreetMap features for Tokyo, Japan
  \ [>--------------------------------------------]   2% | Time remaining:  0sError in cityview(name = "Tokyo", zoom = 1, theme = "vintage", border = "circle",  :
  Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented,  :
  Loop 0 is not valid: Edge 54 crosses edge 56

My session info:

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rcityviews_1.0.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.10        lubridate_1.9.2    lattice_0.20-45    prettyunits_1.1.1
 [5] sysfonts_0.8.8     class_7.3-20       ps_1.7.4           rprojroot_2.0.3
 [9] utf8_1.2.3         R6_2.5.1           httr2_0.2.2        e1071_1.7-13
[13] ggplot2_3.4.2      pillar_1.9.0       rlang_1.1.0        progress_1.2.2
[17] curl_5.0.0         geosphere_1.5-18   callr_3.7.3        textshaping_0.3.6
[21] labeling_0.4.2     munsell_0.5.0      proxy_0.4-27       compiler_4.2.1
[25] pkgconfig_2.0.3    systemfonts_1.0.4  pkgbuild_1.3.1     tidyselect_1.2.0
[29] tibble_3.2.1       fansi_1.0.4        crayon_1.5.2       dplyr_1.1.1
[33] showtextdb_3.0     withr_2.5.0        sf_1.0-12          wk_0.7.2
[37] rappdirs_0.3.3     grid_4.2.1         jsonlite_1.8.4     gtable_0.3.3
[41] lifecycle_1.0.3    DBI_1.1.3          magrittr_2.0.3     units_0.8-1
[45] scales_1.2.1       KernSmooth_2.23-20 cli_3.6.1          farver_2.1.1
[49] remotes_2.4.2      sp_1.6-0           xml2_1.3.3         ragg_1.2.2
[53] generics_0.1.3     vctrs_0.6.1        cowplot_1.1.1      osmdata_0.2.1
[57] s2_1.1.2           tools_4.2.1        ggspatial_1.1.7    showtext_0.9-5
[61] glue_1.6.2         hms_1.1.3          processx_3.8.0     shadowtext_0.1.2
[65] timechange_0.2.0   colorspace_2.1-0   classInt_0.4-9

Error In Installation

Hi koenderks,
Im trying to install rcityviews and im getting this error

Installing package into ‘C:/Users/hemed/OneDrive/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)

  • installing source package 'rcityviews' ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 1.0.2 is already loaded, but >= 1.0.6 is required
    Error: unable to load R code in package 'rcityviews'
    Execution halted
    ERROR: lazy loading failed for package 'rcityviews'
  • removing 'C:/Users/hemed/OneDrive/Documents/R/win-library/4.1/rcityviews'
    Warning messages:
    1: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\rlang\libs\x64\rlang.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\rlang\libs\x64\rlang.dll: Permission denied
    2: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\cli\libs\x64\cli.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\cli\libs\x64\cli.dll: Permission denied
    3: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\Rcpp\libs\x64\Rcpp.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\Rcpp\libs\x64\Rcpp.dll: Permission denied
    4: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\vctrs\libs\x64\vctrs.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\vctrs\libs\x64\vctrs.dll: Permission denied
    5: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\terra\libs\x64\terra.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\terra\libs\x64\terra.dll: Permission denied
    6: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\xfun\libs\x64\xfun.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\xfun\libs\x64\xfun.dll: Permission denied
    7: In file.copy(savedcopy, lib, recursive = TRUE) :
    problem copying C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\00LOCK\raster\libs\x64\raster.dll to C:\Users\hemed\OneDrive\Documents\R\win-library\4.1\raster\libs\x64\raster.dll: Permission denied
    8: In i.p(...) :
    installation of package ‘tidyselect’ had non-zero exit status
    9: In i.p(...) :
    installation of package ‘C:/Users/hemed/AppData/Local/Temp/Rtmpi0S9bA/file24f81d4c79b5/rcityviews_1.0.3.tar.gz’ had non-zero exit status

Help

[Feature] change pre-specified themes

I want to make changes to the pre-specified themes. I like the themes very much and I want to use them, but sometimes I just want the city name and coordinates to be deleted or the buildings not to be rendered. is such a thing possible and how can we do it?

Choose cities or towns or areas by coordinates

Hi Koen,

Firstly amazing package. I LOVE it. I just wondered, is it possible to pull data from a lat/long position or smaller town/village. I would like to be able to map a few smaller villages but they are not listed as cities so the package cannot find them. Any way around this?

Thanks a bunch,

[Bug] Error when asking local Overpass API server

When using local Overpass API server, rcityview stops with message Error in overpass_query(query = obj$overpass_call, quiet = quiet, encoding = encoding) : object 'doc' not found. When using default (Kumi Systems) server, OSM data are downloaded.

My knowledge of R is very basic so I have trouble with debugging this issue. I suspected osmdata package but it seems that my local server is working good and handling the queries as expected. I don't want to make this bug report longer as it should so please look at this thread on osmdata issue tracker: ropensci/osmdata#335

I tried to debug in RStudio using debug() and debug(cityview) commands but failed - as I said my knowledge of R is very basic.

I can add logs and do further tests but I need advice.

My configuration

  • OS: Ubuntu 22.04
  • R 4.3.2
  • rcityviews 1.1.1
  • other R packages in most current versions

Installation error

Hi,

I encountered the following installation error. Could you advise? My session information is also attached in the following.

Any help will be much appreciated!

Warning in file(con, "r") :
URL 'http://platform.twitter.com/widgets.js': Timeout of 60 seconds was reached
Error in file(con, "r") :
cannot open the connection to 'http://platform.twitter.com/widgets.js'
Error: unable to load R code in package 'rcityviews'
Execution halted
ERROR: lazy loading failed for package 'rcityviews'

  • removing 'D:/Software/library/rcityviews'

############################################

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.936 LC_CTYPE=English_Australia.936
[3] LC_MONETARY=English_Australia.936 LC_NUMERIC=C
[5] LC_TIME=English_Australia.936

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] remotes_2.4.2

loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2 curl_4.3.3 pacman_0.5.1

[Feature] Change Overpass API server

This is not exactly feature request nor bug but rather a question.

When I try different styles and areas, rcityview every time downloads OSM data via Overpass API. I found URL of the server in zzz.R file:

osmdata::set_overpass_url("https://overpass.kumi.systems/api/interpreter")

Is it possible to run my own (local) Overpass API server to download data faster and not overloading remote server? I never need that but I can try. When I will run my own server, should I just change URL in zzz.R and load rcityview in R or should I do some special steps?

[Feature] Way to obtain/save data only so it's quicker and more effective to try out different plot styles afterward

First of all, thanks for the amazing package, it produces some great maps right out of the box! 🤘🏻

I was wondering if there is a way of obtaining the OSM attributes for a particular city first and saving them as an intermediate R object so I could test out different styles and plot parameters afterward.

If I'm not missing anything here, as of now, every time you run the function "citiyview", it retrieves data from that city all over again. It would be awesome if you could load data from the city first and then only call the "styling function" or however you wanna call it.

Thank you in advance! Keep up the good work!

[Feature] Specify both city and country

Is your feature request related to a problem? Please describe.
I was trying to make a map of Durham, NC. There are 3 Durhams in the database and interactively, you get prompted asking which one but I'd love this to be an input to the function.

Describe the solution you'd like
Update list_cities function to return a data.frame with both name and country. Output would look something like this:

    name                  country   lat   long population
1 Durham                   Canada 44.18 -80.82       2898
2 Durham           United Kingdom 54.78  -1.60      46406
3 Durham United States of America 35.98 -78.91     208426

Update cityview to allow country as an optional input.

Describe alternatives you've considered
None

Additional context
This would be useful for people using R markdown or something without interactivity.

HTTP 504 - Gateway Timeout

Timeout with cityview function
Hello,
I always have a Gateway Timeout problem when I want to use the cityview function, even if I change my internet connection.

Example
_Al <- cityview(name = "Nancy", zoom = 1, border = "circle", theme = "light")
Requesting © OpenStreetMap features for Nancy, France
/ [=================>---------------------------------------------------------] 25% | Time remaining: 4mError in resp_abort():
! HTTP 504 Gateway Timeout.
Run rlang::last_error() to see where the error occurred.

rlang::last_error()
<error/httr2_http_504>
Error in resp_abort():
! HTTP 504 Gateway Timeout.


Backtrace:

  1. rcityviews::cityview(...)
  2. rcityviews:::.get_features(osmbox, cropped, border, features = ""leisure"="playground"")
  3. osmdata::osmdata_sf(q = feat)
  4. osmdata:::fill_overpass_data(obj, doc, quiet = quiet)
  5. osmdata:::overpass_query(...)
  6. httr2::req_perform(req)
  7. httr2:::resp_abort(resp, error_body(req, resp))
    Run rlang::last_trace() to see the full context._

Could you please me to resolve this problem
Thanks
Alex

Desktop:
R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C LC_TIME=fr_FR.UTF-8
[4] LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rcityviews_1.0.1

loaded via a namespace (and not attached):
[1] nlme_3.1-158 sf_1.0-7 lubridate_1.8.0 RColorBrewer_1.1-3 progress_1.2.2
[6] rprojroot_2.0.3 tools_4.1.3 utf8_1.2.2 R6_2.5.1 rpart_4.1.16
[11] KernSmooth_2.23-20 DBI_1.1.3 colorspace_2.1-0 nnet_7.3-17 withr_2.5.0
[16] sp_1.5-0 tidyselect_1.1.2 prettyunits_1.1.1 processx_3.6.1 curl_4.3.2
[21] compiler_4.1.3 httr2_0.2.1 cli_3.3.0 xml2_1.3.3 scales_1.2.0
[26] classInt_0.4-7 callr_3.7.0 proxy_0.4-27 rappdirs_0.3.3 stringr_1.4.0
[31] digest_0.6.29 pkgconfig_2.0.3 showtext_0.9-5 parallelly_1.32.0 rlang_1.0.3
[36] rstudioapi_0.13 sysfonts_0.8.8 generics_0.1.2 jsonlite_1.8.0 dplyr_1.0.9
[41] ModelMetrics_1.2.2.2 zip_2.2.0 magrittr_2.0.3 s2_1.0.7 geosphere_1.5-14
[46] Matrix_1.4-1 Rcpp_1.0.8.3 munsell_0.5.0 fansi_1.0.3 lifecycle_1.0.1
[51] stringi_1.7.6 pROC_1.18.0 MASS_7.3-57 pkgbuild_1.3.1 plyr_1.8.7
[56] recipes_0.2.0 grid_4.1.3 parallel_4.1.3 listenv_0.8.0 crayon_1.5.1
[61] lattice_0.20-45 splines_4.1.3 hms_1.1.1 ps_1.7.1 pillar_1.7.0
[66] future.apply_1.9.0 reshape2_1.4.4 codetools_0.2-18 stats4_4.1.3 wk_0.6.0
[71] glue_1.6.2 data.table_1.14.2 remotes_2.4.2 BiocManager_1.30.18 vctrs_0.4.1
[76] foreach_1.5.2 gtable_0.3.0 purrr_0.3.4 future_1.26.1 assertthat_0.2.1
[81] ggplot2_3.3.6 gower_1.0.0 openxlsx_4.2.5 prodlim_2019.11.13 e1071_1.7-11
[86] class_7.3-20 survival_3.3-1 timeDate_3043.103 tibble_3.1.7 iterators_1.0.14
[91] hardhat_1.1.0 showtextdb_3.0 units_0.8-0 lava_1.6.10 globals_0.15.0
[96] osmdata_0.1.10 ellipsis_0.3.2 caret_6.0-92 ipred_0.9-13

[Question]

Dear @koenderks.

In the documentation you write about plotting separate districts of city. Could you explain content of square brackets in commands below?

amsterdam <- [list_cities]("Amsterdam")[1, ]
# Create instance
center <- [new_city](
  name = "Centrum, Amsterdam",
  country = "The Netherlands",
  lat = amsterdam[1, 3],
  long = amsterdam[1, 4]
)

Error in installation

Hi there,

I experienced some errors in installation:

remotes::install_github("koenderks/rcityviews", dependencies = TRUE)

  • installing source package ‘rcityviews’ ...
    ** using staged installation
    ** R
    Error in parse(outFile) :
    /private/var/folders/q7/zp_qv5mj3wn71641nyh7ch500000gn/T/Rtmp0oGUDU/R.INSTALL16d3546dd0e9d/rcityviews/R/app.R:74:25: unexpected '>'
    73: output[["osm"]] <- leaflet::renderLeaflet({
    74: leaflet::leaflet() |>
    ^
    ERROR: unable to collate and parse R files for package ‘rcityviews’
  • removing ‘/Users/kai/Library/R/3.6/library/rcityviews’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/q7/zp_qv5mj3wn71641nyh7ch500000gn/T//Rtmpt3TzIy/file14e266b963ffa/rcityviews_1.0.3.tar.gz’ had non-zero exit status

I believe it has something to do with installing openssl through compilation (I wasn't able to do so, got the following error):
ld: warning: directory not found for option '-L/opt/homebrew/opt/openssl/lib'
ld: warning: ignoring file /opt/homebrew/opt/[email protected]/lib/libssl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/[email protected]/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
installing to /Users/kai/Library/R/3.6/library/00LOCK-openssl/00new/openssl/libs
** R
** inst
** byte-compile and prepare package for lazy loading

** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location

Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/kai/Library/R/3.6/library/00LOCK-openssl/00new/openssl/libs/openssl.so':
dlopen(/Users/kai/Library/R/3.6/library/00LOCK-openssl/00new/openssl/libs/openssl.so, 0x0006): symbol not found in flat namespace '_ASN1_STRING_to_UTF8'
Error: loading failed
Execution halted

By any chance do you know how this can be resolved? I am using a Mac with Apple M1 Pro and macOS Monterey.

git history is huge

Hi @koenderks,
first rcityviews is a really nice package. However when I want to create a project from a fork I realized this will several GB, as the picture png/daily.png is updated several times a day. Would it be possible to add this file in the .gitignore and maybe clean up the history? Unfortunately my knowledge about git is limited (xkcd).
Kind regards,
Klaus

"Error : node stack overflow" when downloading data

Error when downloading city data

I installed R 4.3.2 in Windows 10 from official R installer and use RGui. Opened console, pasted the commands:

install.packages("remotes")

remotes::install_github("koenderks/rcityviews", dependencies = TRUE)

Installation went without errors (tried in Ubuntu 22.04 too but had problems with dependencies probably so I gave up).

Now:

library(rcityviews) - library is loaded.

list_cities(match = "Ams") - works as expected.

list_cities(match = "Zakopane") - works as expected. It's a town in Poland, at the foot of the Tatra Mountains.

p <- cityview(name = "Zakopane", zoom = 1) - progress bar goes to 98% and I got error _ node stack overflow_

I don't know if it is rcityviews error, or R error, or OS error. Maybe someone give me the advice? I don't know R but have no problem with digging into OS settings.

Control Over Text Size

Is your feature request related to a problem? Please describe.
In making the following map, I noticed the names seem inappropriately large, causing overlap and distraction from the map itself.

myTheme <- list(
  colors = list(
    background = "#232323",
    water = NA,
    landuse = NA,
    contours = NA,
    streets = "#FF8200",
    rails = c("#FF8200", "#232323"),
    buildings = NA,
    text = "#ffffff",
    waterlines = NA
  ),
  font = list(
    family = "serif",
    face = "bold",
    append = "\u2014"
  ),
  size = list(
    borders = list(
      contours = 0.3,
      water = 0.4,
      canal = 0.5,
      river = 0.6
    ),
    streets = list(
      path = 0.2,
      residential = 0.4,
      structure = 0.5,
      tertiary = 0.7,
      secondary = 0.8,
      primary = 0.9,
      motorway = 1,
      rails = 0.75,
      runway = 3
    )
  )
)
cityview(name = "Knoxville", zoom = 0.5, theme = myTheme)

image

Describe the solution you'd like
Do we have control over the country, city, long/lat, and attribution size and font?

[Feature] I would like to be able to select cities by lat/long, or by city & country

I was excited when I saw this package advertised in the RWeekly email! I thought the maps it made looked beautiful, so I installed the package on my computer so I could try making a map of Boston, MA (USA). I wasn't able to, since there are two identically named cities in the dataset (Boston, UK, and Boston, USA), and the behaviour of the cityview function itself (which it helpfully reported) was "More than one city matched to this name, using the first match", a default which I wasn't able to figure out how to override. Similarly, when I looked for "Cambridge", there were four cities, across four countries, and I couldn't select between them.

I would recommend adding an option to cityview that allows for selecting cities by city & country, by row number, by lat/long, or perhaps even interactively, by writing a message to the console when multiple matches are found, and asking the user to report which of the options (1, 2, 3, or 4) perhaps, they meant, before rendering the map.

Thanks for your work on this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.