Search in sources :

Example 1 with DefaultMapBuilder

use of aimax.osm.data.impl.DefaultMapBuilder in project aima-java by aimacode.

the class OsmAgentApp method readMap.

/** Reads a map from the specified stream and stores it in {@link #map}. */
public void readMap(InputStream stream) {
    if (stream != null) {
        MapReader mapReader = new Bz2OsmReader();
        MapBuilder mapBuilder = new DefaultMapBuilder();
        mapReader.readMap(stream, mapBuilder);
        map = new MapAdapter(mapBuilder.buildMap());
    } else
        LOG.warning("Map reading failed because input stream does not exist.");
}
Also used : MapReader(aimax.osm.reader.MapReader) Bz2OsmReader(aimax.osm.reader.Bz2OsmReader) DefaultMapBuilder(aimax.osm.data.impl.DefaultMapBuilder) MapBuilder(aimax.osm.data.MapBuilder) DefaultMapBuilder(aimax.osm.data.impl.DefaultMapBuilder) MapAdapter(aimax.osm.routing.MapAdapter)

Example 2 with DefaultMapBuilder

use of aimax.osm.data.impl.DefaultMapBuilder in project aima-java by aimacode.

the class OsmAgentApp method readMap.

/** Reads a map from the specified file and stores it in {@link #map}. */
public void readMap(File file) {
    MapReader mapReader = new Bz2OsmReader();
    MapBuilder mapBuilder = new DefaultMapBuilder();
    mapReader.readMap(file, mapBuilder);
    map = new MapAdapter(mapBuilder.buildMap());
}
Also used : MapReader(aimax.osm.reader.MapReader) Bz2OsmReader(aimax.osm.reader.Bz2OsmReader) DefaultMapBuilder(aimax.osm.data.impl.DefaultMapBuilder) MapBuilder(aimax.osm.data.MapBuilder) DefaultMapBuilder(aimax.osm.data.impl.DefaultMapBuilder) MapAdapter(aimax.osm.routing.MapAdapter)

Aggregations

MapBuilder (aimax.osm.data.MapBuilder)2 DefaultMapBuilder (aimax.osm.data.impl.DefaultMapBuilder)2 Bz2OsmReader (aimax.osm.reader.Bz2OsmReader)2 MapReader (aimax.osm.reader.MapReader)2 MapAdapter (aimax.osm.routing.MapAdapter)2