Mapsforge: increase limit for max way length causing empty tiles, fix #370

This commit is contained in:
Emux
2017-06-30 22:17:53 +03:00
parent 25f0310334
commit 8db30d8537
2 changed files with 3 additions and 8 deletions

View File

@@ -15,7 +15,7 @@
- vtm-ios-example module [#326](https://github.com/mapsforge/vtm/issues/326)
- Handle layers enabled state [#342](https://github.com/mapsforge/vtm/issues/342)
- Fix coord scale short overflow [#343](https://github.com/mapsforge/vtm/issues/343)
- Mapsforge map read improvements [#357](https://github.com/mapsforge/vtm/issues/357)
- Mapsforge map read improvements [#357](https://github.com/mapsforge/vtm/issues/357) [#370](https://github.com/mapsforge/vtm/issues/370)
- Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349)
- OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366)
- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338)

View File

@@ -77,11 +77,6 @@ public class MapDatabase implements ITileDataSource {
static final Logger log = LoggerFactory.getLogger(MapDatabase.class);
/**
* Maximum way nodes sequence length which is considered as valid.
*/
private static final int MAXIMUM_WAY_NODES_SEQUENCE_LENGTH = 8192;
/**
* Bitmask for the optional POI feature "elevation".
*/
@@ -224,7 +219,7 @@ public class MapDatabase implements ITileDataSource {
}
if (mIntBuffer == null)
mIntBuffer = new int[MAXIMUM_WAY_NODES_SEQUENCE_LENGTH * 2];
mIntBuffer = new int[Short.MAX_VALUE * 2];
try {
mTileProjection.setTile(tile);
@@ -628,7 +623,7 @@ public class MapDatabase implements ITileDataSource {
for (int coordinateBlock = 0; coordinateBlock < numBlocks; ++coordinateBlock) {
int numWayNodes = mReadBuffer.readUnsignedInt();
if (numWayNodes < 2 || numWayNodes > MAXIMUM_WAY_NODES_SEQUENCE_LENGTH) {
if (numWayNodes < 2 || numWayNodes > Short.MAX_VALUE) {
log.warn("invalid number of way nodes: " + numWayNodes);
logDebugSignatures();
return false;