Skip to content

Commit 0a0b088

Browse files
committed
roadways renamed highways; changed options
1 parent 3537c3f commit 0a0b088

8 files changed

Lines changed: 83 additions & 99 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: spatstat.linnet
2-
Version: 3.4-0.016
2+
Version: 3.4-0.017
33
Date: 2026-01-01
44
Title: Linear Networks Functionality of the 'spatstat' Family
55
Authors@R: c(person("Adrian", "Baddeley",

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export("harmonise.linim")
156156
export("harmonize.linim")
157157
export("hasglmfit.lppm")
158158
export("heatkernelapprox")
159+
export("highways")
159160
export("identify.linnet")
160161
export("identify.lintess")
161162
export("identify.lpp")
@@ -318,7 +319,6 @@ export("rjitter.lpp")
318319
export("rjitterlpp")
319320
export("rlpp")
320321
export("rmaxEuclidean")
321-
export("roadways")
322322
export("roc.lpp")
323323
export("roc.lppm")
324324
export("rotate.linnet")

NEWS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

2-
CHANGES IN spatstat.linnet VERSION 3.4-0.016
2+
CHANGES IN spatstat.linnet VERSION 3.4-0.017
33

44
OVERVIEW
55

66
o Improved algorithm for integrating a function on a network.
77

88
o Improvement to perspective plot on a network.
99

10-
o Identify roadways in a network.
10+
o Identify highways in a network.
1111

1212
o Minor improvements and bug fixes.
1313

1414
NEW FUNCTIONS
1515

16-
o roadways
17-
Identify roadways in a network.
16+
o highways
17+
Identify highways in a network.
1818

1919
SIGNIFICANT USER-VISIBLE CHANGES
2020

R/linnet.R

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Linear networks
55
#
6-
# $Revision: 1.102 $ $Date: 2026/01/01 02:43:45 $
6+
# $Revision: 1.104 $ $Date: 2026/01/01 09:41:56 $
77
#
88
# An object of class 'linnet' defines a linear network.
99
# It includes the following components
@@ -775,7 +775,7 @@ identify.linnet <- function(x, ...) {
775775
identify(as.psp(x), ...)
776776
}
777777

778-
roadways <- function(X, what=c("labels", "segments", "tessellation", "function")) {
778+
highways <- function(X, what=c("tessellation", "labels")) {
779779
verifyclass(X, "linnet")
780780
what <- match.arg(what)
781781
## identify which vertices are just a 'bend' in the road
@@ -796,26 +796,19 @@ roadways <- function(X, what=c("labels", "segments", "tessellation", "function")
796796
b <- seg[second]
797797
## Thus edges a[j], b[j] share a common vertex of degree 2, for each j
798798
## Identify equivalence classes
799-
lab <- cocoLabels(nsegments(X), a, b, "roadways algorithm")
799+
lab <- cocoLabels(nsegments(X), a, b, "highways algorithm")
800800
lab <- as.factor(lab)
801801
##
802802
switch(what,
803803
labels = {
804804
result <- lab
805805
},
806-
segments = {
807-
result <- as.psp(X) %mark% lab
808-
},
809806
tessellation = {
810807
df <- data.frame(seg=seq_len(nsegments(X)),
811808
t0=0,
812809
t1=1,
813810
tile=lab)
814811
result <- lintess(X, df)
815-
},
816-
"function" = {
817-
f <- function(x,y,seg,tp, ...) { lab[seg] }
818-
result <- linfun(f, X)
819812
})
820813
return(result)
821814
}

inst/doc/packagesizes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
4242
"2025-07-24" "3.3-1" 150 328 0 13326 3270
4343
"2025-09-24" "3.3-2" 150 328 0 13356 3270
4444
"2025-11-29" "3.4-0" 160 370 0 14990 3270
45-
"2026-01-01" "3.4-0.016" 161 373 0 15478 3270
45+
"2026-01-01" "3.4-0.017" 161 373 0 15471 3270

inst/info/packagesizes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
4242
"2025-07-24" "3.3-1" 150 328 0 13326 3270
4343
"2025-09-24" "3.3-2" 150 328 0 13356 3270
4444
"2025-11-29" "3.4-0" 160 370 0 14990 3270
45-
"2026-01-01" "3.4-0.016" 161 373 0 15478 3270
45+
"2026-01-01" "3.4-0.017" 161 373 0 15471 3270

man/highways.Rd

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
\name{highways}
2+
\alias{highways}
3+
\title{
4+
Identify Uninterrupted Highways in a Linear Network
5+
}
6+
\description{
7+
Given a linear network, find the highways.
8+
A highway is a set of connected edges which do not pass through
9+
any forks in the network.
10+
}
11+
\usage{
12+
highways(X, what = c("tessellation", "labels"))
13+
}
14+
\arguments{
15+
\item{X}{
16+
A linear network (object of class \code{"linnet"}).
17+
}
18+
\item{what}{
19+
String (partially matched) specifying the kind of result.
20+
}
21+
}
22+
\details{
23+
A \sQuote{highway} in a network is a subset of the edges of the network
24+
which does not pass through any forks in the network.
25+
26+
Given a linear network \code{X},
27+
this function identifies the highways in \code{X} and assigns a label to each
28+
edge (segment) of the network indicating which highway it belongs to.
29+
30+
Formally a highway is a set of edges joining successive
31+
vertices \eqn{v_1, \ldots, v_n}{v[1], ..., v[n]} of the network
32+
such that
33+
\itemize{
34+
\item there is an edge of the network joining
35+
\eqn{v_i}{v[i]} and \eqn{v_{i+1}}{v[i+1]} for each \eqn{i}
36+
\item each of the intermediate vertices
37+
vertices \eqn{v_2, \ldots, v_{n-1}}{v[2], ..., v[n-1]}
38+
has degree 2 (i.e. there are exactly 2 edges of the network which
39+
end at the vertex)
40+
\item the terminal vertices \eqn{v_1}{v[1]} and \eqn{v_n}{v[n]}
41+
do not have degree 2, unless they are the same vertex.
42+
}
43+
44+
Every edge (segment) of the network belomgs to a unique highway.
45+
This algorithm assigns a label to each edge indicating which highway
46+
it belongs to. If \code{what="labels"} (the default), the result is a
47+
factor of length equal to \code{nsegments(X)} giving the
48+
classification of segments.
49+
If \code{what="tessellation"}, the result is a tessellation of
50+
\code{X} (object of class \code{"lintess"}) in which the tiles of the
51+
tessellation are the highways.
52+
}
53+
\value{
54+
A factor, or a tessellation on the network (object of class \code{"lintess"}).
55+
}
56+
\author{
57+
\adrian
58+
}
59+
\seealso{
60+
\code{\link{connected.linnet}}
61+
}
62+
\examples{
63+
A <- edges(letterR)
64+
B <- edges(disc(centre=centroid.owin(letterR)))
65+
L <- as.linnet(superimpose(A,B))
66+
plot(highways(L, what="tess"),
67+
col=rainbow, scramble.cols=TRUE,
68+
lwd=2, show.window=FALSE)
69+
}
70+
\keyword{spatial}
71+
\keyword{manip}
72+
\concept{Linear network}

man/roadways.Rd

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)