From e7d1c174fd45ce6c0680943e2e7deb38bfd71e0b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 23 Sep 2011 00:48:32 +0200 Subject: [PATCH] Update index info --- .../osmand/binary/BinaryMapPoiReaderAdapter.java | 16 ++++++++++++++++ OsmAnd/src/net/osmand/plus/ResourceManager.java | 4 ++-- .../osmand/plus/activities/LocalIndexHelper.java | 7 +++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/DataExtractionOSM/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java index e425ce501a..e05a5b582a 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -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; diff --git a/OsmAnd/src/net/osmand/plus/ResourceManager.java b/OsmAnd/src/net/osmand/plus/ResourceManager.java index 91be700277..ac2fce0383 100644 --- a/OsmAnd/src/net/osmand/plus/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/ResourceManager.java @@ -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))); diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java index 511d628074..5aac1d197a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java @@ -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);