public class MapDataDao
extends java.lang.Object
| Constructor and Description |
|---|
MapDataDao(OsmConnection osm) |
MapDataDao(OsmConnection osm,
MapDataFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeChangeset(long changesetId)
Closes the given changeset.
|
void |
getMap(BoundingBox bounds,
MapDataHandler handler)
Feeds map data to the given MapDataHandler.
If not logged in, the Changeset for each returned element will be null |
Node |
getNode(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
java.util.List<Node> |
getNodes(java.util.Collection<java.lang.Long> nodeIds)
Note that if not logged in, the Changeset for each returned element will be null
|
Relation |
getRelation(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
void |
getRelationComplete(long id,
MapDataHandler handler)
Queries the relation with the given id plus all it's members and all nodes of ways that are
members of the relation.
If not logged in, the Changeset for each returned element will be null |
java.util.List<Relation> |
getRelations(java.util.Collection<java.lang.Long> relationIds)
Note that if not logged in, the Changeset for each returned element will be null
|
java.util.List<Relation> |
getRelationsForNode(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
java.util.List<Relation> |
getRelationsForRelation(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
java.util.List<Relation> |
getRelationsForWay(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
Way |
getWay(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
void |
getWayComplete(long id,
MapDataHandler handler)
Queries the way with the given id plus all nodes that are in referenced by it.
If not logged in, the Changeset for each returned element will be null |
java.util.List<Way> |
getWays(java.util.Collection<java.lang.Long> wayIds)
Note that if not logged in, the Changeset for each returned element will be null
|
java.util.List<Way> |
getWaysForNode(long id)
Note that if not logged in, the Changeset for each returned element will be null
|
long |
openChangeset(java.util.Map<java.lang.String,java.lang.String> tags)
Open a new changeset with the given tags
|
void |
updateChangeset(long changesetId,
java.util.Map<java.lang.String,java.lang.String> tags)
Set new the tags of a changeset (the old set of tags is deleted)
|
long |
updateMap(java.util.Map<java.lang.String,java.lang.String> tags,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler)
Opens a changeset, uploads the data, closes the changeset and subscribes the user to it.
|
long |
updateMap(java.lang.String comment,
java.lang.String source,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler) |
void |
uploadChanges(long changesetId,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler)
Upload changes into an opened changeset.
|
public MapDataDao(OsmConnection osm, MapDataFactory factory)
public MapDataDao(OsmConnection osm)
public long updateMap(java.lang.String comment,
java.lang.String source,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler)
updateMap(Map, Iterable, Handler)public long updateMap(java.util.Map<java.lang.String,java.lang.String> tags,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler)
tags - tags of this changeset. Usually it is comment and source.
See updateMap(String, String, Iterable, Handler)elements - elements to upload. No special order requiredhandler - handler that processes the server's diffResult response. Optional.OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void uploadChanges(long changesetId,
java.lang.Iterable<Element> elements,
Handler<DiffElement> handler)
elements - elements to upload. No special order requiredhandler - handler that processes the server's diffResult response. Optional.OsmNotFoundException - if the changeset does not exist (yet) or an element in the
does not existOsmConflictException - if the changeset has already been closed, there is a conflict
for the elements being uploaded or the user who created the
changeset is not the same as the one uploading the changeOsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public long openChangeset(java.util.Map<java.lang.String,java.lang.String> tags)
tags - tags of this changeset. Usually it is comment and source.OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void updateChangeset(long changesetId,
java.util.Map<java.lang.String,java.lang.String> tags)
tags - the new tags of this changesetOsmConflictException - if the changeset has already been closedOsmNotFoundException - if the changeset does not exist (yet)OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void closeChangeset(long changesetId)
OsmConflictException - if the changeset has already been closedOsmNotFoundException - if the changeset does not exist (yet)OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void getMap(BoundingBox bounds, MapDataHandler handler)
bounds - rectangle in which to query map data. May not cross the 180th meridian. This is
usually limited at 0.25 square degrees. Check the server capabilities.handler - map data handler that is fed the map dataOsmQueryTooBigException - if the bounds are is too largejava.lang.IllegalArgumentException - if the bounds cross the 180th meridian.public void getWayComplete(long id,
MapDataHandler handler)
id - the way's idhandler - map data handler that is fed the map dataOsmNotFoundException - if the way with the given id does not existpublic void getRelationComplete(long id,
MapDataHandler handler)
id - the way's idhandler - map data handler that is fed the map dataOsmNotFoundException - if the relation with the given id does not existpublic Node getNode(long id)
public Way getWay(long id)
public Relation getRelation(long id)
public java.util.List<Node> getNodes(java.util.Collection<java.lang.Long> nodeIds)
nodeIds - a collection of node ids to return.OsmNotFoundException - if any one of the given nodes does not existpublic java.util.List<Way> getWays(java.util.Collection<java.lang.Long> wayIds)
wayIds - a collection of way ids to returnOsmNotFoundException - if any one of the given ways does not existpublic java.util.List<Relation> getRelations(java.util.Collection<java.lang.Long> relationIds)
relationIds - a collection of relation ids to returnOsmNotFoundException - if any one of the given relations does not existpublic java.util.List<Way> getWaysForNode(long id)
public java.util.List<Relation> getRelationsForNode(long id)
public java.util.List<Relation> getRelationsForWay(long id)
public java.util.List<Relation> getRelationsForRelation(long id)