Simple interface to aggregate map data. Its purpose is, to keep OSM parsers independent from the concrete structure which is used to store the data. Osm maps should only be modified by implementations of this map builder interface. @author Ruediger Lunde
| 14 | * @author Ruediger Lunde |
| 15 | */ |
| 16 | public interface MapBuilder { |
| 17 | |
| 18 | /** |
| 19 | * Provides the builder with an entity classifier. The classifier defines |
| 20 | * the scale-dependent visibility of entities and by that strongly |
| 21 | * influences the organization of the data. |
| 22 | */ |
| 23 | public void setEntityClassifier(EntityClassifier<EntityViewInfo> classifier); |
| 24 | |
| 25 | /** Defines the region in which complete map data is available. */ |
| 26 | public void setBoundingBox(BoundingBox bb); |
| 27 | |
| 28 | /** |
| 29 | * Returns true, if a node with the given id has already been added before. |
| 30 | * |
| 31 | * @param bb |
| 32 | * Specifies an optional bounding box. If the value is not null, |
| 33 | * it is also checked, whether the node is inside the box. |
| 34 | */ |
| 35 | public boolean isNodeDefined(long id, BoundingBox bb); |
| 36 | |
| 37 | /** |
| 38 | * Returns true, if a node with the given id is referenced by a way, which |
| 39 | * was added before. |
| 40 | */ |
| 41 | public boolean isNodeReferenced(long id); |
| 42 | |
| 43 | /** |
| 44 | * Adds a new map node (way node as well as point of interest) to the |
| 45 | * container. |
| 46 | */ |
| 47 | public void addNode(long id, String name, List<EntityAttribute> atts, |
| 48 | float lat, float lon); |
| 49 | |
| 50 | /** |
| 51 | * Returns true, if a way with the given id has already been added before. |
| 52 | */ |
| 53 | public boolean isWayDefined(long id); |
| 54 | |
| 55 | /** |
| 56 | * Adds a new map way to the container, adds all referenced way nodes to the |
| 57 | * container (without position) if they have not been added before, stores |
| 58 | * the list of way nodes with the way, and additionally adds a way reference |
| 59 | * to each node. The way nodes define the representation of the way at zoom |
| 60 | * level 0. The missing positions of the nodes may be set later on. |
| 61 | */ |
| 62 | public void addWay(long id, String name, List<EntityAttribute> atts, |
| 63 | List<Long> wayNodeIds); |
| 64 | |
| 65 | /** |
| 66 | * Checks whether node references without corresponding node definitions |
| 67 | * have been added since the last call. |
| 68 | */ |
| 69 | public boolean nodeRefsWithoutDefsAdded(); |
| 70 | |
| 71 | /** |
| 72 | * Returns the modified or created map. This method must be called after all |
| 73 | * map entities have been added. |
no outgoing calls
no test coverage detected