public class MapDataDao
extends java.lang.Object
| Constructor and Description |
|---|
MapDataDao(de.westnordost.osmapi.OsmConnection osm) |
MapDataDao(de.westnordost.osmapi.OsmConnection osm,
MapDataFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeChangeset(long changesetId)
Closes the given changeset.
|
void |
getMap(de.westnordost.osmapi.map.data.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,
de.westnordost.osmapi.common.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,
de.westnordost.osmapi.common.Handler<DiffElement> handler) |
void |
uploadChanges(long changesetId,
java.lang.Iterable<Element> elements,
de.westnordost.osmapi.common.Handler<DiffElement> handler)
Upload changes into an opened changeset.
|
public MapDataDao(de.westnordost.osmapi.OsmConnection osm,
MapDataFactory factory)
public MapDataDao(de.westnordost.osmapi.OsmConnection osm)
public long updateMap(java.lang.String comment,
java.lang.String source,
java.lang.Iterable<Element> elements,
de.westnordost.osmapi.common.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,
de.westnordost.osmapi.common.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.de.westnordost.osmapi.common.errors.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,
de.westnordost.osmapi.common.Handler<DiffElement> handler)
changesetId - id of the changeset to upload changes intoelements - elements to upload. No special order requiredhandler - handler that processes the server's diffResult response. Optional.de.westnordost.osmapi.common.errors.OsmNotFoundException - if the changeset does not exist (yet) or an element in the
does not existde.westnordost.osmapi.common.errors.OsmConflictException - 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 changede.westnordost.osmapi.common.errors.OsmAuthorizationException - 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.de.westnordost.osmapi.common.errors.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)
changesetId - id of the changeset to updatetags - the new tags of this changesetde.westnordost.osmapi.common.errors.OsmConflictException - if the changeset has already been closedde.westnordost.osmapi.common.errors.OsmNotFoundException - if the changeset does not exist (yet)de.westnordost.osmapi.common.errors.OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void closeChangeset(long changesetId)
changesetId - id of the changeset to closede.westnordost.osmapi.common.errors.OsmConflictException - if the changeset has already been closedde.westnordost.osmapi.common.errors.OsmNotFoundException - if the changeset does not exist (yet)de.westnordost.osmapi.common.errors.OsmAuthorizationException - if the application does not have permission to edit the
map (Permission.MODIFY_MAP)public void getMap(de.westnordost.osmapi.map.data.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 datade.westnordost.osmapi.common.errors.OsmQueryTooBigException - 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 datade.westnordost.osmapi.common.errors.OsmNotFoundException - if the way with the given id does not existpublic void getRelationComplete(long id,
MapDataHandler handler)
id - the relation's idhandler - map data handler that is fed the map datade.westnordost.osmapi.common.errors.OsmNotFoundException - if the relation with the given id does not existpublic Node getNode(long id)
id - the node's idpublic Way getWay(long id)
id - the way's idpublic Relation getRelation(long id)
id - the relation's idpublic java.util.List<Node> getNodes(java.util.Collection<java.lang.Long> nodeIds)
nodeIds - a collection of node ids to return.de.westnordost.osmapi.common.errors.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 returnde.westnordost.osmapi.common.errors.OsmNotFoundException - 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 returnde.westnordost.osmapi.common.errors.OsmNotFoundException - if any one of the given relations does not existpublic java.util.List<Way> getWaysForNode(long id)
id - the node's idpublic java.util.List<Relation> getRelationsForNode(long id)
id - the node's idpublic java.util.List<Relation> getRelationsForWay(long id)
id - the way's idpublic java.util.List<Relation> getRelationsForRelation(long id)
id - the relation's id