Search in sources :

Example 1 with Zone

use of im.tny.segvault.subway.Zone in project underlx by underlx.

the class MainService method loadNetworks.

private void loadNetworks() {
    synchronized (lock) {
        try {
            Network net = TopologyCache.loadNetwork(this, PRIMARY_NETWORK_ID, api.getEndpoint().toString());
            putNetwork(net);
            S2LS loc = locServices.get(PRIMARY_NETWORK_ID);
            Log.d("loadNetworks", String.format("In network? %b", loc.inNetwork()));
            Log.d("loadNetworks", String.format("Near network? %b", loc.nearNetwork()));
            Zone z = loc.getLocation();
            for (Stop s : z.vertexSet()) {
                Log.d("loadNetworks", String.format("May be in station %s", s));
            }
        } catch (CacheException e) {
            // cache invalid, attempt to reload topology
            updateTopology();
        }
    }
}
Also used : S2LS(im.tny.segvault.s2ls.S2LS) Stop(im.tny.segvault.subway.Stop) CacheException(im.tny.segvault.disturbances.exception.CacheException) Zone(im.tny.segvault.subway.Zone) Network(im.tny.segvault.subway.Network)

Aggregations

CacheException (im.tny.segvault.disturbances.exception.CacheException)1 S2LS (im.tny.segvault.s2ls.S2LS)1 Network (im.tny.segvault.subway.Network)1 Stop (im.tny.segvault.subway.Stop)1 Zone (im.tny.segvault.subway.Zone)1