koenderks / rcityviews

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.
https://koenderks.github.io/rcityviews/
GNU General Public License v3.0
163 stars 22 forks source link

[Question] #20

Closed stalkerGH closed 10 months ago

stalkerGH commented 10 months ago

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]
)
koenderks commented 10 months ago

The list_cities function retuns a data frame with the latitude in the third column and the longitude in the fourth column. Those are given as lat/long input to the new_city function.

stalkerGH commented 10 months ago

Thank you. So the parameters 1, 2, 3 and 4 are the same as columns in cities.rda?

Screenshot_20240104_090425

koenderks commented 10 months ago

Correct, they are the same. The name and country are basically the text that gets printed at the top of the image (you can also leave this blank by using the empty string “” as input) and the lat/long coordinates are printed at the bottom right and are also used to extract the OSM data.