From 45c33e0f07e6b435be1eefd2a5c724f8c4432640 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 1 Nov 2010 13:00:53 +0000 Subject: [PATCH] fix NPE git-svn-id: https://osmand.googlecode.com/svn/trunk@619 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- .../src/net/osmand/data/preparation/IndexCreator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java index b19c572171..b8f7ad1fda 100644 --- a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java +++ b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java @@ -1419,7 +1419,7 @@ public class IndexCreator { } int prevX = 0; int prevY = 0; - boolean cycle = nodes.get(0).getId() == nodes.get(nodes.size() - 1).getId(); + boolean cycle = ((Way) e).getNodeIds().get(0).longValue() == ((Way) e).getNodeIds().get(nodes.size() - 1).longValue(); boolean addLast = hasMulti || cycle; int minX = Integer.MAX_VALUE; @@ -2017,8 +2017,10 @@ public class IndexCreator { // creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb")); // creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/minsk.osm"), new ConsoleProgressImplementation(3), null); - creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb")); - creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus.osm.bz2"), new ConsoleProgressImplementation(3), null); +// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb")); +// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus.osm.bz2"), new ConsoleProgressImplementation(3), null); + + creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/zimbabwe.osm.bz2"), new ConsoleProgressImplementation(3), null); // creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/forest.osm"), new ConsoleProgressImplementation(3), null);