@Override
    public boolean loadExisting() {
        if (!index.loadExisting())
            return false;

        if (index.getHeader(0) != MAGIC_INT)
            throw new IllegalStateException("incorrect loc2id index version");

        int lat = index.getHeader(1 * 4);
        int lon = index.getHeader(2 * 4);
        int checksum = index.getHeader(3 * 4);
        if (checksum != graph.getNodes())
            throw new IllegalStateException("index was created from a different graph with "
                    + checksum + ". Current nodes:" + graph.getNodes());

        initAlgo(lat, lon);
        return true;
    }
@ Override public boolean loadExisting ( ) { if ( ! index . loadExisting ( ) ) return false ; if ( index . getHeader ( 0 ) != MAGIC_INT ) throw new IllegalStateException ( "incorrect loc2id index version" ) ; int lat = index . getHeader ( 1 * 4 ) ; int lon = index . getHeader ( 2 * 4 ) ; int checksum = index . getHeader ( 3 * 4 ) ; if ( checksum != graph . getNodes ( ) ) throw new IllegalStateException ( "index was created from a different graph with " + checksum + ". Current nodes:" + graph . getNodes ( ) ) ; initAlgo ( lat , lon ) ; return true ; }
Loads the index from disc if exists. Make sure you are using the identical graph which was
used while flushing this index.
<p>

@return if loading from file was successfully.