Remove poi support. Trying to remove poi.odb completely / leave only for internal usage

This commit is contained in:
Victor Shcherb 2012-01-19 00:31:43 +01:00
parent 199220d5e5
commit 2ac2f17603
3 changed files with 7 additions and 44 deletions

View file

@ -76,9 +76,7 @@ public class DownloadOsmandIndexesHelper {
public String getVisibleDescription(Context ctx){
String s = ""; //$NON-NLS-1$
if (fileName.endsWith(IndexConstants.POI_INDEX_EXT) || fileName.endsWith(IndexConstants.POI_INDEX_EXT_ZIP)) {
s = ctx.getString(R.string.poi);
} else if (fileName.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)
if (fileName.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)
|| fileName.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT_ZIP)) {
String lowerCase = description.toLowerCase();
if (lowerCase.contains("map")) { //$NON-NLS-1$

View file

@ -552,34 +552,12 @@ public class ResourceManager {
return false;
}
// POI not supported any more
public void indexingPoi(final IProgress progress, List<String> warnings, File f) {
if (f.getName().endsWith(IndexConstants.POI_INDEX_EXT)) {
AmenityIndexRepositoryOdb repository = new AmenityIndexRepositoryOdb();
progress.startTask(context.getString(R.string.indexing_poi) + " " + f.getName(), -1); //$NON-NLS-1$
try {
boolean initialized = repository.initialize(progress, f);
if (initialized) {
boolean covered = false;
for(AmenityIndexRepository r : amenityRepositories){
if(r instanceof AmenityIndexRepositoryBinary){
double latC = (repository.dataBottomLatitude + repository.dataTopLatitude )/ 2;
double lonC = (repository.dataLeftLongitude + repository.dataRightLongitude) / 2;
if(r.checkContains(latC, lonC)){
covered = true;
break;
}
}
}
if(covered){
repository.close();
warnings.add(context.getString(R.string.old_poi_file_should_be_deleted, f.getName())); //$NON-NLS-1$
} else {
amenityRepositories.add(repository);
indexFileNames.put(f.getName(), MessageFormat.format("{0,date,dd.MM.yyyy}", new Date(f.lastModified()))); //$NON-NLS-1$
}
} else {
warnings.add(MessageFormat.format(context.getString(R.string.version_index_is_not_supported), f.getName())); //$NON-NLS-1$
}
} catch (SQLiteException e) {
log.error("Exception reading " + f.getAbsolutePath(), e); //$NON-NLS-1$
warnings.add(MessageFormat.format(context.getString(R.string.version_index_is_not_supported), f.getName())); //$NON-NLS-1$

View file

@ -3,9 +3,6 @@ package net.osmand.plus.activities;
import static net.osmand.data.IndexConstants.BINARY_MAP_INDEX_EXT;
import static net.osmand.data.IndexConstants.BINARY_MAP_INDEX_EXT_ZIP;
import static net.osmand.data.IndexConstants.BINARY_MAP_VERSION;
import static net.osmand.data.IndexConstants.POI_INDEX_EXT;
import static net.osmand.data.IndexConstants.POI_INDEX_EXT_ZIP;
import static net.osmand.data.IndexConstants.POI_TABLE_VERSION;
import static net.osmand.data.IndexConstants.TTSVOICE_INDEX_EXT_ZIP;
import static net.osmand.data.IndexConstants.TTSVOICE_VERSION;
import static net.osmand.data.IndexConstants.VOICE_INDEX_EXT_ZIP;
@ -444,7 +441,7 @@ public class DownloadIndexActivity extends ExpandableListActivity {
private Collection<String> listAlreadyDownloadedWithAlternatives() {
Set<String> files = new TreeSet<String>();
File externalStorageDirectory = OsmandSettings.getOsmandSettings(getApplicationContext()).getExternalStorageDirectory();
files.addAll(listWithAlternatives(new File(externalStorageDirectory, ResourceManager.POI_PATH),POI_INDEX_EXT,POI_INDEX_EXT_ZIP,POI_TABLE_VERSION));
// files.addAll(listWithAlternatives(new File(externalStorageDirectory, ResourceManager.POI_PATH),POI_INDEX_EXT,POI_INDEX_EXT_ZIP,POI_TABLE_VERSION));
files.addAll(listWithAlternatives(new File(externalStorageDirectory, ResourceManager.APP_DIR),BINARY_MAP_INDEX_EXT,BINARY_MAP_INDEX_EXT_ZIP,BINARY_MAP_VERSION));
files.addAll(listWithAlternatives(new File(externalStorageDirectory, ResourceManager.BACKUP_PATH),BINARY_MAP_INDEX_EXT,BINARY_MAP_INDEX_EXT_ZIP,BINARY_MAP_VERSION));
files.addAll(listWithAlternatives(new File(externalStorageDirectory, ResourceManager.VOICE_PATH),"",VOICE_INDEX_EXT_ZIP, VOICE_VERSION));
@ -483,15 +480,7 @@ public class DownloadIndexActivity extends ExpandableListActivity {
boolean unzipDir = false;
File externalStorageDirectory = OsmandSettings.getOsmandSettings(getApplicationContext()).getExternalStorageDirectory();
if(fileName.endsWith(IndexConstants.POI_INDEX_EXT)){
parent = new File(externalStorageDirectory, ResourceManager.POI_PATH);
toSavePostfix = POI_INDEX_EXT;
toCheckPostfix = POI_INDEX_EXT;
} else if(fileName.endsWith(IndexConstants.POI_INDEX_EXT_ZIP)){
parent = new File(externalStorageDirectory, ResourceManager.POI_PATH);
toSavePostfix = POI_INDEX_EXT_ZIP;
toCheckPostfix = POI_INDEX_EXT;
} else if(fileName.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)){
if(fileName.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)){
parent = new File(externalStorageDirectory, ResourceManager.APP_DIR);
toSavePostfix = BINARY_MAP_INDEX_EXT;
toCheckPostfix = BINARY_MAP_INDEX_EXT;
@ -620,9 +609,7 @@ public class DownloadIndexActivity extends ExpandableListActivity {
private String convertServerFileNameToLocal(String name){
int l = name.lastIndexOf('_');
String s;
if(name.endsWith(IndexConstants.POI_INDEX_EXT) || name.endsWith(IndexConstants.POI_INDEX_EXT_ZIP)){
s = IndexConstants.POI_INDEX_EXT;
} else if(name.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT) || name.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT_ZIP)){
if(name.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT) || name.endsWith(IndexConstants.BINARY_MAP_INDEX_EXT_ZIP)){
s = IndexConstants.BINARY_MAP_INDEX_EXT;
} else {
s = ""; //$NON-NLS-1$