Package index
Geospatial data manipulation
Geospatial data provides insights into spatial events such as disasters and crimes through their relationships. These functions facilitate the retrieval and conversion data from OpenStreetMap and other external sources, enabling you to begin your spatial analysis.
-
fetch_roads()
- Download and process OpenStreetMap road data
-
transform_coordinates()
transform_to_cartesian()
transform_to_geographic()
- Transform to Cartesian or geographic coordinates
-
create_bbox()
- Create a bounding box
-
convert_bbox()
convert_bbox_to_coordinates()
convert_bbox_to_polygon()
- Convert a bounding box to coordinates or a polygon
Network creation
A road network represents a system of interconnected roads, where intersections act as nodes and road segments act as links. create_road_network
constructs a road network from road data. For more detailed analysis and visualization, there is also a function, create_segmented_network
or spatiotemporal_network
, to create a segmented road network.
-
create_road_network()
- Create a road network from roads
-
create_segmented_network()
- Create a segmented road network
-
create_spatiotemporal_network()
- Create spatiotemporal network
-
plot(<road_network>)
- Plot a road network
Network information retrieval
These functions provide tools to extract specific information from a road network, enabling you to understand the network structure and relationships.
-
get_connected_links()
- Get connected links from a specified node
-
create_graph()
- Create a graph from nodes and links
-
extract_road_network_nodes()
- Extract road network nodes
-
extract_road_network_links()
- Extract road network links
-
extract_segmented_network_nodes()
- Extract nodes of segmented network from a road network
-
extract_segmented_network_links()
- Extract segmented network links from a road network
-
extract_road_endpoints()
- Extract road endpoints
-
extract_road_intersections()
- Extract road intersections
-
generate_ids()
- Generate unique IDs based on parent IDs
Segmented network analysis
Analyzing events on segmented road networks can provide valuable insights into spatial relationships and patterns. By assigning events to network links and leveraging the detailed network structure, you can identify areas with high event frequency with these functions.
-
create_spatiotemporal_events()
- Create a spatiotemporal event collection
-
create_durations()
- Create durations
-
set_events()
- Set events on a space.
-
find_duration()
- Find the index of the duration that contains the event time.
-
convolute_segmented_network()
- Convolute segmented road network
-
compute_epanechnikov()
- Compute the Epanechnikov function
-
compute_gaussian()
- Compute the Gaussian function
-
create_line_graph()
- Create a line graph from a network
Geometry manipulation
Geometric operations are essential for spatial analysis. These functions are helpers for working with sf functions, allowing you to create, modify, and decompose geometries such as points, linestrings, and polygons.
-
create_coordinates()
- Create a collection of coordinates.
-
create_points()
- Create points geometry
-
create_linestring()
- Create a linestring geometry
-
create_polygon()
- Create a polygon geometry
-
filter_and_cast_geometries()
get_points()
get_linestrings()
get_polygons()
- Filter and cast geometries
-
sample_points_along_linestring()
- Sample points along a linestring
-
filter_points_within_tolerance()
- Filter points within a tolerance distance
-
remove_points_near_endpoints()
- Remove points near endpoints of a linestring
-
decompose_linestring()
- Decompose a linestring into a list of line segments
-
split_linestring()
- Split a linestring into multiple segments
Sample data
Pre-generated sample datasets related to roads and accidents. These datasets can be used to immediately begin using pavement.
-
sample_roads
- Sample roads data
-
sample_accidents
- Sample accidents data
-
osm_highway_values
- Values for the 'highway' tag in OpenStreetMap data