Skip to content

Commit 92bf6a6

Browse files
committed
Fixes to README, add datasets
1 parent 4fb5a0c commit 92bf6a6

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The length of a path between members.
4949
#### GEOPOLYGON KEYS[1] geoset ARGV[a] [WITHCOORD] ARGV[2] longitude1 3] latitude1 4] longitude2 5] latitude2 6] longitude3 7] latitude3 [...]
5050
> Time complexity: O(V+N+log(M)+N*V) where V is the number of vertices in the polygon, N is the number of elements inside the bounding box of the circular area delimited by center and radius of the polygon's bounding circle and M is the number of items inside the index.
5151
52-
Search for members inside a simple polygon described by 3 or more coordinates. This command determines the polygon's center and farthest vertex from it to perform a `GEORADIUS`. The results are then filtered using a Point-In-Polygon (PIP) algorithm ([source](http://alienryderflex.com/polygon/)) that provides indeterminate results for members on the edges.
52+
Search for members inside a simple polygon described by 3 or more coordinates. This command determines the polygon's center and farthest vertex from it to perform a [`GEORADIUS`](http://redis.io/commands/georadius). The results are then filtered using a Point-In-Polygon (PIP) algorithm ([source](http://alienryderflex.com/polygon/)) that provides indeterminate results for members on the edges.
5353

5454
**Return:** Array reply, specifically the members in the polygon.
5555

@@ -172,6 +172,7 @@ If you encounter an issue while using the geo.lua library, please report it at t
172172
### Pull request
173173

174174
Code contributions to the geo.lua project can be made using pull requests. To submit a pull request:
175+
175176
1. Fork this project.
176177
2. Make and commit your changes.
177178
3. Submit your changes as a pull request.

dataset1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ \"type\": \"FeatureCollection\", \"features\": [ { \"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [15.0074779, 37.4908267]}, \"properties\": {\"id\": \"RL@Catania\"} }, { \"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [34.84076, 32.10942]}, \"properties\": {\"id\": \"RL@TLV\"} }, { \"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [-122.0678325, 37.3775256]}, \"properties\": {\"id\": \"RL@MV\"} }, { \"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [34.8380433, 32.1098095]}, \"properties\": {\"id\": \"Hudson\"} } ] }

dataset1.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
local data = {
2+
'15.0074779', '37.4908267', 'RL@Catania',
3+
'34.84076', '32.10942', 'RL@TLV',
4+
'-122.0678325', '37.3775256', 'RL@MV',
5+
'34.8380433', '32.1098095', 'Hudson'
6+
}
7+
8+
local alt = {
9+
'97', 'RL@Catania',
10+
'18', 'RL@TLV',
11+
'38', 'RL@MV',
12+
'18', 'Hudson'
13+
}
14+
15+
redis.call('DEL', unpack(KEYS))
16+
redis.call('GEOADD', KEYS[1], unpack(data))
17+
redis.call('ZADD', KEYS[2], unpack(data))

0 commit comments

Comments
 (0)