Fork me on GitHub

@malcolmsparks handy,but only for the specific example I was giving - actually I'm throwing together a script to collect git info, looking for ways to go from a list of remotes to a map of data about each remote. It seemed a common task, I was surprised there wasn't a function for it.

Rachel Westmacott07:04:07

given the meaning of the word “map” it seems particularly surprising to me

Rachel Westmacott07:04:58

non-random core function of the day:

([n coll] [n step coll] [n step pad coll])
  Returns a lazy sequence of lists of n items each, at offsets step
  apart. If step is not supplied, defaults to n, i.e. the partitions
  do not overlap. If a pad collection is supplied, use its elements as
  necessary to complete last partition upto n items. In case there are
  not enough padding elements, return a partition with less than n items.


@peterwestmacott nice, but I find myself using partition-all more often as I'm breaking a sequence into 'chunks' but don't want to drop the last items on the floor.

Rachel Westmacott07:04:00

yes, partition has some useful variants

Rachel Westmacott07:04:04

you can also partition-all with transducers, which you can’t with partition


my random discovery: clojure.set/map-invert - inverts a map, swapping keys with values. No idea why it’s in clojure.set


Hmm - on the juxt emoji - I should probably remove it and let some of the juxt folks upload their own juxt logo or something 🙂


I think there has to be a balance between having a core function for everything and a small composeable core lib. @reborg will tell you the core library isn't small any more...


@korny watch out when you have maps like:

{:foo 1
 :bar 1}


yeah, it’s not a function I’d use a lot! Really, that should be like group-by and return {1 [:foo :bar]} but it doesn’t.

Rachel Westmacott09:04:58

(group-by second {:foo 1 :bar 1}) gets you about half way there…


Slightly off-topic, but is there anyone on here who might be able to provide an early, early start-up technologist, say like me, a corner of an office in London Mon-Thurs next week..? Cheeky, I know, but we are not yet possessed of an office and while I will be meeting with my new colleagues for some of the time, for the rest I am going to need somewhere to actually get some work done...


There may be a chance we can pay you, but I am not expecting that will be simple... We will__ be prepared to pay it forward in the future, however...


And now a Clojure question... Does anyone have any ideas on where to start if looking for tools / libraries in Clojure for manipulating .shp (Shape) files?


I'd look at wrapping that for what you need


I may well do... I am also considering putting the shape files in question into PostgreSQL under postGIS and then talking to a DB, but I am keeping my options open, and was hoping__ for a library... Still if I have to build my own that will be a fun and educational experience...


@otfrom - I am reading around the subject, but this looks as though it might be helpful as well...


@maleghast: we’ve used in the past… specifically the org.geotools/gt-shapefile package. I didn’t write the code on that project though, so not sure why it was chosen in preference to anything else… though geotools should be pretty comprehensive.


Thanks @rickmoynihan I will take a look.


@maleghast import that .shp into PostGIS and thereafter play with GeoJSON etc… i’ve done a tonne of geospatial stuff and PostGIS was always a most excellent starting point for import and normalization


@mccraigmccraig - Thanks... I was starting to feel that was going to be what I wanted, after an afternoon's research. Good to get some validation on that though, 🙂


unless you are lucky you are going to have to change the projection of at least some of your datasets - PostGIS makes that a bunch of SQL and is rock solid


I like the sound of that!


I am going to see if I can get postGIS installed on here with homebrew, or even Docker, perhaps...


i haven’t worked with postgresql/postgis for a while, but the homebrew install used to be fine


I'd rather get a Docker container for it if I possible can...


...although the tools to convert the shapefile into SQL need to be available to me. Hmmmm


@maleghast shp2psql here’s an example invocation i used for importing NUTS boundaries


oh, but i see what you mean - you will need to invoke shp2psql


I brew installed Postgres and the postgis


I have imported a shape file and am now using brew cask to install Qgis so I can test the DB quickly


And now I am reading the docs on postgis website trying to work out how I can possibly use the data I've added