Update wiki indexer

This commit is contained in:
Victor Shcherb 2012-04-30 00:36:40 +02:00
parent 67a9ab1930
commit fe1011d68d
3 changed files with 8 additions and 4 deletions

View file

@ -30,6 +30,7 @@ import org.xml.sax.helpers.DefaultHandler;
import net.osmand.Algoritms;
import net.osmand.LogUtil;
import net.osmand.MapCreatorVersion;
import net.osmand.data.IndexConstants;
import net.osmand.data.preparation.IndexCreator;
import net.osmand.impl.ConsoleProgressImplementation;
@ -133,7 +134,12 @@ public class WikiIndexer {
ic.setIndexAddress(false);
ic.generateIndexes(outFile, new ConsoleProgressImplementation(3), null, null, null, log);
// final step
new File(workPath, ic.getMapFileName()).renameTo(new File(targetPath, ic.getMapFileName()));
String targetMapFileName = ic.getMapFileName();
targetMapFileName =
targetMapFileName.substring(0, targetMapFileName.length() - IndexConstants.BINARY_MAP_INDEX_EXT.length()) +
"_" + IndexConstants.BINARY_MAP_VERSION + IndexConstants.BINARY_MAP_INDEX_EXT;
new File(workPath, ic.getMapFileName()).renameTo(new File(targetPath, targetMapFileName));
}
}
} catch (WikiIndexerException e) {

View file

@ -1,7 +1,7 @@
#!/bin/bash
function download {
echo "Start download $2";
wget --quiet --output-document="$2"_wiki_1."$1".xml.bz2 http://dumps.wikimedia.org/"$1"wiki/latest/"$1"wiki-latest-pages-articles.xml.bz2
wget --quiet --output-document="$2"_wiki."$1".xml.bz2 http://dumps.wikimedia.org/"$1"wiki/latest/"$1"wiki-latest-pages-articles.xml.bz2
}
cd ~/wiki/src;
download en English;

View file

@ -76,5 +76,3 @@ download_coord hu;
download_coord te;
download_coord ht;
download_coord ceb;