Per
Liedman

© 2016. All rights reserved.

Recently

Recently December 2013

Christmas and the new year have cut my Github productivity, while I’ve refound my interest in reading actual books and started running again after a quite abrupt stop in September.

I fiddled with Tom MacWright’s nice visualization for running and made it compatible with my own gps-track-import:

Per's running, per year

2013 looks better than it really was, since my wife borrowed my GPS pretty frequently this summer. Filtering out our runs is an interesting problem for the future, I guess. It is also interesting to note that 2010, 2011 and 2012 all ended up very close to each other, even though my training schedule is very disorganized.

New year also means there’s now a playlist for 2013; if you filter out some of the kids songs (although one or two are actually good), I listened to some very nice music this year. I also took the time make Spotify playlists of Last Playlists’ year summaries for 2013, 2012, 2011, 2010, 2009, 2008, 2007 and 2006, although at least the last is incomplete since I listened to music from… lets say “other sources” than Spotify at the time.

Folk dance

I visited a folk dance show at Stina’s school and rather enjoyed it.

After being inspired by mapschool, I tried to write down all the things I learned about tiled maps and projections while making Proj4Leaflet, adding projection support to TileStache, and helping refactoring the projection support for Leaflet. The result became The Hitchhacker’s Guide To Tiled Maps, but I’ve been reluctant to tell anyone about it, since it doesn’t feel “done” yet. For one thing, it’s currently much longer than I intended it to be.

At work, I got the opportunity to use S3 to publish some tiles. That was very uneventful and just worked. Also, it hardly cost anything.

During christmas holidays, I started a lot of small projects that haven’t really got anywhere, which was frustrating. I tried some Javascript physics engines which was fun. I also tried to do a visualization of my Moves activity using minute, but it didn’t turn out that interesting (but you can see that I go to work by bike three times a week quite regularily); also, Moves sometimes has some funky stuff going on:

Moves activity 2013

Recently

Sick baby

It’s an old picture, but it highly relates to the way November went down for me and my family. Two or three colds, or maybe it was even four, of which one required antibiotics. With two small kids means everything is half speed, at best.

At work, we held a meeting for the local GIS community, GIS Väst (yes, that site actually features what looks like a photo of an iPaq). I and Peter Thorin gave a presentation on trends in Open Source GIS (in swedish). Funny pictures and all, and even an interactive map within the presentation. I think it went ok.

Since GIS Nerd Tools was linked from the presentation, I felt obliged to finally do something about this very old, but sometimes really useful, app. As mentioned before, I rewrote it from scratch, this time using npm and Browserify. It was quick and it was fun, and I like how it turned out.

Vladimir Agafonkin, creator of Leaflet, refactored its projection system, and allowed me to give some hints on how, from the experiences collected from Proj4Leaflet. For anyone using Leaflet with projections other than spherical Mercator, it’s a great step forward, making it both easier and more flexible. For Proj4Leaflet, it means most of the tricky parts can be removed, keeping it small and (somewhat) simple.

It also felt like I worked through an unusual amount of Proj4Leaflet issues. After wrestling a local Korean coordinate system that isn’t on Spatial Reference, where the tile’s zoom levels were offset and reversed, I’m once again tempted to say I know the ins and outs of projections and tiling, but I’m pretty sure something even weirder will come up in December.

Обійми Дощу While not really what I usually listen to, I got curious on Vladimir’s band Obiymy Doschu (or Обійми Дощу, which at least looks cooler if you, like me, hardly know the cyrillic alphabet). They’re on Spotify, so the album is easily accessible, and I like it having listened through it a few times. It didn’t make it to November’s playlist, though. Still just U.N.P.O.C.

Rationalizing GIS Nerd Tools

tl;dr; I rewrote GIS Nerd Tools with Leaflet and a bunch of cool npm modules in three or four hours. It still does sort of the same thing, but the code looks reasonable and there’s some chance of adding new features to it.

Lots of WKT

GIS Nerd Tools is not so much tools as a quick way to debug geo data. In my work I see a lot of WKT and GeoJSON in logs, mails, files, et.c. where I have no quick way of actually visualizing it. Typically, when I have to work with it, there’s also something wrong with it, possibly in a support ticket or bug report from a customer. In my experience, there’s too much work involved getting the data to show on a map.

I guess one would use QGIS for tasks like this, but it becomes a bit heavy handed. QGIS can do just about anything, which also means you will have to twiddle a large amount of knobs and buttons to get it do what you want. Making it worse, you need a plugin to be able to just paste WKT into a text field, and don’t even try if your data happens to have the coordinate axises swapped (which happens to me all the time - I haven’t figured out how other people solve that, or if it just never happens).

Another alternative that has come up lately is geojson.io, which is a super great tool. Combined with a command line and tools like wellknown and reproject, it can be pretty awesome. However, it clearly isn’t designed for ginormous and very complex geometries, which I encounter quite often - I believe the syntax highlighting and/or syntax checks start to take minutes of time (which is fine, I realize the tool wasn’t designed with this use case in mind).

My go-to solution for these situations has been a pretty ridiculous tool I wrote during parental leave almost exactly three years ago, called GIS Nerd Tools. It isn’t so much a collection of tools as a very slimmed down tool to solve exactly the problem outlined above. It has worked fairly well given that it’s a hack I threw together in my free time, and it has also seen some pretty surprising amount of use among my colleagues.

Four years is a lot of time in software terms, as well as when being a parent. This is how old the old GIS Nerd Tools-code has become:

Arvid

This of course means the code is horrible. Anything I wrote more than a year ago is usually horrible. GIS Nerd Tools was especially horrible since I knew very little about writing maintainable Javascript at the time.

Yesterday I found some energy, and rewrote the whole thing from scratch. Good thing, since:

  • The code is at least sort of understandable
  • You can now not only enter WKT, but also GeoJSON
  • It supports adding multiple geometries after each other, and they will be differently styled
  • You can click geometries to see the source data
  • It uses Leaflet instead of OpenLayers (OMG!)
  • It uses a MapBox map instead of OpenStreetMap’s default

There’s a ton of things I would like to improve and fix, but now it’s at least sort of possible.

If you feel interested in helping out making this simple tool better, GIS Nerd Tools’ code is hosted on GitHub.

Recently

One of the things I want to do with the re-start for my homepage, is start blogging posts in the style of Tom MacWright’s “Recently” posts. So here goes the first one.

Recently October 2013 At work, I’m at least partly back to writing C# for the 3.0 release of Ledningskollen. It’s been an eye-opener realizing how much I’ve gotten used to dynamic languages lately - a few years ago, going from a dynamic to static language felt like coming home to safety. Today it feels more like coming home to a really cramped apartment with barred windows.

At least two years after all the cool kids, I made a presentation without PowerPoint or Google apps, and tried Bespoke.js. Inspiration from Chris Helm and his presentation Javascript is Winning at FOSS4G 2013. What really is winning, is code. Code is winning over graphic tools, every time (well, almost).

Work induced, I wrote or worked on several small (or maybe even micro) libraries for various geo-related tasks:

Leaflet Control Geocoder - forked from Leaflet Control Bing Geocoder, I generalized it to support any geocoding service, and implemented OpenStreetMap’s Nominatim as the default. It’s still not pretty enough, but I think it’s a good start.

openlayers-tilejson is more or less a straight port of leaflet-tilejson to OpenLayers. If you want support for my/Kartena’s TileJSON extensions for other projections than spherical Mercator in OpenLayers, this is what you need. (As a side note, I didn’t realize how Leaflet-specific those extensions were until I tried to use them in OpenLayers; I should do something about that.)

Brochure is still a work in progress, although sort of usable already. It’s an attempt to tie together Leaflet and a few common plugins to make it super simple to make a map and display items on it, for people who don’t know anything about GIS and don’t want to learn.

Also, I made my debute on NPM and published some of my and Kartena’s packages there. That also meant making them NPM compliant. Thanks to S. Andrew Sheppard and Calvin Metcalf for showing me how to do this in Proj4Leaflet.

Ralf-o-Rolf I decided it’s time to phase out the server I have been running in my closet for the last ten years or so. At least stop hosting web stuff on it. My 12 years old, and these days very dormant, community Ralf-o-Rolf has been converted from PHP to Django and deployed on Heroku. Since the database is roughly 250k rows, that means I actually pay for hosting now. I’m such a grownup.

Kokboken is also on Heroku.

I pay for my GitHub account from now on, allowing me to keep private repos for stuff that makes no sense as open source, like Ralf-o-Rolf. It also feels right to pay for something I use quite extensively.

U.N.P.O.C Haven’t heard U.N.P.O.C. before, although his only album seems to be from 2003. Lo-fi Beach boys meets Philemon Arthur and the Dung, or something. I really, really like it.

Electric Six Dance Commander makes me want to drink beer in large amounts.

Belle and Sebastian I almost forgot about Belle and Sebastian and haven’t listened much to them since early 2000 something, but their music fits my mood now, apparently.

My october playlist as observed from my scrobbles by Last Playlists.

Hello, world!

A new beginning and a new personal homepage.

Hopefully I will write lots of interesting things about what I’m doing, what I’m building and other things going on.

My old blog ramblings are in the epepep archives.