Segmentation of Urban Areas Using Road Networks: Nicholas Jing Yuan Yu Zheng Xing Xie
Segmentation of Urban Areas Using Road Networks: Nicholas Jing Yuan Yu Zheng Xing Xie
Segmentation of Urban Areas Using Road Networks: Nicholas Jing Yuan Yu Zheng Xing Xie
ABSTRACT 10 5 km
Region-based analysis is fundamental and crucial in many geospatial-
related applications and research themes, such as trajectory analy-
sis, human mobility study and urban planning. In this paper, we
report on an image-processing-based approach to segment urban ar-
eas into regions by road networks. Here, each segmented region is
bounded by the high-level road segments, covering some neighbor-
hoods and low-level streets. Typically, road segments are classified
into different levels (e.g., highways and expressways are usually
high-level roads), providing us with a more natural and semantic
segmentation of urban spaces than the grid-based partition method.
We show that through simple morphological operators, an urban
road network can be efficiently segmented into regions. In addi-
tion, we present a case study in trajectory mining to demonstrate
the usability of the proposed segmentation method.
Figure 1: Level 0,1,2-road segments in the urban area of Beijing
Categories and Subject Descriptors
H.2.8 [Database Management]: spatial databases and GIS, data
Intrinsically, this segmentation is more natural than grid-based seg-
mining.
mentation due to the following reasons: First, people live in these
roads-segmented regions and POIs (points of interests) fall in these
General Terms regions instead of the main roads. Second, the road-segmented re-
gions as the origin and destination of a trip are the root cause of
Algorithms
human mobility. In short, people travel among the road-segmented
regions.
1. INTRODUCTION In a Geographical Information System (GIS), there are two ma-
In many geospatial-related applications, such as trip planning[18], jor models to represent spatial data: vector-based model and raster-
urban planning/urban computing[6][25] and traffic analysis [24][15], based model. Vector-based model uses geometric primitives such as
an urban area is often segmented into sub-regions for in-depth anal- points, lines and polygons to represent spatial objects referenced by
ysis or complexity reduction. Intuitively, a digital map can be seg- Cartesian coordinates, while raster-based model quantizes an area
mented into equal-sized grids, where each grid is a rectangle, as into small discrete grid-cells (cuboids for the 3D spatial objects)
shown in Figure 2(a). While the grid-based approach offers simplic- indexing all the spatial objects. For example, the vector model of
ity in implementation, it has deficiencies as well: The segmented Beijing road network (shown in Figure 1) stores a road segment as a
grids do not have semantic meanings, thus the results of the analysis polyline (polygone for a circuit road), where a polyline is consist of
based on these grids do not provide us with a natural understanding, a sequence of shape points, represented by coordinates. A road seg-
with respect to the road network. ment r is associated with a direction symbol (r.dir) and two termi-
Typically, the road segments of a road network are categorizes in- nal points (r.s, r.e). If r.dir=one-way, r can only be traveled from
to different levels according to their functions, e.g., Figure 1 presents r.s to r.e, otherwise, people can start from both terminal points,
the road network of Beijing with Level-0,1,2 road segments. Here, i.e., r.s → r.e or r.e → r.s. Instead, the raster model rasterizes the
the Level-0 and Level-1 road segments (red-colored) are freeways road network into grid-cells, where each road segment is represent-
and city expressways in Beijing, and Level-2 road segments (blue- ed by a sequence of cell-IDs. Figure 3(a) and Figure 3(a) reveal a
colored) are urban arterial roads. These main roads naturally seg- portion of the Beijing road network stored with vector model and
ment the urban area into sub-regions with varying sizes and shapes. raster model(726×726 grid-cells) respectively.
Both of the two models have advantages and disadvantages de-
∗
This technical report details the process of map segmentation uti- pending on the specific applications. For instance, vector-based
lized in our previous papers[15],[25] and [23] method is more powerful for precisely finding shortest-paths, where-
as it requires intensive computation when performing topological
analysis, such as the problem of map simplification [10], which
(a) Grid-based (b) Hierarchy-based (c) Morphology-based
for segmenting the binary-image-based road network into region- Here, we employ the subfields-based parallel thinning algorithm
s. In general, a morphological operator calculates the output image proposed in [12]. This method first divide the binary image space
given the input binary image and a structure element, whose size into two disjointed subfields in a checkerboard pattern. Each itera-
and shape are pre-defined. tion is consist of two sub-iterations in these two subfields:
3.1 Dilation • In the first sub-iteration, check every pixel p in the first sub-
Dilation is one of the basic morphological operators. Let A be a field, delete p iff Condition 1, 2 and 3 are all satisfied.
binary image and B be the structure element, the dilation of A by
B is defined as: • In the second sub-iteration, check every pixel p in the second
[ subfield, delte p iff Condition 1, 2 and 4 are all satisfied.
A⊕B = Ab , (1)
b∈B C ONDITION 1. XH (p) = 1, where
where Ab = {a + b|a ∈ A}, i.e., the translation of A by the vector 4
X
b. The dilation operator is commutative, which can also be defined XH (p) = bi
by: i=1
[ (
A⊕B =B⊕A= Ba . (2) 1 if x2i−1 = 0 and (x2i = 1 or x2i+1 = 1)
a∈A
bi =
0 otherwise
Actually, for any p in A, after the dilation, p = 1 iff the intersection
between A and B, centred at p, is not empty. C ONDITION 2. 2 ≤ min{n1 (p), n2 (p)} ≤ 3, where
The purpose of the dilation operation is to remove the unneces- 4
sary details for map segmentation, avoiding the small connected ar- X
n1 (p) = x2k−1 ∨ x2k
eas induced by these unnecessary details such as bridges and lanes.
k=1
Figure 4(a) plots a portion of road network before the dilation op- 4
erator. As is shown, the small holes between the lanes and viaducts X
n2 (p) = x2k ∨ x2k+1
are filled, where we use a 3×3 matrix with all values one as the
k=1
structure element B.
C ONDITION 3. (x2 ∨ x3 ∨ x̄8 ) ∧ x1 = 0
3.2 Thinning
As a consequence of the previous dilation operator, the road seg- C ONDITION 4. (x6 ∨ x7 ∨ x̄4 ) ∧ x5 = 0
ments are turgidly thickened. In this step, we aim to extract the
skeleton of the road segments while keeping the topology structure Figure 5(a) and Figure 5(b) are the results after 7 iterations and
(such as the Euler number) of the original binary image. Specif- until convergence (no pixel are deleted any more) respectively.
ically, the thinning operator is performed to remove certain fore-
ground pixels from the input binary image. For a given pixel in the 3.3 Connected Component Labeling
input image, whether it should be removed depends on its neigh- The connected component labeling operation finds the connect-
bouring pixels. Lam et al. [14] present an in-depth survey of exist- ed 0 pixels (the blank area) in the binary image, after the thinning
ing thinning algorithms, most of which are implemented in a recur- operation. For a given pixel x, the neighbouring 4 pixels shown in
sive manner. According to the way an algorithm check the pixels, Figure 6(a) are called the 4-neighbours of x. Similarly, the 8 neigh-
the thinning algorithms can be categorized into parallel thinning al- bouring pixels shown in Figure 6(b) are called the 8-neighbours
gorithms and sequential thinning algorithms. The sequential algo- of x. We call the sequence y1 , y2 , . . . , yn an 8-path (4-path), if
rithms check each pixel according to a fixed order in each iteration, ∀i = 1, 2, . . . , n − 1, yi+1 is an 8-neighbour (4-neighbour) of yi .
and the deletion of pixel p in the nth iteration is not only related We say a region Q in a binary image is 8-connected (4-connected)
to the results in the n − 1th iteration, but also relate to the pixels iff all the pixels in Q have the same value and for any two pixels
examined before p in the nth iteration; In contrast, for the paral- in Q, there exist an 8-path (4-path) connecting the two pixels. Note
lel algorithms, the deletion of p only depends on the results in the that in the previous thinning operation, connectivity paradox may
n − 1th iteration, therefore, can be performed independently in a be induced if we keep the same type of connectivity (4-connected
parallel manner. or 8-connected) for both the foreground and the background[19].
O O
x2 x5 x4 x3 (b)
R1 p1
x3 x x1 x6 x x2 R3
p2 (c)
p4 p5
x4 x7 x8 x1 p3
p5
(a) 4-neighbours (b) 8-neighbours R2 R4 (d)
D R D
5
Figure 6: The 4-neighbours and 8-neighbours of x (a)
• Perform the second pass: scan from left to right and from top
to bottom, for each pixel x, label x with the smallest label
among all the labels in the equivalent class of x’s label. 1955
Applying this algorithm to the binary image 5(b), we obtain the 1083
10
0 1
10
2
10
3
10
4
10
5
10
[9] R. Estkowski. No steiner point subdivision simplification is np-
k complete. In Proc. 10th Canadian Conf. Computational Geometry.
Citeseer, 1998.
Figure 10: Number of transitions w.r.t. k [10] R. Estkowski and J. Mitchell. Simplifying a polygonal subdivision
while keeping it simple. In Proceedings of the seventeenth annual
(OD pairs) changing over k (log-log plot), which suggests a typical symposium on Computational geometry, pages 40–49. ACM, 2001.
Zipf distribution. [11] H. Gonzalez, J. Han, X. Li, M. Myslinska, and J. P. Sondag. Adaptive
fastest path computation on a road network: a traffic mining approach.
5. CONCLUSION In Proceedings of the 33rd international conference on Very large data
bases, VLDB ’07, pages 794–805, 2007. ISBN 978-1-59593-649-3.
In this technical report, we present a morphological map segmen-
tation method based on high level road segments of urban road net- [12] Z. Guo and R. Hall. Parallel thinning with two-subiteration algorithms.
Communications of the ACM, 32(3):359–373, 1989.
works. Compared with traditional segmentation approaches, such
as the grid-based method and the hierarchy-based method, our method [13] J. Krumm and E. Horvitz. Predestination: Where do you want to go
produces a more meaningful and semantic segmentation, where the today? Computer, 40(4):105–107, 2007.
high-level road segments are utilized as natural boundaries for the [14] L. Lam, S. Lee, and C. Suen. Thinning methodologies-a comprehen-
segmented regions. sive survey. IEEE Transactions on pattern analysis and machine in-
telligence, 14(9):869–885, 1992.
APPENDIX [15] W. Liu, Y. Zheng, S. Chawla, J. Yuan, and X. Xing. Discovering
spatio-temporal causal interactions in traffic data streams. In Proceed-
A. PSEUDO-CODE ings of the 17th ACM SIGKDD international conference on Knowl-
edge discovery and data mining, pages 1010–1018. ACM, 2011.
Input: Vector-based road network consisting of high-level road
segments G [16] E. López-Ornelas. High resolution images: segmenting, extracting in-
Output: Matrix M ; formation and gis integration. World Academy of Science, Engineering
/* the numbers in the matrix indicate the and Technology, 54:172–177, 2009.
identities of segmented regions */
1 Convert G into a binary image B; [17] C. Martel, G. Flouzat, A. Souriau, and F. Safa. A morphological
/* construct a raster-based model from a method of geometric analysis of images: Application to the gravity
vector-based model */ anomalies in the indian ocean. Journal of Geophysical Research, 94
2 B ← Dilation(B); (B2):1715–1726, 1989.
/* Perform dialation */ [18] J. Powell, Y. Huang, F. Bastani, and M. Ji. Towards reducing taxicab
3 B ← Thinning(B);
cruising time using spatio-temporal profitability maps. In Proceed-
/* Perform thinning until the convergence */ ings of the 12th International Symposium on Advances in Spatial and
4 M ← ConnectedComponentLabeling(B);
Temporal Databases, SSTD ’11, 2011.
/* Consider 4-connectivity for the regions and
8-connectivity for the road segments */ [19] A. Rosenfeld and J. Pfaltz. Sequential operations in digital picture
5 return M processing. Journal of the ACM (JACM), 13(4):471–494, 1966.
[20] M. Saradjian and J. Amini. Image map simplification using mathe-
B. USEFUL LINKS matical morphology. International Archives of Photogrammetry and
For the input format of the vector-based road network and the Remote Sensing, 33:36–43, 2000.
vector-to-raster conversion, please refer to [7]; For the morpholog- [21] L. Shapiro and G. Stockman. Computer Vision. 2001. Prentice Hall,
ical operators, such as dilation and thinning, refer to [3]; For con- 2001.
nected component labeling, refer to [2].
[22] J. Snyder. Map projections–A working manual. Number 1395. USG-
PO, 1987.
References
[1] http://msdn.microsoft.com/en-us/library/ [23] J. Yuan, Y. Zheng, and X. Xie. Discovering regions of different func-
aa940991.aspx. tions in a city using human mobility and pois. In Proceedings of the
18th ACM SIGKDD international conference on Knowledge discovery
[2] http://www.mathworks.cn/help/toolbox/images/ and data mining. ACM, 2012.
ref/bwlabel.html.
[24] Y. Zheng and X. Zhou. Computing with spatial trajectories. Springer-
[3] http://www.mathworks.cn/help/toolbox/images/ Verlag New York Inc, 2011.
ref/bwmorph.html.
[25] Y. Zheng, Y. Liu, J. Yuan, and X. Xie. Urban computing with taxicabs.
[4] http://msdn.microsoft.com/en-us/library/ In Proceedings of the 13th International Conference on Ubiquitous
bb429590.aspx. Computing Ubicomp 2011.