Skip to content

gokceyagmurbudak/UrbanSprawlExploreR

Repository files navigation

UrbanSprawlExploreR

This R package simplifies exploring urban sprawl using the Global Land Cover and Land Use Change, 2000-2020 dataset dataset. It can generate built-up change maps and hexagon new built-up density maps for your city of interest. In addition with interactive dashboard, you can visualise the results. Before you start using the package, check which tile your study area falls on with QGIS software here.

Install the library

Please use the commands below;

library(devtools)
install_github("gokceyagmurbudak/UrbanSprawlExploreR")

Operations

Please run all functions in this order;

Calling library and dataset. If your city is in the intersection within the tiles, you can type more than one tile name, the function will merge it for you;

library(UrbanSprawlExploreR)
example("fetch_builtup_data")

example("get_city_boundaries")

Cropping the built--up raster images according to the boundaries or buffer (circle or square) of relevant city;

example("crop_raster_by_boundaries")

example("crop_raster_by_buffer")

Convert built-up raster image to dataframe to generate labels as characters;

example("raster_to_df")

Calling the road dataset from OSM to crop roads within the city;

example("crop_city_roads")

Create a visual map and hexagon bining new built-up denstiy map for relevant city;

example("create_map")

example("hexbin_map")

Show all outputs on the dashboard and set the number of bin for hexagon_map;

example("UrbanExpansionUI")

For Free Users:

Please change the variables for your usage;

url <- "https://glad.umd.edu/users/Potapov/GLCLUC2020/Built-up_change_2000_2020/"
#If your city is in the intersection, you can type more than one tile name, the function will merge it for you.
#eg. c("50N_020E","50N_030E")
lat_lon_list <- c("50N_020E")
crsLONGLAT <- "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
builtup_raster_data <- fetch_builtup_data(url, lat_lon_list, crsLONGLAT)

city <- "Istanbul"
city_border_osm <- get_city_boundaries(city, builtup_raster_data, crsLONGLAT)

crop_raster_boundaries<- crop_raster_by_boundaries(builtup_raster_data, city_border_osm)

buffer_size <- 15
buffer_shape <- "square" # or circle
crop_raster_buffer <- crop_raster_by_buffer(city_border_osm, buffer_size, buffer_shape, builtup_raster_data)

city_df_boundaries <- raster_to_df(crop_raster_boundaries)
city_df_buffer <- raster_to_df(crop_raster_buffer$raster_masked)

road_tags <- c("motorway", "trunk", "primary", "secondary",
               "tertiary", "motorway_link", "trunk_link",
               "primary_link", "secondary_link", "tertiary_link")

city_roads_inside_buffer <- crop_city_roads(road_tags,crop_raster_buffer$buffer_polygon, crsLONGLAT)
city_roads_inside_boundaries <- crop_city_roads(road_tags,city_border_osm,crsLONGLAT)

city_map_buffer <- create_map(city_df_buffer, city_roads_inside_buffer, "Istanbul Urban Expansion 2000-2020","Created by <name>")
city_map_boundaries <- create_map(city_df_boundaries, city_roads_inside_boundaries, "Istanbul Urban Expansion 2000-2020","Created by <name>")

# ggsave(
# filename = "built_up.png",
# width = 6, height = 6, dpi = 600,
# device = "png", city_map_boundaries #city_map_buffer
# )

hex_map_polygon <- hexbin_map(city_df_boundaries,100,"Building Desinty, Pixel-Based Analysis")
hex_map_buffer <- hexbin_map(city_df_buffer,100,"Building Desinty, Pixel-Based Analysis")

UrbanExpansionUI(city_map_buffer,city_map_boundaries,city_df_buffer,city_df_boundaries)

Note: Since UrbanSprawlExploreR utilizes server-based spatial data from the GLCLUC dataset and Osmdata rather than local data, the reliability and speed of your internet connection play a crucial role in the package's performance.

References

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages