small improvement
git-svn-id: https://osmand.googlecode.com/svn/trunk@305 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
ff38418d90
commit
c4d79fa614
1 changed files with 41 additions and 39 deletions
|
@ -32,7 +32,7 @@ public class IndexBatchCreator {
|
|||
protected static final String[] countriesToDownload1 = new String[] {
|
||||
// "albania", "andorra", "austria", // 5.3, 0.4, 100 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// "belarus", "belgium", "bosnia-herzegovina", // 39, 43, 4.1 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"bulgaria", "croatia", "cyprus", // 13, 12, 5 //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
||||
// "bulgaria", "croatia", "cyprus", // 13, 12, 5 //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
||||
// "denmark", "estonia", "faroe_islands", // 75, 38, 1.5 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// "finland", "greece", "hungary", //80, 25, 14 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// "iceland", "ireland", "isle_of_man", // 5.9, 27, 1.1 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
@ -59,14 +59,14 @@ public class IndexBatchCreator {
|
|||
protected static final String SITE_TO_DOWNLOAD2 = "http://downloads.cloudmade.com/"; //$NON-NLS-1$
|
||||
// us states
|
||||
protected static final String[] usStates = new String[] {
|
||||
// "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut",
|
||||
// "Delaware", "District_of_Columbia", "Florida", "Georgia", "Guantanamo_Bay", "Hawaii",
|
||||
// "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine",
|
||||
// "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri",
|
||||
// "Montana", "Nebraska", "Nevada", "New_Hampshire", "New_Jersey", "New_Mexico",
|
||||
// "New_York", "North_Carolina", "North_Dakota", "Ohio", "Oklahoma", "Oregon",
|
||||
// "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
|
||||
// "Texas", "Utah", "Vermont", "Virginia", "Washington", "West_Virginia", "Wisconsin", "Wyoming",
|
||||
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut",
|
||||
"Delaware", "District_of_Columbia", "Florida", "Georgia", "Guantanamo_Bay", "Hawaii",
|
||||
"Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine",
|
||||
"Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri",
|
||||
"Montana", "Nebraska", "Nevada", "New_Hampshire", "New_Jersey", "New_Mexico",
|
||||
"New_York", "North_Carolina", "North_Dakota", "Ohio", "Oklahoma", "Oregon",
|
||||
"Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
|
||||
"Texas", "Utah", "Vermont", "Virginia", "Washington", "West_Virginia", "Wisconsin", "Wyoming",
|
||||
};
|
||||
protected static final String[] canadaStates = new String[] {
|
||||
// "Alberta","British_Columbia","Manitoba","New_Brunswick","Newfoundland",
|
||||
|
@ -137,6 +137,7 @@ public class IndexBatchCreator {
|
|||
File f = new File(osmDirFiles, country +".osm.bz2");
|
||||
downloadFile(url, f); //$NON-NLS-1$
|
||||
generateIndex(f, alreadyGeneratedFiles, alreadyUploadedFiles);
|
||||
System.gc();
|
||||
}
|
||||
|
||||
for(String country : usStates){
|
||||
|
@ -192,13 +193,7 @@ public class IndexBatchCreator {
|
|||
continue;
|
||||
}
|
||||
if (f.getName().endsWith(".osm.bz2") || f.getName().endsWith(".osm")) {
|
||||
System.gc();
|
||||
try {
|
||||
generateIndex(f, alreadyGeneratedFiles, alreadyUploadedFiles);
|
||||
} catch (OutOfMemoryError e) {
|
||||
log.error("OutOfMemory", e);
|
||||
System.gc();
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("GENERATING INDEXES FINISHED ");
|
||||
|
@ -207,6 +202,7 @@ public class IndexBatchCreator {
|
|||
if (!generateIndexes) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
DataExtraction extr = new DataExtraction(indexAddress, indexPOI, indexTransport, indexAddress, false, false, indexDirFiles);
|
||||
try {
|
||||
alreadyGeneratedFiles.add(f.getName());
|
||||
|
@ -231,6 +227,12 @@ public class IndexBatchCreator {
|
|||
} catch (Exception e) {
|
||||
log.error("Exception generating indexes for " + f.getName()); //$NON-NLS-1$
|
||||
}
|
||||
} catch (OutOfMemoryError e) {
|
||||
System.gc();
|
||||
log.error("OutOfMemory", e);
|
||||
|
||||
}
|
||||
System.gc();
|
||||
}
|
||||
|
||||
protected File[] getSortedFiles(File dir){
|
||||
|
|
Loading…
Reference in a new issue