Fix address creator bug

This commit is contained in:
Victor Shcherb 2012-01-02 23:44:11 +01:00
parent 0b0aca1321
commit be7d47a9d6
2 changed files with 15 additions and 11 deletions

View file

@ -37,13 +37,15 @@ public class Boundary {
if (getOuterWays().size() > 0) {
// now we try to merge the ways until we have only one
int oldSize = 0;
while (getOuterWays().size() != oldSize) {
while (getOuterWays().size() != oldSize && !getOuterWays().isEmpty()) {
oldSize = getOuterWays().size();
mergeOuterWays();
}
// there is one way and last element is equal to the first...
List<Node> nodes = getOuterWays().get(0).getNodes();
closedWay = getOuterWays().size() == 1 && nodes.get(0).getId() == nodes.get(nodes.size() - 1).getId();
if (!getOuterWays().isEmpty()) {
// there is one way and last element is equal to the first...
List<Node> nodes = getOuterWays().get(0).getNodes();
closedWay = getOuterWays().size() == 1 && nodes.get(0).getId() == nodes.get(nodes.size() - 1).getId();
}
} else {
closedWay = false;
}

View file

@ -465,17 +465,19 @@ public class IndexBatchCreator {
if (fh != null) {
LogManager.getLogManager().getLogger("").addHandler(fh);
}
indexCreator.generateIndexes(f, new ConsoleProgressImplementation(3), null, mapZooms, types, warningsAboutMapData);
try {
indexCreator.generateIndexes(f, new ConsoleProgressImplementation(3), null, mapZooms, types, warningsAboutMapData);
} finally {
if (fh != null) {
LogManager.getLogManager().getLogger("").removeHandler(fh);
fh.close();
}
}
File generated = new File(workDir, mapFileName);
generated.renameTo(new File(indexDirFiles, generated.getName()));
logFileName.renameTo(new File(indexDirFiles, logFileName.getName()));
if (fh != null) {
LogManager.getLogManager().getLogger("").removeHandler(fh);
fh.close();
}
} catch (Exception e) {
log.error("Exception generating indexes for " + f.getName(), e); //$NON-NLS-1$
}