geoGraph v2.1.0
dijkstraBetween(x, from, to)on agGraphnow returns every path from each node offromto each node ofto. Withtomissing or identical tofrom, all pairs offromare computed, as before.polygonBetween()benefits from this.gPathobjects record theirtype;gPath2dist()uses it and returns afromxtomatrix for the output ofdijkstraBetween()with distinctfromandto(and so forpolygonBetween()).dijkstraBetween()on agDatawith two locations now returns adist, as for more locations.dijkstraBuffer()includes the origin node and works on graphs that are not fully connected.isInArea()errors on an invalidreg(it returnedNA), and acceptsreg = c(xmin, xmax, ymin, ymax).findLand(),assignByPolygon()andbuffer()replace existing node attributes of the same name instead of adding duplicated columns;findLand()always returns a factor with levelslandandsea.assignByRaster()removesNAs itself (whenna.rm = TRUE) before applyingfun, so any summary function works, includinglengthand functions without anna.rmargument.na.rmis no longer passed tofun.polygonBetween()only acceptsgGraphobjects (for gData usedijkstraBetween()on the linkedgGraphinstead).makeHexGrid()is much faster on large grids , neighbors are found with a nearest-neighbor search instead ofspdep.setDistCosts()is about 8x faster; its documentation now states that costs are in miles.dijkstraBuffer()is much faster: it no longer builds every path.new("gData", nodes.id = ...)no longer ignoresnodes.id;new("gGraph", meta = ...)no longer ignoresmeta;new("gGraph")accepts coordinates without column names.gGraphobjects without node attributes (e.g. frommakeSquareGrid()ormakeHexGrid(), or saved with older versions) can be subset, and work withgetNodesAttr(),setNodesAttr(),buffer(),dijkstraBuffer(),assignByRaster()andgeom_ggraph().setCosts(),getNodeCosts()andgetColors()no longer chain rules when a cost or color equals another attribute value.assignByPolygon()andfindLand()handle layers in a projected CRS, andassignByPolygon()works ongDataobjects with several locations on the same node.closestNode()accepts a single location asc(lon, lat).polygonBetween()detects polygon outlines correctly on subset graphs.areConnected()no longer reports an isolated node as connected in graphs without edges.combineCosts()compares the edges of the two graphs reliably.dropDeadEdges()also drops edges when all costs are equal.dijkstraFrom()on agDatagives an informative error whenstartis not connected to the locations.Plotting:
plotEdges()works with a single visible edge;points()keeps per-node colors on the right nodes when zoomed in;plot(x, shape = NULL)draws the nodes of the new area;geo.segments()keeps per-segment colors with their segments.[andgeom_gdata()work ongDataobjects whose data is a vector.Validity checks give informative messages.
geoGraph v2.0.1
Added ggplot2 support for gGraph, gData, and gPath objects via autoplot() methods and geom_ggraph(), geom_gdata(), and geom_gpath() layers.
closestNodenow uses a faster KNN implementation for nearest neighbor searches by default. The legacy zone-expansion method is still available via method = “inArea”.Functions that temporarily toggle
sfsettings now restore the prior state on exit.Updated
gPath2distto now automatically return a vector or dist object based on the input typeUpdated
makeHexGridto handle date line crossinggGraphobjectsUpdated
isInAreato print a reproducible bounding box messageAdded
assignByRasterto assign raster cell values to graph nodes with customizable aggregation.Added
dijkstraBufferto identify nodes within a specified shortest-path distance from an origin.Added
makeHexGridfor explicit hexagonal grid construction.Deprecated
extractFromLayerin favor ofassignByPolygonandmakeGridin favor ofmakeSquareGrid.Added documentation for the
gPathclass and basic subsetting methods forgGraphandgDataobjectsAdded
setGraphandsetColorsas well as updated functionality ingetColors,getCosts, andsetCostsRemoved
getHistorymethod for gGraph objects and upgraded roxygen2 documentation from version 7.3.3 to 8.0.0Added comprehensive test coverage for cost functions and updated documentation
Updated
plot.gPath()and documentation for all dijkstra methodsUpdated
connectivityPlot()ensuring the color assignment matches the connected setFix incorrect handling of duplicate nodes in
dijkstraBetween(), ensuring zero-distance paths are properly represented.remove all use of deprecated packages (
spandmaptools), and move tosfobjects
