add index batch creator

git-svn-id: https://osmand.googlecode.com/svn/trunk@427 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-08-02 17:20:32 +00:00
parent c1d63167ab
commit 6ab7d87b5d
2 changed files with 18 additions and 5 deletions

View file

@ -26,7 +26,7 @@ import com.osmand.impl.ConsoleProgressImplementation;
public class IndexBatchCreator {
// config params
private static final boolean indexPOI = true;
private static final boolean indexAddress = false;
private static final boolean indexAddress = true;
private static final boolean indexTransport = true;
private static final boolean writeWayNodes = true;
@ -123,8 +123,15 @@ public class IndexBatchCreator {
// "ulyan","vladimir","volgograd","vologda","voronezh","yakut","yamal","yarosl","zabaikal",
};
// TODO Japan
protected static final String[] asia = new String[] {
"Afghanistan", "Bahrain", "Bangladesh", "Bhutan", "British_Indian_Ocean_Territory", "Brunei", "Cambodia",
"China", "Christmas_Island", "Democratic_Republic_of_Timor-Leste", "Gaza_Strip", "India", "Indonesia", "Iran",
"Iraq", "Israel", "Jordan", "Kazakhstan", "Kuwait", "Kyrgyzstan", "Laos", "Lebanon", "Macau", "Malaysia",
"Maldives", "Mongolia", "Nepal", "North_Korea", "Oman", "Pakistan", "Paracel_Islands", "Philippines", "Qatar",
"Saudi_Arabia", "Singapore", "South_Korea", "Spratly_Islands", "Sri_Lanka", "Syria", "Taiwan", "Tajikistan",
// "Thailand", "Turkey", "Turkmenistan", "Union_of_Myanmar", "United_Arab_Emirates", "Uzbekistan", "Vietnam", "Yemen",
};
boolean downloadFiles = false;
@ -225,7 +232,13 @@ public class IndexBatchCreator {
downloadFile(url, country, alreadyGeneratedFiles, alreadyUploadedFiles);
}
// TODO ASIA only russia done //
// ASIA //
for(String country : asia){
country = country.toLowerCase();
String url = SITE_TO_DOWNLOAD2 + "asia/"+country+"/"+country +".osm.bz2"; //$NON-NLS-1$
downloadFile(url, country, alreadyGeneratedFiles, alreadyUploadedFiles);
}
// russia
for(String country : russiaStates){
country = country.toLowerCase();

View file

@ -156,7 +156,7 @@ public class OsmBugsLayer implements OsmandMapLayer {
public void requestToLoad(double topLatitude, double leftLongitude, double bottomLatitude,double rightLongitude, final int zoom){
boolean inside = cTopLatitude >= topLatitude && cLeftLongitude <= leftLongitude && cRightLongitude >= rightLongitude
&& cBottomLatitude <= bottomLatitude;
if(!inside || (czoom != zoom && objects.size() >= SEARCH_LIMIT)){
if((!inside || (czoom != zoom && objects.size() >= SEARCH_LIMIT)) && handlerToLoop != null){
handlerToLoop.removeMessages(1);
final double nTopLatitude = topLatitude + (topLatitude -bottomLatitude);
final double nBottomLatitude = bottomLatitude - (topLatitude -bottomLatitude);