Skip to content

Commit

Permalink
Adapt RAPTOR profile routing to use new TransitNetwork
Browse files Browse the repository at this point in the history
Made duplicates of key raptor profile routing classes and prefixed names with TR.
These replacement classes will exist alongside the Graph-backed ones until they are finished.
The plan is for the new TR raptor profile routing to replace Graph-backed profile routing soon.
  • Loading branch information
abyrd committed Aug 26, 2015
1 parent 3ab62b5 commit c5dedb0
Show file tree
Hide file tree
Showing 20 changed files with 2,251 additions and 162 deletions.
28 changes: 19 additions & 9 deletions src/main/java/org/opentripplanner/analyst/PointSet.java
Expand Up @@ -33,7 +33,7 @@
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.routing.services.GraphService;
import org.opentripplanner.streets.StreetLayer;
import org.opentripplanner.streets.TempVertexList;
import org.opentripplanner.streets.LinkedPointSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -102,6 +102,7 @@ public class PointSet implements Serializable {
* Null in non-indicator pointsets.
* TODO remove this if unused, result sets are no longer PointSets.
*/
@Deprecated
public int[][] times;

// The characteristics of the features in this PointSet. This is a column store.
Expand Down Expand Up @@ -880,15 +881,24 @@ public Coordinate getCoordinate(int index) {

/**
* Creates an object similar to a SampleSet but for the new TransitNetwork representation.
* This is a somewhat slow operation involving a lot of geometry calculations.
* The resulting object should be cached.
* This is a somewhat slow operation involving a lot of geometry calculations. In some sense the point of making
* LinkedPointSets is to cache the relationship between the PointSet and a StreetLayer, so we don't have to
* repeatedly do a lot of geometry calculations to temporarily connect the points to the streets.
*/
public TempVertexList makeTempVertexList (StreetLayer streetLayer) {
TempVertexList tempVertexSet = new TempVertexList(streetLayer);
for (int i = 0; i < capacity; i++) {
tempVertexSet.addTempVertex(lats[i], lons[i]);
}
return tempVertexSet;
public LinkedPointSet link (StreetLayer streetLayer) {
return new LinkedPointSet(this, streetLayer);
}

/**
* Using getter methods here to allow generating coordinates and geometries on demand instead of storing them.
* This would allow for implicit geometry, as in a regular grid of points.
*/
public double getLat (int i) {
return lats[i];
}

public double getLon (int i) {
return lons[i];
}

}
Expand Up @@ -21,6 +21,9 @@
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

/**
* TODO what does this do? Does it really need to be a subclass?
*/
public class PointSetDatastore extends PointSetCache {

static private File POINT_DIR = new File("cache", "pointsets");
Expand Down

0 comments on commit c5dedb0

Please sign in to comment.