CSC234 - Project 5 - Places

Materials

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 need a GeoPoint object that can keep track of the latitude and longitude. You must implement two methods. One to calculate the Great Circle Distance between two GeoPoints and one to calculate the Bearing between two GeoPoints on the Earth. 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<E>>

Next, we define the superclass ProxDist, which will be the parent of QTLocation 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

Methods 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 needs both an add and a remove method. The key method of the QuadTree for us is the proximitySearch algorithm.

Data Members

Methods


© Mark Goadrich 2014, Centenary College of Louisiana