Search in sources :

Example 1 with MapBuilder

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

the class MapViewFrame method readMap.

public void readMap(File file) {
    MapBuilder builder = getMap().getBuilder();
    builder.setEntityClassifier(viewInfo);
    mapReader.readMap(file, builder);
    builder.buildMap();
    fileChooser.setSelectedFile(file.getAbsoluteFile());
}
Also used : MapBuilder(aimax.osm.data.MapBuilder)

Example 2 with MapBuilder

use of aimax.osm.data.MapBuilder 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 3 with MapBuilder

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

the class UnifiedMapDrawer method loadMap.

public void loadMap(InputStream stream) {
    MapBuilder builder = map.getBuilder();
    builder.setEntityClassifier(new MapStyleFactory().createDefaultClassifier());
    MapReader mapReader = new Bz2OsmReader();
    mapReader.readMap(stream, builder);
    builder.buildMap();
}
Also used : MapReader(aimax.osm.reader.MapReader) MapBuilder(aimax.osm.data.MapBuilder) Bz2OsmReader(aimax.osm.reader.Bz2OsmReader)

Example 4 with MapBuilder

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

the class UnifiedMapDrawer method loadMap.

public void loadMap(File file) {
    MapBuilder builder = map.getBuilder();
    builder.setEntityClassifier(new MapStyleFactory().createDefaultClassifier());
    MapReader mapReader = new Bz2OsmReader();
    mapReader.readMap(file, builder);
    builder.buildMap();
}
Also used : MapReader(aimax.osm.reader.MapReader) MapBuilder(aimax.osm.data.MapBuilder) Bz2OsmReader(aimax.osm.reader.Bz2OsmReader)

Example 5 with MapBuilder

use of aimax.osm.data.MapBuilder 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)6 Bz2OsmReader (aimax.osm.reader.Bz2OsmReader)4 MapReader (aimax.osm.reader.MapReader)4 DefaultMapBuilder (aimax.osm.data.impl.DefaultMapBuilder)2 MapAdapter (aimax.osm.routing.MapAdapter)2