git-svn-id: https://osmand.googlecode.com/svn/trunk@585 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-10-21 13:47:16 +00:00
parent 36824c4440
commit b0c8a5a169

View file

@ -39,6 +39,9 @@ public class IndexBatchCreator {
private static final String pagegen = ""; private static final String pagegen = "";
private static final String token = ""; private static final String token = "";
protected static final boolean deleteFilesAfterUploading = true;
protected static final Log log = LogUtil.getLog(IndexBatchCreator.class); protected static final Log log = LogUtil.getLog(IndexBatchCreator.class);
protected static final String SITE_TO_DOWNLOAD1 = "http://download.geofabrik.de/osm/europe/"; //$NON-NLS-1$ protected static final String SITE_TO_DOWNLOAD1 = "http://download.geofabrik.de/osm/europe/"; //$NON-NLS-1$
@ -125,6 +128,7 @@ public class IndexBatchCreator {
}; };
// NORTH AMERICA // NORTH AMERICA
// TODO map.odb
protected static final String[] northAmerica = new String[] { protected static final String[] northAmerica = new String[] {
"Bahamas", "Costa_Rica", "Cuba", "Dominica", "Dominican_Republic", "Bahamas", "Costa_Rica", "Cuba", "Dominica", "Dominican_Republic",
"Guatemala", "Haiti", "Honduras", "Jamaica", "Mexico", "Guatemala", "Haiti", "Honduras", "Jamaica", "Mexico",
@ -137,7 +141,7 @@ public class IndexBatchCreator {
}; };
// TODO map.odb
protected static final String[] southAmerica = new String[] { protected static final String[] southAmerica = new String[] {
"Argentina","Bolivia","Brazil","Chile","Colombia", "Argentina","Bolivia","Brazil","Chile","Colombia",
"Ecuador","Falkland_Islands", "French_Guiana","Guyana","Paraguay", "Ecuador","Falkland_Islands", "French_Guiana","Guyana","Paraguay",
@ -167,13 +171,12 @@ public class IndexBatchCreator {
// "kemerovo", "khabar", "khakas", "khanty", "kirov", "komi", "kostrom", "krasnodar", // "kemerovo", "khabar", "khakas", "khanty", "kirov", "komi", "kostrom", "krasnodar",
// "krasnoyarsk", "kurgan", "kursk", "leningrad", "lipetsk", "magadan", "mariyel", "mordov", "moscow", "mosobl", "murmansk", // "krasnoyarsk", "kurgan", "kursk", "leningrad", "lipetsk", "magadan", "mariyel", "mordov", "moscow", "mosobl", "murmansk",
// "nenec", "nizhegorod", "novgorod", "novosib", "omsk", "orenburg", "orlovsk", "osetiya", // "nenec", "nizhegorod", "novgorod", "novosib", "omsk", "orenburg", "orlovsk", "osetiya",
// "penz", "perm", // "penz", "perm", "prim", "pskov", "rostov", "ryazan", "sakhalin", "samar", "saratov", "smol",
// TODO map.odb
// "prim", "pskov", "rostov", "ryazan", "sakhalin", "samar", "saratov", "smol",
// "stavrop", "stpeter", "sverdl", "tambov", "tatar", "tomsk", "tul", "tumen", "tver", "tyva", "udmurt", // "stavrop", "stpeter", "sverdl", "tambov", "tatar", "tomsk", "tul", "tumen", "tver", "tyva", "udmurt",
// "ulyan", "vladimir", "volgograd", "vologda", "voronezh", "yakut", "yamal", "yarosl", "zabaikal", // "ulyan", "vladimir", "volgograd", "vologda", "voronezh", "yakut", "yamal", "yarosl", "zabaikal",
}; };
// TODO map.odb
protected static final String[] asia = new String[] { protected static final String[] asia = new String[] {
"Afghanistan", "Bahrain", "Bangladesh", "Bhutan", "British_Indian_Ocean_Territory", "Brunei", "Cambodia", "Afghanistan", "Bahrain", "Bangladesh", "Bhutan", "British_Indian_Ocean_Territory", "Brunei", "Cambodia",
"China", "Christmas_Island", "Democratic_Republic_of_Timor-Leste", "Gaza_Strip", "India", "Indonesia", "Iran", "China", "Christmas_Island", "Democratic_Republic_of_Timor-Leste", "Gaza_Strip", "India", "Indonesia", "Iran",
@ -497,7 +500,7 @@ public class IndexBatchCreator {
} else { } else {
return; return;
} }
if(mbLengh < 0.03){ if(mbLengh < 0.015){
// do not upload small files // do not upload small files
return; return;
} }
@ -556,6 +559,9 @@ public class IndexBatchCreator {
uploader.setSummary(summary.replace('_', ' ')); uploader.setSummary(summary.replace('_', ' '));
try { try {
uploader.upload(); uploader.upload();
if(deleteFilesAfterUploading){
f.delete();
}
alreadyUploadedFiles.add(f.getName()); alreadyUploadedFiles.add(f.getName());
} catch (IOException e) { } catch (IOException e) {
log.error("Input/output exception uploading " + f.getName(), e); log.error("Input/output exception uploading " + f.getName(), e);