CSC234 - Project 5 - Places

Overview

In this project, you will be building an Android application that can find the N closest locations on Centenary's campus.

We would like to efficiently search a space for nearby locations. The naive way to do this would be to walk through a list of objects and sort them based on their distance from the starting location, but with 1,000,000 entries, this is prohibitive.

In this project, you will implement a version of a Spatial DataBase for proximity search using a QuadTree and a Heap. A QuadTree is a two-dimensional version of a Binary Tree, such that instead of a left and a right, there is a NW, NE, SW and SE child. The particular version we will implement is called a PR (Point Region) QuadTree. Each child is exactly 1/4 of the size of it's parent.

To implement our QuadTree and proximity search, we will need a number of smaller instantiable objects. Each object should have the usual accessor and mutator methods for each data member, and a toString and equals method. Feel free to add other objects and methods you see fit to complete this project.

GeoPoint

First, we reuse your GeoPoint object from the WallDrug project. you will need to augment the distance function so that a GeoPoint can calculate the great circle distance between itself, QTLocations and QuadNodes.

ProxDist<E> implements Comparable<ProxDist>

Next, we define the superclass ProxDist, which will be the parent of Location and QuadNode. This class implements the Comparable interface.

Data Members

Methods

QTLocation<E> extends ProxDist<E>

The QTLocation object represents unique locations on the map, as well as the name of the place interest to the proximity search.

Data Members

QTLocation only needs get and set methods for p and item.

QuadNode<E> extends ProxDist<E>

The QuadNode implements similar methods to the BinaryNode class discussed in class.

Data Members

Methods

QuadTree<E> implements SpatialDB<E>

A full QuadTree should have an add and a remove method. For this project, we will only implement the add method. The key method of the QuadTree for us is the proximitySearch algorithm.

Data Members

Methods


© Mark Goadrich 2011, Centenary College of Louisiana