summarise_attributesadded to summarise attribute values of concatenated edges. Refs #120.
require_equaladded to specify if and which attributes should be checked for equality before removing a pseudo node. Refs #124.
protectadded to specify nodes that should never be removed, even if they are a pseudo node. Refs #177.
toargument. Refs #183.
directionadded to specify if outbound, inbound or all edges should be considered. This replaces the argument
igraph::distances(). The default is “out”, while before it was “all”. For undirected networks this argument is ignored.
edge_azimuth()gained an argument
degreeswhich can be set to
TRUEto return angles in degrees instead of radians.
st_network_paths()now encodes nodes by their name, whenever a name attribute is present in the nodes table. This can be disabled by setting
use_names = FALSE. Refs #154.
sf::st_set_precision()now have a method for
sfnetworkobjects, such that coordinate precision can be queried and set. Refs #209.
sf::st_difference()now have a method for
sfnetworkobjects, such that networks can be spatially clipped. The method for
sf::st_crop()now uses the same workflow. These functions do not work yet on edges of undirected networks. Refs #133.
sf::st_drop_geometry()is now a generic and therefore got an
sfnetworkmethod, merely to be consistent in the type of functions we provide a method for. Only those functions that mutate the geometry column of an sf object in such a way that would break the valid spatial network structure are not supported.
activeargument such that this information can be extracted from any network element without first activating it. Refs #215.
edge_circuity()does not return units objects anymore, since circuity is unitless.
sf::sf_extSoftVersion()["PROJ"]might not be defined for sf < 1.0. Refs #198 and #200.
dplyr1.0.8. Ref #202. Thanks @romainfrancois.
n_inactivearguments to the print method of an sfnetwork object. The arguments define how many rows are printed for respectively the active and inactive network element. The values of these arguments can also be set globally by running e.g.
options(sfn_max_print_active = 1, sfn_max_print_inactive = 2). Refs #157
Roxelis updated to comply with recent updates on the way a CRS is specified in an sf object. Refs #167
s2by adding a
s2::as_s2_geography()method for sfnetwork objects. In the new version of
s2package will be used for geometric operations involving longitude-latitude coordinates, see here.
tidygraphbehavior regarding the
weightattribute settings is sometimes differing from
spatstat v2, which is now splitted into multiple sub-packages. See here for details. In
sfnetworks, this affected the functions
as.linnet.sfnetwork(). Using this functions now requires
spatstat >= 2.0.0and
sf >= 0.9.8.
matchfor checking coordinate equality is replaced by a new
st_matchfunction specifically designed for this task. This fixes bugs related to numeric approximations of detailed coordinates. See #130
sf::st_reverse()to reverse edge linestrings is only possible with GEOS versions >= 3.7.
to_spatial_contracted()morpher, to contract groups of nodes based on given grouping variables. Refs #104
to_spatial_neighborhood()morpher, to limit a network to the neighborhood of a given node, based on a given cost threshold. Refs #90
st_network_blend(), which is faster and more reliable. The
sortargument is deprecated, since the returned network is now always sorted.
summarise_attributesargument to the
to_spatial_simple()morpher, allowing to specify on a per-attribute basis how attribute values of merged multiple edges should be inferred from the original ones. Refs #113. The same argument is also part of the new
to_spatial_contracted()morpher, where it can be used to specify on a per-attribute basis how attribute values of contracted groups of nodes should be inferred from the original ones.
to_spatial_simple()morpher is renamed to
remove_multiplesto better fit naming conventions in
to_spatial_smooth()morpher is renamed to
store_original_datato be better interpretable. This argument is also added to the morphers
to_spatial_contracted(), allowing to store original node or edge data in a
.orig_datacolumn, matching the design standards of
st_network_cost(), to store cost values of paths between unconnected edges as
Inf. The default value of this argument is
FALSE. Refs #111
edge_circuity()is changed from
FALSE, to better fit with the change mentioned above, and to make sure no changes to R defaults are made without the user explicitly specifying them.
sf::st_join(), only the information of the first match is now joined. Before, this used to throw an error. Refs #108
sf::st_geometry<-, since geometries should not be replaced in a morphed state.
st_network_blend()now correctly blends points that are very close to the network. Fixes #98
st_network_blend()now preserves the directedness of the input network. Fixes #127
st_network_blend()now runs even if the network contains edges of length 0. Fixes #125
sf::st_crop()now correctly updates the nodes table after cropping the edges. Fixes #109
to_spatial_smooth()now returns the original network when no pseudo nodes are present. Fixes #112
to_spatial_subdivision()now returns the original network when there are no locations for subdivision.
to_spatial_subdivision()now returns correct node indices for undirected networks.
edge_azimuth(), to calculate the azimuth (i.e. bearing) of edges. Refs #107
to_spatial_transformed()morpher, to temporarily transform a sfnetwork into a different CRS.
linnetobjects, to enhance interoperability between
spatstatpackage for spatial point patterns on linear networks.
Inf_as_NaNargument to the
edge_circuity()function, to store circuity values of loop edges as
Inf. The default value of this argument is
type, which lets you set the type of paths calculation that should be performed.
type = 'all_shortest'instead of
all = TRUE. The latter argument is deprecated.
type = 'all_simple'. Be aware that computation time gets high when providing a lot of ‘to’ nodes, or when the network is large and dense. Refs #105
weights = NULLand there is no column named ‘weight’ in the edges table, geographic edge length will be calculated internally and used as weights in shortest path calculation. Before, paths would be calculated without edge weights in this case. Refs #106
to_spatial_smooth()morpher. As a result of this it does not store the original edge data anymore in a ‘.orig_data’ column. Instead, non-merged edges keep their attributes, while merged edges loose their attributes. The ‘.orig_data’ column can still be added by setting
store_orig_data = TRUE, but this is not the default.
st_all_shortest_paths()are now merged into a single function
st_network_paths(). By default it call
all = TRUEwill make it call
st_network_paths()function is different from its predecessors. It returns a tibble instead of a list, to fit better in tidyverse workflows. See #77
snapargument is removed from all shortest paths related functions, which will now always snap geospatial points provides as from or to locations to their nearest node on the network before calculating paths.
keepargument is removed from the
to_spatial_simple()morpher. It is now recommended to first sort data with
dplyr::arrange()before calling the morpher.
to_spatial_coordinates()is deprecated. Use the new node coordinate query functions instead.
to_spatial_dense_graph()is deprecated. A new morpher
to_spatial_subdivision(), with slightly different functionality, is added instead.
to_spatial_implicit_edges()is deprecated. Use
sf::st_set_geometry()instead, with activated edges and value
to_spatial_explicit_edges()are renamed to respectively
to_spatial_explicit(), which either reflects their purpose better or fits better into the naming conventions within the package.
graphare renamed to
x, to have more consistency across the package.
sfnetwork()now has an argument
length_as_weightthat, if set to TRUE, will add the lengths of edges as a weight attribute to the edges data. Refs #65
as_sfnetwork()method for sfc objects. Refs #41
st_network_*functions in sfnetwork are now generic, such that they can easily be modified by extensions of sfnetwork objects. Refs #80
to_spatial_explicit_edges()morpher now accepts arguments that are forwarded directly to
sf::st_as_sf(). Refs #83
edge_length()function can now also be applied to spatially implicit edges.
sf::st_agr()now have an argument
activeto directly retrieve information from a network element without activating it. Use as
st_as_sf(x, active = "nodes"), et cetera.
st_network_blend()implements a process that we called ‘blending points into a network’. The functions accepts a network and a set of points. For each point p in the set of given points, it finds the projection p* of p on the network, splits the edges of the network at the location of p*, and finally adds p* along with the attributes of p as a node to the network. Refs #27 and #54
st_network_join()does a network specific join of two sfnetworks. It combines a spatial full join on the nodes data with a bind_rows operation on the edges data, and updates the from and to indices of the edges accordingly. Refs #22
st_network_bbox()calculates the bounding box of the whole network by combining the bounding boxes of nodes and edges.
to_spatial_subdivision()subdivides edges at locations where an interior point is shared with either another interior point or endpoint of another edge. Refs #73
to_spatial_smooth()iteratively removes pseudo-nodes from the network. Refs #70
node_M()are implemented to query specific coordinate values from the nodes.
ggplot2::autoplot()method for sfnetworks, allowing to easily plot a sfnetwork as a ggplot2 object. Refs #86
sf::st_crop(). Refs #85
to_spatial_coordinates(). Refs #62
as_sfnetwork(). Refs #41