Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
postcodes-io-java
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
James Coyle
postcodes-io-java
Commits
36570b53
Commit
36570b53
authored
Sep 18, 2016
by
Deepak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
URL name changes
parent
580374fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/main/java/com/postcode/io/initializers/OutcodeReverseGeocoding.java
...com/postcode/io/initializers/OutcodeReverseGeocoding.java
+4
-4
No files found.
src/main/java/com/postcode/io/initializers/OutcodeReverseGeocoding.java
View file @
36570b53
...
...
@@ -7,7 +7,7 @@ import com.mashape.unirest.http.exceptions.UnirestException;
public
class
OutcodeReverseGeocoding
{
private
static
final
String
OUT
WARD_
CODE_URL
=
"https://api.postcodes.io/outcodes/"
;
private
static
final
String
OUTCODE_URL
=
"https://api.postcodes.io/outcodes/"
;
private
static
String
outwardCode
;
...
...
@@ -61,16 +61,16 @@ public class OutcodeReverseGeocoding {
public
JSONObject
asJson
()
throws
UnirestException
{
try
{
if
(
nearest
)
{
return
Unirest
.
get
(
OUT
WARD_
CODE_URL
.
concat
(
outwardCode
).
concat
(
"/nearest"
))
return
Unirest
.
get
(
OUTCODE_URL
.
concat
(
outwardCode
).
concat
(
"/nearest"
))
.
queryString
(
"limit"
,
limit
!=
0
?
limit
:
10
)
.
queryString
(
"radius"
,
radius
!=
0
?
radius
:
5000
).
asJson
().
getBody
().
getObject
();
}
if
(
latlong
)
{
return
Unirest
.
get
(
OUT
WARD_
CODE_URL
).
queryString
(
"lon"
,
longitude
).
queryString
(
"lat"
,
latitude
)
return
Unirest
.
get
(
OUTCODE_URL
).
queryString
(
"lon"
,
longitude
).
queryString
(
"lat"
,
latitude
)
.
queryString
(
"limit"
,
limit
!=
0
?
limit
:
10
)
.
queryString
(
"radius"
,
radius
!=
0
?
radius
:
5000
).
asJson
().
getBody
().
getObject
();
}
return
Unirest
.
get
(
OUT
WARD_
CODE_URL
.
concat
(
outwardCode
)).
asJson
().
getBody
().
getObject
();
return
Unirest
.
get
(
OUTCODE_URL
.
concat
(
outwardCode
)).
asJson
().
getBody
().
getObject
();
}
finally
{
clear
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment