public class GpsTracesDao
extends java.lang.Object
| Constructor and Description |
|---|
GpsTracesDao(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(BoundingBox bounds,
Handler<GpsTrackpoint> handler,
int page)
Get all the trackpoints in the given bounding box.
|
void |
getData(long id,
Handler<GpsTrackpoint> handler)
Get all trackpoints contained in the given trace id.
|
void |
getMine(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 GpsTracesDao(OsmConnection osm)
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)description - short description of the trace. May not be null or empty.tags - keywords with which this trace can be found. May be null.java.lang.IllegalArgumentException - if either name, description or any single tag is longer than
255 charactersOsmBadUserInputException - if the trace is invalidOsmAuthorizationException - 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)
OsmNotFoundException - if the trace with the given id does not existOsmAuthorizationException - 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)
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)
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,
Handler<GpsTrackpoint> handler)
OsmNotFoundException - if the trace with the given id does not existOsmAuthorizationException - 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(Handler<GpsTraceDetails> handler)
OsmAuthorizationException - if this application is not authorized to read the user's
traces (Permission.READ_GPS_TRACES)public void getAll(BoundingBox bounds, Handler<GpsTrackpoint> handler, int page)
page - 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 responseOsmQueryTooBigException - if the bounds area is too largejava.lang.IllegalArgumentException - if the bounds cross the 180th meridian or page is < 0