Showing posts with label graphics. Show all posts
Showing posts with label graphics. Show all posts

Friday, 8 November 2019

Amazing 3D rendering with Aerialod - a tutorial

One of the more exciting developments in recent years for those of us into geospatial things is the arrival at the end of October 2019 of Aerialod by ephtracy. What am I talking about? I'm talking about being able to create the kind of images you see below in only a few minutes using free software and open data. Scroll past the images for some tips on how to do this, and note that this write up was completed on 8 November 2019 and refers to v0.0.1.

The Cuillin ridge in Skye

Part of the City of Belfast in Northern Ireland

This is indeed a little bit of London

A little circular bit of London

This is also London, for Millwall fans

The Cuillins in Skye, featuring Sgùrr Alasdair

This is Sheffield, around the area where I work

Okay, so how do you get up and running? First of all, go to the Aerialod website and download the package you need. It's Windows 64- or 32-bit only for now and you just download and unzip and then run the .exe to launch Aerialod.

You do get some sample raster data in the zipped download (in the 'map' folder) but if you also download the 'Sample Maps' archive next to the software download button you'll get a central Manchester Lidar png and a Mars (yes, the planet) png. This is a nice reminder that Aerialod is able to handle different formats, including .asc, .png. and .tif for example. I haven't tried any other formats though I think you'll be okay with .jpg too.


They don't look like much here, but wait and see!

When you launch Aerialod you'll see something pretty much like the image below - and it will have that blocky sample layer in there. This is useful for playing around with so you can get to grips with navigation etc. Just note that when you zoom or move around Aerilod may briefly look pixelly/fuzzy as it re-renders, so don't worry about that. It sharpens up perfectly once it's done, although with more complex layers it takes a bit longer.

You may be a bit bewildered at first, but it won't last long

Before I forget, be sure to look in the config folder and open the hotkey.txt file, which I've shown below. That's really useful. But I find mouse navigation easier, so read on. Also note that the second section of hotkey actions below combine a left mouse button click with keyboard actions too.


Hit D and be amazedx

If you are finding the interface too small and can't actually see the icons easily (e.g. if you have a 4k monitor or something like that) then you can use CTRL + or - to scale the UI but you could also just edit this bit of the config.txt file (in the config folder) so instead of 1.0 it says 2.0, like below:

view :
{
// 0.5 ~ 3.0
ui_scale : '1.0'
}


Okay, we're all set now so here are the basics of moving things around:


  • Scroll wheel/middle mouse button - you can scroll forwards and backwards to zoom in and out and with the button pressed down you can position the layer wherever you want. 
  • Right mouse button - tilt/pan/rotate etc. Just have a play and you'll see what I mean.
  • And of course with keys, as above, W to zoom in S to zoom out, D to rotate clockwise and A to rotate anti-clockwise.

You loaded the software, figured out navigation with the sample data but now want to render some real world stuff. See below for how to do that.

There are tons of sources for this, including things like NASA's 30 metre SRTM but really it's going to look best with high-resolution DSM or DTM data and for this Lidar is ideal. On the Aerialod page they link to two potential sources of this - the UK's Defra Lidar page where you can download a variety of 25cm, 50cm, 1m and 2m Lidar data for England or get NASA's HiRISE data for elsewhere in the universe.

To get data into Aerialod, the easiest method in my opinion is just to drag and drop a raster file straight in, so that's what I just did with the Manchester.png layer you can see in the screenshot below. To be clear, what you see below is just the result of me dragging and dropping a png file into Aerialod. I haven't done anything else yet.

That was easy!

Before I say more about settings, a word on getting data into Aerialod in other ways. In the top right of the window you'll see a save icon. That will save the raster layer (not the 3D render) to a location of your choice. The next button (the open folder icon) will let you open a new single layer instead of dragging and dropping into the window. The next button (the closed folder icon) is a bit different, but it effectively allows you to stitch together all layers in a single folder, and it's amazing. Just click one item in the folder and it will add them all, as you can see below. The final button (blank page) just starts a new Aerialod blank view.

Stitch multiple files!

Okay, see below for where I've used the open folder button to add a single layer. This is for a single tile (of about 7MB) near the University of Sheffield. In the image below this, I've used the closed folder icon to select the first item and then all layers are added. You don't actually have to select the first item though, just any of the files in the same folder. This is really handy as when you download Lidar data it's more than likely going to be comprised of lots of little chunks as individual files.

Single layer from within a folder

All layers from within a folder

If you get too greedy and try to add a gazillion zigabytes of data, Aerialod may crash. I know, I've tried. Anyway, for the rest of this tutorial I'm mainly going to use the Manchester.png sample file provided on the Aerialod download page - and what you see below is the result of me just dragging and dropping it into the viewer. This covers a good chunk of Manchester city centre and also a bit of Salford and Trafford and to the left of the image below you might just spot Old Trafford - both the football and cricket ground.

Just another sunny day in Manchester


Okay, so the rest of this will cover the main things you need to know but I can't cover everything because a) that would take too long and b) I don't actually know enough to tell you everything and I'm kind of learning as I type here. So the two annotated screenshots are my main contribution for now. Look at the images closely though and you should learn enough to produce great visualisations in not much time at all.

Click on the next two images for a little explainer of what does what and then try it yourself.

This covers the basics, click to expand

Some more tips - including on Focus


Offset - actually quite useful for flood viz
A full screenshot so you can see some of the settings here

That's basically it for now. All that's left to say is don't forget to check the #Arielod hashtag on twitter as well as the @ephtracy Twitter feed. Last of all, don't forget that you can drop all kinds of things into Aerialod, not just terrain models and suchlike. I've experimented with adding in photos of people, which often looks sort of cool but also weird, and I've tried all sorts of other stuff but I'll end with one of the MiniScale raster relief maps of Great Britain which are part of their open data offering. It's not intended to be used this way but I think it looks quite interesting.

This actually turned out alright


Thursday, 31 December 2015

Playfair's Statistical Breviary, 1801

I recently managed to get myself a copy of William Playfair's Statistical Breviary, from 1801. The whole thing is online but the fold out pages with the charts haven't been scanned properly so it's only with the hard copy that you get the full view. Why is the Statistical Breviary of interest anyway? Well, because it's one of the most important texts in the history of statistical graphics and where the pie chart first appeared (below) - though many wish it never had! Playfair had already come up with the line graph and bar chart in The Commercial and Political Atlas so he's rightly held up as a pioneer in his field - even if this work was largely overlooked at the time. 

At least he didn't try to make it 3D

Fast forward over two hundred years and you can see that his ideas on graphical display are still pretty potent - and many analysts use them daily without realising. For example, the chart options in Excel (below) contain four types which he invented (line, pie, area, bar). The pie chart gets a bad rap, and Edward Tufte says 'the only thing worse than one pie chart is lots of them', but it is useful for showing parts of a whole. It's just that it's so often abused. This New York Times magazine piece from 2012 does a good job of setting things straight - and the comments are pretty interesting too. But today's blog isn't about pie charts. Instead, I thought I'd share some interesting nuggets from the Statistical Breviary.

Microsoft Excel - Playfair looms large

As is so often the way with old books, much of what is written could have been penned today. For example, when Playfair says that 'making an appeal to the eye when proportion and magnitude are concerned, is the best and readiest method of conveying a distinct idea' (p. 4). This definitely applies to the best of today's data visualisations. He also said that 'geographical knowledge has long been considered as necessary for persons of both sexes who wish to acquire any tolerable degree of general information; in so much that, next to ignorance of one's native language, nothing betrays a want of information so soon as ignorance in matters of geography' (p. 4-5). Also potentially useful as advertising copy for a university geography department...

Translation: 'dataviz rules' - note the long s

You can also sense Playfair's frustration with the data he used, perhaps most tellingly in his use of the phrase 'scanty gleaners' (p. 10). Perhaps he was one of the early advocates of open data when he said that 'were the aid and support of public men obtained in collecting statistical knowledge, great progress might be made in it at little expense ... but so long as that is not the case, individuals will find themselves reduced to the situation of scanty gleaners, not that of men carrying home an ample harvest' (p. 10).

Are you a 'scanty gleaner'?

Why on earth was Playfair motivated to do any of this? Well, there were probably many reasons but the most obvious is that he was trying to make data engaging and useful. He says as much in the Preface and Introduction but also on p. 16, where he notes that 'no study is less alluring or more dry and tedious than statistics, unless the mind and imagination are set to work'. Indeed, that's part of the motivation behind this blog.

Playfair wanted to inspire students here
The Statistical Breviary, as the name suggests, then proceeds though the reporting of various trade and other data for a number of empires and dominions - from 'The Empire of All the Russias' to the 'small states' of Genoa and Parma. His descriptions of some of the nations are - from today's vantage point - rather amusing!

The Turkish Empire - 'the finest portion of the world is in possession of the Turks' (p. 20).

Denmark - the people are 'still of a very brave nature' (p. 28).

Poland - 'this extensive and fruitful country, better peopled than any of the neighbouring nations, and with a brave race of inhabitants' (p. 30).

France - 'the French are violent, quick, generous, and enthusiastic' (p. 32) - note that Playfair lived in Paris from 1787 to 1793.

Britain and Ireland - I was interested to note here that Playfair, despite being a Scot, writes in this section that 'England is now the first commercial and manufacturing nation' (p. 36). It's unclear whether he's conflating England with Britain and Ireland, or just referring to England alone, but it seems like the former. Surely the kind of thing to set off vexed comments if he was writing on the Guardian DataBlog (being a Scot myself, I'm sympathetic to this). The population is listed as 14 million and the 'Chief towns' as London, Dublin, Edinburgh, York, Liverpool, Bristol and Newcastle.

Portugal - 'may be considered as Spain in miniature' (p. 42), which I thought was quite amusing. 

It's also interesting to note that Playfair decided for some reason to cover 'Hindoostan' in the Statistical Breviary, and this final section also has circle charts and data - but it looks like a late addition to me. When we look back on texts like this it makes me think that there isn't really that much new in the world and that genuine innovation ('shewing, on a principle entirely new' in Playfair's lingo) is actually quite rare. If you're interested in reading more, take a look at an online version. If you want to go and look at an original Breviary, you might have a library near you with a copy, though access can be a little complicated because it's so old. For now, I'll finish with a little pie chart joke that's been doing the rounds since last year - though nobody seems to know the original source so if you find out do let me know.


Original source seems to be this tweet


Did all his best work in London, naturally