Skip to content

Commit

Permalink
#7 Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasSmyth committed Aug 11, 2018
1 parent 80aa647 commit 09b2ffc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/data.q
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/ data processing

.cache.attended:([h:();username:()]data:());
.cache.attended:([h:();username:()]data:()); / blank schema
.cache.geocode:([h:();username:()]data:());

.data.attended:{[dict] / [params] get attended events for a user, checking for cached events;
Expand All @@ -14,9 +14,9 @@
:res;
};

.data.geocode.venue:{[params]
.data.geocode.venue:{[params] / [params] return coordinates for a venue
.log.o("Geocoding: {}";params`q);
res:.http.req.nominatim params;
res:.http.req.nominatim params; / request coords from nominatim
if[0h=type res;:`lat`long!0n 0n];
:`lat`long!raze"F"$res`lat`lon;
};
Expand All @@ -37,5 +37,5 @@
.data.markers:{[dict;data] / [inputs;venue info]
vnl:distinct select city,venue,venId,state,country,lat,long from data; / select city coordinates
m:value each .data.geocode.all[dict;vnl]; / geocode venues
:`markers`bounds!(m;(min;max)@\:m[;2 3]);
:`markers`bounds!(m;(min;max)[;m[;2 3]]);
};

0 comments on commit 09b2ffc

Please sign in to comment.