/**
* Reads all data from the file and send it to the sink.
*/
public void readMap(File file, MapBuilder builder) {
try {
MapBuilderProxy proxy;
if (boundingBox != null)
proxy = new BBBuilderProxy(builder, boundingBox);
else if (attFilter != null)
proxy = new FilteringBuilderProxy(builder, attFilter);
else
proxy = new MapBuilderProxy(builder);
parseMap(createFileStream(file), proxy);
if (proxy.nodeRefsWithoutDefsAdded()) {
if (boundingBox != null || attFilter != null) {
LOG.info("Starting to parse the map file a second time.");
proxy.incrementCounter();
parseMap(createFileStream(file), proxy);
} else {
LOG
.warning("Nodes were referenced in ways but not defined before.");
}