public class GpsTracesDao
extends java.lang.Object
| Constructor and Description |
|---|
GpsTracesDao(de.westnordost.osmapi.OsmConnection osm) |
| Modifier and Type | Method and Description |
|---|---|
long |
create(java.lang.String name,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.lang.Iterable<GpsTrackpoint> trackpoints)
Upload a new trace with no tags
|
long |
create(java.lang.String name,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.util.List<java.lang.String> tags,
java.lang.Iterable<GpsTrackpoint> trackpoints)
Upload a new trace of trackpoints.
|
void |
delete(long id)
Delete one of the user's traces
|
GpsTraceDetails |
get(long id)
Get information about a given GPS trace or null if it does not exist.
|
void |
getAll(de.westnordost.osmapi.map.data.BoundingBox bounds,
de.westnordost.osmapi.common.Handler<GpsTrackpoint> handler,
int page)
Get all the trackpoints in the given bounding box.
|
void |
getData(long id,
de.westnordost.osmapi.common.Handler<GpsTrackpoint> handler)
Get all trackpoints contained in the given trace id.
|
void |
getMine(de.westnordost.osmapi.common.Handler<GpsTraceDetails> handler)
Pass all gps traces the current user uploaded to the given handler
|
void |
update(long id,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.util.List<java.lang.String> tags)
Change the visibility, description and tags of a GPS trace.
|
public long create(java.lang.String name,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.util.List<java.lang.String> tags,
java.lang.Iterable<GpsTrackpoint> trackpoints)
name - this is usually the "file name" of the GPX trace (when files are involved)visibility - the visibility the trace should havedescription - short description of the trace. May not be null or empty.tags - keywords with which this trace can be found. May be null.trackpoints - The GPX track to uploadjava.lang.IllegalArgumentException - if either name, description or any single tag is longer than
255 charactersde.westnordost.osmapi.common.errors.OsmBadUserInputException - if the trace is invalidde.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to write traces
(Permission.WRITE_GPS_TRACES)public long create(java.lang.String name,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.lang.Iterable<GpsTrackpoint> trackpoints)
public void update(long id,
GpsTraceDetails.Visibility visibility,
java.lang.String description,
java.util.List<java.lang.String> tags)
id - id of the trace to updatevisibility - desired visibility of the tracedescription - desired description of the trace. May be null.tags - desired tags of the trace. May be null.de.westnordost.osmapi.common.errors.OsmNotFoundException - if the trace with the given id does not existde.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to write traces
(Permission.WRITE_GPS_TRACES)
OR if the trace in question is not the user's own tracejava.lang.IllegalArgumentException - if the length of the description or any one single tag
is more than 256 characterspublic void delete(long id)
id - id of the trace to deletede.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to write traces
(Permission.WRITE_GPS_TRACES)
OR if the trace in question is not the user's own tracepublic GpsTraceDetails get(long id)
id - id of the trace to getde.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to read the user's
traces (Permission.READ_GPS_TRACES)
OR if the trace in question is not the user's own trace
and at the same time it is not public
OR if not logged in at allpublic void getData(long id,
de.westnordost.osmapi.common.Handler<GpsTrackpoint> handler)
id - id of the trace to get the data forhandler - Handler to which the trackpoints are fed tode.westnordost.osmapi.common.errors.OsmNotFoundException - if the trace with the given id does not existde.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to read the user's
traces (Permission.READ_GPS_TRACES)
OR if the trace in question is not the user's own trace and
at the same time it is not public
OR if not logged in at allpublic void getMine(de.westnordost.osmapi.common.Handler<GpsTraceDetails> handler)
de.westnordost.osmapi.common.errors.OsmAuthorizationException - if this application is not authorized to read the user's
traces (Permission.READ_GPS_TRACES)public void getAll(de.westnordost.osmapi.map.data.BoundingBox bounds,
de.westnordost.osmapi.common.Handler<GpsTrackpoint> handler,
int page)
bounds - the bounding box in which to get the trackpointshandler - Handler to which the trackpoints are fed topage - since there are loads and loads of traces, the method will only return a certain
number of trackpoints per page (see Capabilities.maxPointsInGpsTracePerPage).
You can repeat calling this method, incrementing the page number until you get
an empty responsede.westnordost.osmapi.common.errors.OsmQueryTooBigException - if the bounds area is too largejava.lang.IllegalArgumentException - if the bounds cross the 180th meridian or page is < 0