diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-11-11 09:21:45 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-11 09:21:45 +1300 |
commit | 204b1074ee57960775066c7c483d54bab8ebf279 (patch) | |
tree | bfec39fe84b547dac991f0d38cd69e9c64c688a6 /src/org/traccar/api/resource/ServerResource.java | |
parent | 92f00d0da0dafd08ccf2a623406963e61fcde276 (diff) | |
parent | 96d89e2e352f5cba70a346b1f71bfb3bd399556b (diff) | |
download | traccar-server-204b1074ee57960775066c7c483d54bab8ebf279.tar.gz traccar-server-204b1074ee57960775066c7c483d54bab8ebf279.tar.bz2 traccar-server-204b1074ee57960775066c7c483d54bab8ebf279.zip |
Merge pull request #3632 from Abyss777/retry_geocoding
Retry geocoding for trips/stops
Diffstat (limited to 'src/org/traccar/api/resource/ServerResource.java')
-rw-r--r-- | src/org/traccar/api/resource/ServerResource.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/ServerResource.java b/src/org/traccar/api/resource/ServerResource.java index 034a5c492..c0914995b 100644 --- a/src/org/traccar/api/resource/ServerResource.java +++ b/src/org/traccar/api/resource/ServerResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.sql.SQLException; @@ -47,4 +48,10 @@ public class ServerResource extends BaseResource { return Response.ok(entity).build(); } + @Path("geocode") + @GET + public String geocode(@QueryParam("latitude") double latitude, @QueryParam("longitude") double longitude) { + return Context.getGeocoder().getAddress(latitude, longitude, null); + } + } |