Update index info

This commit is contained in:
Victor Shcherb 2011-09-23 00:48:32 +02:00
parent e47d9efe5f
commit e7d1c174fd
3 changed files with 25 additions and 2 deletions

View file

@ -32,6 +32,22 @@ public class BinaryMapPoiReaderAdapter {
int right31X;
int top31Y;
int bottom31Y;
public int getLeft31X() {
return left31X;
}
public int getRight31X() {
return right31X;
}
public int getTop31Y() {
return top31Y;
}
public int getBottom31Y() {
return bottom31Y;
}
}
private CodedInputStreamRAF codedIS;

View file

@ -473,8 +473,8 @@ public class ResourceManager {
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$
}
if(index.containsPoiData())
}
if(index.containsPoiData()) {
try {
RandomAccessFile raf = new RandomAccessFile(f, "r"); //$NON-NLS-1$
amenityRepositories.add(new AmenityIndexRepositoryBinary(new BinaryMapIndexReader(raf)));

View file

@ -24,6 +24,7 @@ import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.binary.BinaryMapAddressReaderAdapter.AddressRegion;
import net.osmand.binary.BinaryMapIndexReader.MapIndex;
import net.osmand.binary.BinaryMapIndexReader.MapRoot;
import net.osmand.binary.BinaryMapPoiReaderAdapter.PoiRegion;
import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex;
import net.osmand.data.IndexConstants;
import net.osmand.map.TileSourceManager;
@ -354,6 +355,12 @@ public class LocalIndexHelper {
String box = formatLatLonBox(mapRoot.getLeft(), mapRoot.getRight(), mapRoot.getTop(), mapRoot.getBottom());
builder.append(box).append("\n");
}
} else if(part instanceof PoiRegion){
PoiRegion mi = ((PoiRegion) part);
builder.append(app.getString(R.string.local_index_poi_data)).append(": ").
append(mi.getName()).append("\n");
String box = formatLatLonBox(mi.getLeft31X(), mi.getRight31X(), mi.getTop31Y(), mi.getBottom31Y());
builder.append(box).append("\n");
} else if(part instanceof TransportIndex){
TransportIndex mi = ((TransportIndex) part);
int sh = (31 - BinaryMapIndexReader.TRANSPORT_STOP_ZOOM);