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

Generate vector tiles for rnet_bicycle #60

Closed
layik opened this issue Nov 2, 2020 · 8 comments
Closed

Generate vector tiles for rnet_bicycle #60

layik opened this issue Nov 2, 2020 · 8 comments

Comments

@layik
Copy link
Contributor

layik commented Nov 2, 2020

Hi all. Just looking at https://github.com/saferactive/saferactive/blob/master/code/rasters-rnet.R but cannot run

u = "https://github.com/saferactive/saferactive/releases/download/0.1.1/rnet_national_sf_27700.Rds"

Can you point me to where rnet_national_sf_27700.Rds is or which script was used to generate it to so I can source or regenerate it?

Thanks

@Robinlovelace
Copy link
Contributor

Just looking at this @layik, solution soon.

@Robinlovelace
Copy link
Contributor

Just updating the data with this:

Rscript -e 'piggyback::pb_upload("rnet_national_sf_27700.Rds")'

@Robinlovelace
Copy link
Contributor

Strange thing: I thought I already updated it. Never mind.

@Robinlovelace
Copy link
Contributor

I think this code should now run. Please test and let me know @layik:

library(sf)
library(tidyverse)
library(raster)
# get osm cleaning code:
remotes::install_github("saferactive/trafficalmr")
if(!file.exists("rnet_national_sf_27700.Rds")){
u = "https://github.com/saferactive/saferactive/releases/download/0.1.1/rnet_national_sf_27700.Rds"
f = basename(u)
download.file(u, f, mode = "wb")
}
rnet_national_sf_27700 = readRDS("rnet_national_sf_27700.Rds")

@layik
Copy link
Contributor Author

layik commented Nov 2, 2020

Thanks @Robinlovelace, works of course. I will tippercanoe it and add the code in same/different file.

@Robinlovelace
Copy link
Contributor

Awesome, thanks @layik !

@layik layik closed this as completed in 86aed65 Nov 3, 2020
@layik
Copy link
Contributor Author

layik commented Nov 3, 2020

Generating heatmap using the vector tiles is possible, though mastering it needs time @mem48.

Screenshot 2020-11-03 at 10 39 17

@layik
Copy link
Contributor Author

layik commented Nov 3, 2020

Both raster + vector tiles generated in the release (as zip) are "zoom dependent" and have zoom level limit. Refer to their meta files and if you want to use them just be aware or generate your own raster/vector tiles. For the rasters I used the interactive Python tool gdal2tiles.py straight from the .tiff which is also in the release.

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

No branches or pull requests

2 participants