New vector isochrone generation.

(Extract from https://groups.google.com/forum/#!topic/opentripplanner-dev/ZcprBhpXAuE and https://groups.google.com/forum/#!topic/opentripplanner-dev/Gwbu2x-B7Jo)

The current vector isochrone generator rely on building a convex hull out of a delaunay triangulation of some vertex points from the shortest-path tree graph. However, this implementation lack a few features. I will be trying to address the following points: 

a) support disconnected areas (the output of the isochrone should be a set of polygons). This is important especially for transit isochrones where the result is a highly fragmented area with small islands around stations; 
b) support holes. This is less important than a) but for eg. rivers or large unaccessible areas, some polygons can have many holes; 
c) no hard limit on the covered area. Real accessible area should be covering an area nearby roads, with an accessibility function (off-road walk speed, off-road max distance...); 
d) output is "street-accessible area". There can be two definitions of an isochrone (only considering area accessible on street, or accessible even if you are still on the transit vehicle), for standard usage I think the first definition make more sense; 
e) be able to build several isochrones per request; 
f) have a configurable and constant precision; 
g) polygons within each isochrone should not intersect (also holes); 
h) isochrones from different z values should not intersect. 

Since some points would be rather hard or impossible to solve with the current isochrone implementation, I made another one based on a rather different algorithm, which try to cover all this points. 

Here is the result of a new method, which I may call "accumulative grid sampling". 

Basically it works as the following: 

1) compute the SPT, as before, clamping the search to the max z cutoff. 
2) for each edge geometry in the resulting SPT, take a sample at the two ends and eventually at evenly-spaced intermediate points if the geometry is longer than a certain threshold (currently d0/2, d0 being the grid size). For each sample, find the 4 enclosing grid sample points and accumulate for each of them a triplet (w, tw, d). See below the details of this.
3) close our samples grid by adding new samples on the border. 
4) compute the set of rings (exactly as in the previous method but without iterative sampling) to build the polygons. z0 plane intersection detection and interpolation is detailed below.

For each sample on the grid, we keep w, tw and d value (a multi-valued z function for the generic isoline-builder class): 

- d is the minimum distance between any sample point "real" location and the sample "grid" location: d=min({di}). 
- w is the accumulated weight factor for each sample: w=sum({wi}). In a first trial I used a gaussian bell function of d, with d0 as a standard deviation and 0 as mean. To make it faster to compute I now use a simpler inverse square wi=1/(di+d0)^2, without significant changes in the results. 
- tw is the weighted sum of ti: tw=sum({ti.wi}) 

For intersection detection: 
- if d > dmax, then z=+inf 
- otherwise z=tw/w 
- We have an intersection if zA<t0<=zB or zB<t0<=zA. 

For the linear interpolation on an edge [AB], in case of intersection: 
- if dA >= dmax OR dB >= dmax (dmax is the max off-road distance), we  linearly interpolate based on d only; 
- otherwise we interpolate based on tw/w. 

The advantages of this method compared to the previous one are: 
- Faster. Since we do not have to find the vertex of any point we do not use a spatial index anymore. Finding the grid point knowing the sample coordinates is direct and really fast. Also the sampling grid uses simple data access (int indexing, custom-made sparse matrix implementation, direct link to neighbors) to speed up the computation. 
We do not use any Maps or Sets anymore, and minimize temporary object creation. 
- Better off-road edge shapes thanks to the distance interpolation.
- Should handle large and sparse SPT. If the SPT path have many small  island around a set of stations in a large area, the computation time is only dependent on the SPT size itself and the isochrone rings perimeters. Having a SPT with many large non-covered area (should) not be an issue. 
- The isoline generation class is simpler (no iterative process). 
- Faster to compute many isochrones. Since we sample the grid only once, and the isochrone building is really fast (3 isochrone building takes approx 3 times less than sampling), computing many isochrones in one request is way faster than before.

The drawbacks: 
- The max off-road distance (dmax) can't be much smaller or larger than the grid size (d0). Theorically it could be larger, but we need to add more sample to close the set in step 3). The ratio between the two has an impact on the resulting shape. 
- The resulting shape is somehow dependent on the grid size. This make sense of course, since the smaller the grid the more precise it gets, but due to the limited grid sampling we have small edges appearing or diseappearing depending on d0 and location of sampling. This is also due to the averaging (tw is the weighted average from all samples in the average). I tried to keep only the nearest value (t=ti if d=dmin) but this does not seems to have a big impact. In urban area, best results are for grid size 100m to 200m. 
- A point that fall initially in the isochrone area in the SPT sample could be outside the computed area, again due to this sampling. I did not investigated this a lot, but this could be interesting to compare various results to check for coherency. 

For speed, the 
![attached output](https://f.cloud.github.com/assets/959548/1473725/ff87452e-4620-11e3-9240-a954c3f8f44a.jpg)
 takes ~ 400 ms to compute (~300ms for sampling and ~100 ms for the 3 isolines), on top of ~ 250 ms for the SPT, with a grid size of 100m x 100m and a SPT consisting of 160k samples. For the same grid size, number of isochrone and area, I think this is approx. 3 to 5 times faster than the previous method.