Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
olc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Byers
olc
Commits
534c08bd
Commit
534c08bd
authored
4 years ago
by
David Byers
Browse files
Options
Downloads
Patches
Plain Diff
Renamed -geo to -compound.
parent
5e5d5ce9
No related branches found
Branches containing commit
Tags
1.3.0
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+5
-0
5 additions, 0 deletions
CHANGELOG
README.md
+1
-1
1 addition, 1 deletion
README.md
olc.el
+5
-3
5 additions, 3 deletions
olc.el
olc.texi
+9
-9
9 additions, 9 deletions
olc.texi
with
20 additions
and
13 deletions
CHANGELOG
+
5
−
0
View file @
534c08bd
2020-07-22 David Byers <david.byers@liu.se>
Rename some functions:
* olc.el (olc-shorten-compound): Renamed from olc-shorten-geo to
better match Google's terminology in their plus codes api.
(olc-recover-compound): Same.
Implement olc-shorten-geo and clean up:
* olc.el (olc-shorten-geo): New function.
(olc-encode): Use cl-defun and keyword args.
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
534c08bd
...
...
@@ -64,6 +64,6 @@ Recovery using a geographical reference (requires `requests` and uses
the OpenStreetMap API):
````
(olc-recover-
string
"M24Q+89 Mutitjulu")
(olc-recover-
compound
"M24Q+89 Mutitjulu")
"5Q6HM24Q+89"
````
This diff is collapsed.
Click to expand it.
olc.el
+
5
−
3
View file @
534c08bd
;;; olc.el --- Open location code library -*-coding: utf-8;-*-
;; -*-coding: utf-8;-*-
;;; olc.el --- Open location code library
;; Copyright (C) 2020 David Byers
;;
...
...
@@ -434,7 +436,7 @@ shortened code, of if LIMIT is not positive and even."
code
))))
(
cl-defun
olc-shorten-
geo
(
code
&key
(
limit
4
)
(
zoom
'
(
1
18
)))
(
cl-defun
olc-shorten-
compound
(
code
&key
(
limit
4
)
(
zoom
'
(
1
18
)))
"Attempt to shorten CODE with a geographic reference.
Shorten CODE, which must be a full open location code, finding a
...
...
@@ -545,7 +547,7 @@ full open location code."
(
olc-encode
lat
lon
:len
(
olc-parse-precision
parse
)))))))
(
cl-defun
olc-recover-
geo
(
arg1
&optional
arg2
&key
(
format
'area
))
(
cl-defun
olc-recover-
compound
(
arg1
&optional
arg2
&key
(
format
'area
))
"Recover a location from a short code and reference.
When called with one argument, ARG1, it must be a string
...
...
This diff is collapsed.
Click to expand it.
olc.texi
+
9
−
9
View file @
534c08bd
...
...
@@ -177,7 +177,7 @@ or shortened code, of if @var{limit} is not even.
@end example
@end defun
@defun olc-shorten-
geo
code
&
key limit
@defun olc-shorten-
compound
code
&
key limit
Shorten @var
{
code
}
, which must be a full open location code, finding a
reference near the encoded location. If @var
{
limit
}
is non-nil, then
the code will be shortened by at most that many digits. If the code
...
...
@@ -194,13 +194,13 @@ shortened code, of if @var{limit} is not even.
@example
@group
(olc-shorten-
geo
"5Q6HM24Q+89")
(olc-shorten-
compound
"5Q6HM24Q+89")
@result
{}
"M24Q+89 Mutitjulu, Northern Territory, Australia"
(olc-shorten-
geo
"5Q6HM24Q+89" :limit 2)
(olc-shorten-
compound
"5Q6HM24Q+89" :limit 2)
@result
{}
"6HM24Q+89 Northern Territory, Australia"
(olc-shorten-
geo
"5Q6HM24Q+89" :zoom 14)
(olc-shorten-
compound
"5Q6HM24Q+89" :zoom 14)
@result
{}
"M24Q+89 Mutitjulu, Northern Territory, Australia"
(olc-shorten-
geo
"5Q6HM24Q+89" :zoom 1)
(olc-shorten-
compound
"5Q6HM24Q+89" :zoom 1)
"6HM24Q+89 Australia"
@end group
@end example
...
...
@@ -223,7 +223,7 @@ value), the returned value is an full open location code.
@end example
@end defun
@defun olc-recover-
geo
arg1
&
optional arg2
&
key format
@defun olc-recover-
compound
arg1
&
optional arg2
&
key format
Recover a shortened code @i
{
without
}
the reference latitude and
longitude.
...
...
@@ -240,11 +240,11 @@ details).
@example
@group
(olc-recover-
geo
"M24Q+89 Mutitjulu")
(olc-recover-
compound
"M24Q+89 Mutitjulu")
@result
{}
"5Q6HM24Q+89"
(olc-recover-
geo
"M24Q+89" "Mutitjulu")
(olc-recover-
compound
"M24Q+89" "Mutitjulu")
@result
{}
"5Q6HM24Q+89"
(olc-recover-
geo
"M24Q+89" "Mutitjulu" :format 'latlon)
(olc-recover-
compound
"M24Q+89" "Mutitjulu" :format 'latlon)
@result
{}
(-25.344187500000004 . 131.0384375)
@end group
@end example
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment