package aimax.osm.data;
import java.util.Collection;
import java.util.List;
import aimax.osm.data.entities.EntityViewInfo;
import aimax.osm.data.entities.MapEntity;
import aimax.osm.data.entities.MapNode;
import aimax.osm.data.entities.MapWay;
import aimax.osm.data.entities.Track;
/**
* Central container interface for OSM map data. It provides read access to
* nodes and ways suitable for routing and map viewing. Additionally, tracks
* and markers can be added and accessed. Map generation is delegated to a
* MapBuilder
.
*
* @author Ruediger Lunde
*/
public interface OsmMap extends WayNodeProvider {
/** Checks whether data is available. */
public boolean isEmpty();
/**
* Returns a builder object, which receives map entities, for example from a
* reader, and builds up needed structures in the map for storing the
* entities (e.g. spatial indices). Normally, implementations will keep the
* current entities and add to them, what is provided by some map reader.
*/
public MapBuilder getBuilder();
/**
* Closes all open resources and should be called before the application
* terminates.
*/
public void close();
/**
* Provides the map with an entity classifier. The classifier defines the
* scale-dependent visibility of entities and by that strongly influences
* the organization of the data. This operation might not always be
* implemented because large maps are hard to reorganize in reasonable time.
*/
public void setEntityClassifier(EntityClassifier classifier);
/**
* Returns a bounding box for all entities, which are maintained in this
* container.
*/
public BoundingBox getBoundingBox();
/** Returns the number of all maintained nodes. */
public int getNodeCount();
/**
* Returns a node for the given id.
*/
public MapNode getNode(long id);
/** Returns the number of all maintained ways. */
public int getWayCount();
/**
* Returns a way for the given id.
*/
public MapWay getWay(long id);
/**
* Returns all map ways whose bounding box intersects the specified bounding
* box.
*/
public Collection getWays(BoundingBox bb);
/**
* Returns the nearest way node from all ways which are accepted by the
* filter.
*
* @param pos
* The reference position.
*/
public MapNode getNearestWayNode(Position pos, MapWayFilter filter);
/**
* Returns the number of all maintained point of interests. Nodes are
* classified as POIs if they have a name or other attributes of interest.
*/
public int getPoiCount();
/**
* Returns all points of interest within the specified bounding box. Nodes
* are classified as POIs if they have a name or other attributes of
* interest.
*/
public List getPois(BoundingBox bb);
/**
* Returns all nodes which are marked with the attribute place and whose
* name matches the specification.
*/
public List getPlaces(String name);
/** Resets only marker and track informations. */
public void clearMarkersAndTracks();
/**
* Returns all markers and tracks, which are visible in the specified scale.
*/
public List getVisibleMarkersAndTracks(float scale);
/** Adds a new marker at the specified position. */
public MapNode addMarker(float lat, float lon);
/** Removes a previously added marker. */
public void removeMarker(MapNode marker);
/** Returns all maintained markers. */
public List getMarkers();
/** Removes the specified track. */
public void clearTrack(String trackName);
/**
* Creates a new track and adds it to the list of tracks. Possibly exiting
* tracks with the same name are removed.
*/
public void createTrack(String trackName, List positions);
/**
* Adds a new point at the end of a specified track. If a track with the
* specified name does not exist, a new track is created.
*/
public void addToTrack(String trackName, Position pos);
/** Returns all maintained tracks. */
public List