Computing Visibility on Terrains in External Memory

Similar documents
Computing Visibility on Terrains in External Memory

Improved Visibility Computation on Massive Grid Terrains

Computing visibility on terrains in external memory

Computing Visibility on Terrains in External Memory

Massive Data Algorithmics. Lecture 1: Introduction

memory Abstract The recent availability of detailed geographic data permits terrain applications

An efficient algorithm to compute the viewshed on DEM terrains stored in the external memory

Analysing the pyramid representation in one arc-second SRTM model

Flow on terrains. Laura Toma csci 3225 Algorithms for GIS Bowdoin College

A Parallel Sweep Line Algorithm for Visibility Computation

Modeling & Analyzing Massive Terrain Data Sets (STREAM Project) Pankaj K. Agarwal. Workshop on Algorithms for Modern Massive Data Sets

Introduction to I/O Efficient Algorithms (External Memory Model)

A parallel algorithm for viewshed computation on grid terrains

Algorithms for GIS. Spatial data: Models and representation (part I) Laura Toma. Bowdoin College

A Parallel Sweep Line Algorithm for Visibility Computation

Algorithms for GIS csci3225

Algorithms for GIS csci3225

Algorithms for dealing with massive data

On External-Memory Planar Depth-First Search

Massive Data Algorithmics

Flow Computation on Massive Grids

Massive Data Algorithmics

I/O-Algorithms Lars Arge Aarhus University

External Memory. Philip Bille

An optimal and practical cache-oblivious algorithm for computing multiresolution rasters

Finding Shortest Path on Land Surface

Column Stores vs. Row Stores How Different Are They Really?

1 Introduction Geographic Information Systems (GIS) is emerging as a powerful management and analysis tool in science and engineering, environmental a

Storage hierarchy. Textbook: chapters 11, 12, and 13

Motivation for Sorting. External Sorting: Overview. Outline. CSE 190D Database System Implementation. Topic 3: Sorting. Chapter 13 of Cow Book

Lecture 21 - Chapter 8 (Raster Analysis, part2)

Ingo Brenckmann Jochen Kirsten Storage Technology Strategists SAS EMEA Copyright 2003, SAS Institute Inc. All rights reserved.

1. Creates the illusion of an address space much larger than the physical memory

Algorithms for GIS: Terrain simplification

An efficient external memory algorithm for terrain viewshed computation

Algorithms for GIS csci3225

External-Memory Algorithms with Applications in GIS - (L. Arge) Enylton Machado Roberto Beauclair

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25

Lecture 19 Apr 25, 2007

2 Lars Arge, Laura Toma and Jerey Scott Vitter 1. INTRODUCTION Geographic Information Systems (GIS) is emerging as a powerful management and analysis

DEM Artifacts: Layering or pancake effects

CS 261 Fall Mike Lam, Professor. Virtual Memory

Report Seminar Algorithm Engineering

Database Architecture 2 & Storage. Instructor: Matei Zaharia cs245.stanford.edu

Data Storage and Query Answering. Data Storage and Disk Structure (2)

Hierarchical Memory. Modern machines have complicated memory hierarchy

In-memory processing of big data via succinct data structures

I/O-Algorithms Lars Arge

STORING DATA: DISK AND FILES

Final project: Lecture 21 - Chapter 8 (Raster Analysis, part2) GEOL 452/552 - GIS for Geoscientists I

Planar Point Location in Sublogarithmic Time

Using rasters for interpolation and visualization in GMS

Computational Geometry [csci 3250]

38 Intervisibility on terrains

Border Patrol. Shingo Murata Swarthmore College Swarthmore, PA

Polygon Triangulation

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

Effect of memory latency

Thiago L. Gomes Salles V. G. Magalhães Marcus V. A. Andrade Guilherme C. Pena. Universidade Federal de Viçosa (UFV)

Algorithms for Memory-Hierarchies Ulrich Meyer

Flash memory: Models and Algorithms. Guest Lecturer: Deepak Ajwani

Disks and Files. Storage Structures Introduction Chapter 8 (3 rd edition) Why Not Store Everything in Main Memory?

Visible Surface Detection. (Chapt. 15 in FVD, Chapt. 13 in Hearn & Baker)

Virtual Memory. Chapter 8

CS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018

Storage Management 1

Computing Pfafstetter Labelings I/O-Efficiently (abstract)

STXXL: Standard Template Library for XXL Data Sets

Computer Memory. Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

Big Spatial Data Performance With Oracle Database 12c. Daniel Geringer Spatial Solutions Architect

Cache-Oblivious Algorithms A Unified Approach to Hierarchical Memory Algorithms

8: Memory Management

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Database Management Systems need to:

Space Filling Curves

secondary storage: Secondary Stg Any modern computer system will incorporate (at least) two levels of storage:

Shapefile Overlay Using a Doubly-Connected Edge List

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Chapter 7

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

Space-filling curves for spatial data structures

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

Massive Data Algorithmics. Lecture 12: Cache-Oblivious Model

Warehouse- Scale Computing and the BDAS Stack

Algorithms and Data Structures Group. Gerth Stølting Brodal

Database Systems. November 2, 2011 Lecture #7. topobo (mit)

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Pipelined processors and Hazards

User Perspective. Module III: System Perspective. Module III: Topics Covered. Module III Overview of Storage Structures, QP, and TM

ParCube. W. Randolph Franklin and Salles V. G. de Magalhães, Rensselaer Polytechnic Institute

Page Replacement. (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018

Contents of Lecture. Surface (Terrain) Data Models. Terrain Surface Representation. Sampling in Surface Model DEM

The functionality. Managing more than Operating

I/O Model. Cache-Oblivious Algorithms : Algorithms in the Real World. Advantages of Cache-Oblivious Algorithms 4/9/13

Advanced Computer Graphics Project Report. Terrain Approximation

Storage Devices for Database Systems

How TokuDB Fractal TreeTM. Indexes Work. Bradley C. Kuszmaul. Guest Lecture in MIT Performance Engineering, 18 November 2010.

Applied Cartography and Introduction to GIS GEOG 2017 EL. Lecture-7 Chapters 13 and 14

ICS RESEARCH TECHNICAL TALK DRAKE TETREAULT, ICS H197 FALL 2013

C has been and will always remain on top for performancecritical

Report on Cache-Oblivious Priority Queue and Graph Algorithm Applications[1]

Transcription:

Computing Visibility on Terrains in External Memory Herman Haverkort Laura Toma Yi Zhuang TU. Eindhoven Netherlands Bowdoin College USA ALENEX 2007 New Orleans, USA

Visibility Problem: visibility map (viewshed) of v terrain T arbitrary viewpoint v the set of points in T visible from v Sierra Nevada, 30m resolution

Visibility Problem: visibility map (viewshed) of v terrain T arbitrary viewpoint v the set of points in T visible from v Applications graphics games GIS military applications, path planning, navigation placement of fire towers, radar sites, cell phone towers (terrain guarding)

Massive terrains Why massive terrains? Large amounts of data are becoming available NASA SRTM project: 30m resolution over the entire globe (~10TB) LIDAR data: sub-meter resolution Traditional algorithms don t scale Buy more RAM? Data grows faster than memory Data on disk Disks are MUCH slower than memory => I/O-bottleneck

I/O-efficient algorithms I/O-model [AV 88] Data on disk, arranged in blocks I/O-operation = reading/writing one block from/to disk n=grid size M=memory size B=block size I/O-complexity: nb. I/O-operations Basic I/O bounds ( n ) scan(n) = Θ B ( n ) < sort(n) = Θ B log M/B n/m n

Terrain data Most often: grid terrain TIN (triangulated polyhedral terrain) 20 23 25 26 32 46 21 20 24 28 41 46 24 21 23 31 36 36 23 22 24 27 33 34 32 22 29 30 35 34 29 30 33 34 36 37

Visibility on grids Line-of-sight model a grid cell with center q is visible from viewpoint v iff the line segment vq does not cross any cell that is above vq

Visibility: Related work Grids straightforward algorithm O(n 2 ) O(n lg n) by van Kreveld experimental Fisher [F93, F94], Franklin & Ray [FR94], Franklin [F02] no worst-case guarantees TINs surveys: de Floriani & Magillo [FM94], Cole & Sharir [CS89] recently: watchtowers and terrain guarding [SoCG 05, SODA 06]

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm

van Kreveld s algorithm 3n events, O(lg n) per event --> O(n lg n) CPU time

van Kreveld s algorithm -in external memory- Requires 4 structures in memory input elevation grid, output visibility grid stored in row-major order, read in sweep order event list status structure

van Kreveld s algorithm -in external memory- Requires 4 structures in memory input elevation grid, output visibility grid stored in row-major order, read in sweep order event list status structure B B B B B B......

van Kreveld s algorithm -in external memory- Requires 4 structures in memory input elevation grid, output visibility grid stored in row-major order, read in sweep order event list status structure B B B B B B......

van Kreveld s algorithm -in external memory- Requires 4 structures in memory input elevation grid, output visibility grid stored in row-major order, read in sweep order event list status structure If n > M: O(1) I/O per element, O(n) I/Os total B B B B B B......

van Kreveld s algorithm -in external memory- Requires 4 structures in memory input elevation grid, output visibility grid stored in row-major order, read in sweep order event list status structure If n > M: O(1) I/O per element, O(n) I/Os total B B B B B B...... Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 kreveld 1GB 1e+06 1e+07 1e+08 Grid size [number of points]

Our results n = grid size M=memory size B=block size The visibility grid of an arbitrary viewpoint on a grid of size n can be computed with O(n) space and O(sort(n)) I/Os Experimental evaluation ioviewshed standard algorithm (Kreveld) visibility algorithm in GRASS GIS

Computing visibility in external memory Distribution sweeping [GTVV FOCS93] divide input in M/B sectors each containing an equal nb. of points solve each sector recursively handle sector interactions

The base case Usually, stop recursion when n < M Our idea: stop when status structure fits in memory Run modified Kreveld elevation grid: encode elevation in event event list: store events in a sorted stream on disk visibility grid: when determining visibility of a cell, write it to a stream. Sort the stream at the end to get visibility grid Total: O(sort(n)) I/Os

cell <--> {start, end, query} 3n events The recursion

The recursion Divide events into O(M/B) sectors of equal size O(log M/B n) recursion levels If O(scan(n)) per recursion level --> overall scan(n) O(log M/B n) = O(sort(n))

The recursion: Distributing events to sectors query points narrow cells: wide cells: crossing at most one sector boundary crossing at least two sector boundaries

The recursion: Distributing events to sectors narrow cells cut and insert in both sectors

The recursion: Distributing events to sectors narrow cells cut and insert in both sectors wide cells cannot insert cell in each sector spanned (space blow-up) the visibility of a cell is determined by the highest of all wide cells that span the sector and are closer to the viewpoint all narrow cells in the sector that are closer to the viewpoint for each sector, process wide cells spanning the sector interleaved with query points and narrow cells in the sector, in increasing order of their distance form viewpoint

The recursion Input: event list in concentric order E c and in radial order E r Radial sweep: scan E r find sector boundaries compute a list E r of events in each sector Concentric sweep: scan E c for each sector keep a block of events in memory maintain the currently highest wide cell spanning the sector, High S if next event in E c is wide cell: for each sector spanned, update High S for that sector. narrow cell: if it is not occluded by High S, insert in the buffer of sector. Otherwise skip it. query point: if it is not occluded by High S, insert it in the buffer of sector. Otherwise, mark it as invisible and output it. Recurse on each sector O(scan(n)) per recursion level -> O(sort(n)) total

Experimental results kreveld C uses virtual memory system ioviewshed C++ uses an I/O core derived from TPIE library GRASS visibility module O(n 2 ) straightforward algorithm GRASS segment library for virtual memory management bypass the VMS, manage data allocation and de-allocation in segments on disk program will always run (no malloc() fails) but... slow

Experimental results Dataset Grid Size (million elements) MB (Grid Only) Valid size Kaweah 1.6 6 56% Puerto Rico 5.9 24 19% Experimental Platform Apple Power Mac G5 Dual 2.5 GHz processors 512 KB L2 cache 1 GB RAM Sierra Nevada 9.5 38 96% Hawaii 28.2 112 7% Cumberlands 67 268 27% Lower New England 77.8 312 36% Midwest USA 280 1100 86% Washington 1066 4264 95%

Running time [sec] 1e+06 100000 10000 1000 100 10 total time (seconds) 1GB RAM r.los kreveld ioviewshed 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] 1GB RAM Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 microseconds per grid point 1GB RAM 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] kreveld ioviewshed

Running time [sec] 1e+06 100000 10000 1000 100 10 total time (seconds) 1GB RAM r.los kreveld ioviewshed 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] 1GB RAM Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 microseconds per grid point 1GB RAM 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] kreveld ioviewshed GRASS program always runs (no malloc() failures) but is very slow kreveld starts thrashing on Hawaii (39% CPU, 739 seconds) malloc() fails on Cumberlands ioviewshed finishes Washington in 4.5 hours in practice status structure fits in memory, never enters recursion

Running time [sec] 1e+06 100000 10000 1000 100 10 total time (seconds) 1GB RAM r.los kreveld ioviewshed 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] 1GB RAM Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 microseconds per grid point 1GB RAM 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] kreveld ioviewshed Data set r.los kreveld ioviewshed Kaweah 2 928 8 (100 %) 13 (84 %) Puerto Rico 78 778 38 (100 %) 53 (78 %) Sierra Nevada 16 493 80 (95 %) 102 (67 %) Hawaii >1 200 000 736 (39 %) 353 (63 %) Cumberlands malloc fails 791 (63 %) LowerNE 865 (64 %) Midwest USA 3 546 (64 %) Washington 16 895 (68 %) Table 3: Running times (seconds) and CPU-utilization (in parentheses) at 1 GB RAM.

Running time [sec] 1e+06 100000 10000 1000 100 10 total time (seconds) 256 MB RAM r.los kreveld ioviewshed 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] 256MB RAM Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 microseconds per grid point 256 MB RAM 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] kreveld ioviewshed kreveld starts thrashing earlier (Puerto Rico, 38% CPU) ioviewshed slowdown on Washington dataset due 90% to sorting can be improved using customized I/O sorting [TPIE, STXXL]

Running time [sec] 1e+06 100000 10000 1000 100 10 total time (seconds) 256 MB RAM r.los kreveld ioviewshed 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] 256MB RAM Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 microseconds per grid point 256 MB RAM 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] kreveld ioviewshed Data set r.los kreveld ioviewshed Kaweah 2 984 7 (100 %) 13 (77 %) Puerto Rico 78 941 112 (38 %) 66 (60 %) Sierra Nevada 19 140 211 (29 %) 115 (57 %) Hawaii >1 200 000 1270 (27 %) 364 (63 %) Cumberlands malloc fails 768 (62 %) LowerNE 916 (62 %) Midwest USA 4 631 (52 %) Washington 40 734 (30 %) Table 4: Running times (seconds) and CPU-utilization (in parentheses) at 256 MB RAM.

Kaweah 1.6 6 56% 1GB vs. 256MB RAM kreveld Puerto Rico 5.9 24 19% Sierra Nevada 9.5 38 96% Hawaii 28.2 112 7% Cumberlands 67 268 27% Lower New England 77.8 312 36% Midwest 280 1100 86% Washington 1066 4264 95% total time (seconds) microseconds per grid point Running time [sec] 1e+06 100000 10000 1000 100 10 kreveld 256MB kreveld 1GB 1 1e+06 1e+07 1e+08 Grid size [number of points] Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 kreveld 256MB kreveld 1GB 1e+06 1e+07 1e+08 Grid size [number of points] starts thrashing earlier 1GB: Hawai, 39% CPU 256MB: Puerto Rico 38% CPU

Kaweah 1.6 6 56% 1GB vs. 256MB RAM ioviewshed Puerto Rico 5.9 24 19% Sierra Nevada 9.5 38 96% Hawaii 28.2 112 7% Cumberlands 67 268 27% Lower New England 77.8 312 36% Midwest 280 1100 86% Washington 1066 4264 95% total time (seconds) microseconds per grid point Running time [sec] 1e+06 100000 10000 1000 100 10 ioviewshed 256MB ioviewshed 1GB 1 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] Time [microsec]/point 50 45 40 35 30 25 20 15 10 5 ioviewshed 256MB ioviewshed 1GB 1e+06 1e+07 1e+08 1e+09 1e+10 Grid size [number of points] slowdown on Washington dataset due 90% to sorting can be improved using a customized I/O sorting [TPIE, STXXL]

Conclusion I/O-efficient visibility computation Theoretically worst-case optimal algorithm In practice status structure fits in memory with extended base case it never enters recursion Scalable Can process grids that are out of scope with traditional algorithm

Thank you.