Showing posts with label geospatial. Show all posts
Showing posts with label geospatial. Show all posts

Friday, 30 June 2023

My QGIS YouTube channel

A short post today about the QGIS YouTube channel I just launched: called Map Academy. I have my Udemy courses online, and these are aimed at people who want a fully-fledged end-to-end QGIS course at intro or intermediate level. The Udemy courses are going pretty well and I have more than 6,000 students in 148 countries so far - with the top countries being the US, India, the UK, Germany, Canada, Nigeria, Turkey, Indonesia, Egypt and Brazil. If you want to request a video on my new YouTube channel you can do that using the form below.


But I also wanted to put together some material for when people just want to know one thing, often when they're stuck. So that's what the channel is all about, as explained in the intro video.


I've posted loads of tutorials on this blog in the past, as well as on Twitter but for a few years I've wanted to put together a channel like this to help people when they're stuck, or when they just want to learn new tricks and techniques quickly, without having to watch a long video, long intro or being asked to like and subscribe.

At the time of writing there are almost 100 videos on there and I'm going to keep adding to the channel. You can just browse manually, check out the Playlists (below) or just use the channel search function.

Short and to the point

Search for what you need.


I am also going to add, from time-to-time, longer tutorial videos, like this one on how to animate your Strava data. Maybe I'll even do the odd livestream, who knows?




Got a suggestion for a video? Use the form at the top of the page. Or, feel free to get in touch with me via Twitter, LinkedIn, the contact form on my website or by emailing me directly if you know my address.

If you suggest a video and I can fit the content in to a couple of minutes then there's a good chance I'll add it to the channel.

Thanks for stopping by :)


Student, no money? Contact me for free Udemy course link :)


Sunday, 2 October 2022

Which GIS software is best?

Let's begin with a story, from some time around the early 1990s in the north of Scotland. I used to go to a church in Inverness with my Mum when I was growing up and although I've forgotten lots of things, one of the things I do remember is the minister asking this question at the start of a sermon:

  • "What's the shortest way to London?"


He didn't say from where, but of course most people thought of the question in relation to where they were at the time. I can't remember exactly what the rest of the sermon was about, but since we were in Inverness, I was thinking maybe either the shortest route to London was the direct train from Inverness to Kings Cross, or maybe the Sleeper from Inverness to Euston or perhaps a flight from Inverness Airport to London Heathrow or Gatwick. 

The answer, of course, was that the shortest way to London was 'good company'. Cliché 101, but of course it's true. Oh, by the way, if you type 'shortest way to [city of your choice]' into Google then you should see a result straight away with a map preview on the results page - like in the example below that appeared when I typed 'shortest way to Amsterdam' into Google just now.


What have we learned so far? That a) Inverness to London is longer than Sheffield to Amsterdam; b) there's always more than one way to get from A to B; and c) sometimes the answer to a question is more abstract than you'd think. But also d) people often remember weird stuff.

If someone asked the "What's the shortest way to London?" question online, today, I imagine the answers would look something like this:

  • "Which London? London, England? London, Ontario? London, Kiribati? You need to be clearer and not make assumptions!"
  • "Where from? What's your starting point? Please clarify!!!"
  • "Why don't you go to Norwich instead of London?"
  • "The UK is finished, don't bother with London."
  • "Why are you so London-centric? Not EVERYTHING'S about London you know."
  • "Actually London is bad."
  • "You're taking the train? Communist!"
  • "Why are you not already IN London?"

[TENUOUS SEGUE JUST LIKE IN THAT SERMON WHERE I FORGOT EVERYTHING APART FROM THE 'SHORTEST WAY TO LONDON' BIT]

Okay, but this piece has a click-bait title so let's get straight to the point. Actually, let's not. Let's talk about things a bit more first, starting with geospatial file formats because we can't do much in GIS without data (apart from argue about file formats). But yeah, the best GIS software is the one that you enjoy being with, probably.

My favourite geospatial file format

The disgraceful truth is that I have quite weak opinions about geospatial file formats, and I don't really dislike any of them. In fact, I'd say I'm still friends with them all. From an abstract point of view, my favourite file format is the one that makes it easiest to get stuff done. Right now, and for the past few years, my favourite file format is definitely the geopackage and it will likely remain this way for a long time. This is because it's a single file, it can be 1KB or 10GB and it just doesn't complain. And also because it just works for me, with no fuss, particularly when I want to share GIS data on the web, as I often do.

All this sounds a bit like a dig at our old and trusted friend, the Shapefile. But it's not really. In fact, I really do agree with the view of the geopackage and Shapefile that I read on the ESRI® blog a while back. This bit of text in particular is about right - the shapefile 'has been spectacularly successful'.

"The GIS format most often compared with GeoPackage is the ESRI-defined shapefile. Shapefile is the most shared GIS format on the planet and its encoding of vector features is published. Note however the publication date — 1998. At the time the shapefile was designed, the components available had limitations that can frustrate today’s advanced workflows. These include file size limit, attribute field count and name width limits, dates not supporting time, complexity in handling character encodings and lack of null value support for most field types. Shapefile has been spectacularly successful for handling simple vector features, but it can be limiting."


But really, I don't use files above 2GB every day, though I do it enough that the geopackage format means I don't have to think about it when I do. So, geopackage? Great. Shapefile? Fine. KML, fine? Let's do a bit of a summary if we're sticking to this 'good company' / 'fastest way to London' thing. This is a bit of a brain dump, and I haven't even been drinking (surprisingly), so please bear with me.

  • GeoPackage - reliable new friend. Unlikely to throw a wobbly, even when you're having a meltdown. You've not known them for that long but they've very quickly worked their way up through the roster and are now the go-to for all your mapping needs. Sharp dresser. Good company. Anagram of go page cake.
  • Shapefile - reliable old friend that doesn't like own company so always brings their friends along for the ride, and sometimes their cousins too. But you don't mind this because they're pretty easy going, very loyal, and you know that they won't throw a wobbly either. You've heard mean people say bad things about them, and you leap to their defence, but silently and internally because you know in your heart that arguing about geospatial file formats on the internet is a bad idea. First entrant to the GIS File Format Hall of Fame. Certified Legends. The Golden Girls of geospatial (Getty as prj?).
  • Geojson - you've not known them that long but they seem okay, even pretty cool. They're always online and are pretty logical. Some of the bigger geojsons move a bit slowly offline, but online they are usually fine. Addicted to the internet though, so don't expect a close relationship.
  • KML - our old Google Maps friend. A friend that lots your our non-geo friends like too, and may even know well. Hard not to like, if you're most people. You're never more than 6 degrees from a kml. The Kevin Bacon of geospatial file formats. Is first cousin of someone known as G (ML), who you also know, a little bit.
  • NetCDF - a friend that you like but can't understand why your other friends don't seem to like them. Unfairly maligned, though you sometimes wonder if you weren't already friends with them if you'd actually like them if you met them again for the first time. A rumour, almost certainly true, is that netCDF was specifically designed to create geospatial beefs online. But you don't care because they are your pal even if, sometimes, they do weird things.
  • GPX - your friend that likes to exercise, post about it online and likes to upload their activity data to social media. But that's fine. It makes them happy and it does no harm. You're not best friends but you know where to find each other if you need to. Wears lots of tight clothes.
  • GeoTIFF - loves detail. Loyal. Doesn't like to leave any gaps in a conversation. But they are pretty solid and they don't let you down, unless you forget to invite their friends (Lempel, Ziv and Welch) to the party too. Make that mistake and you can expect a bit of trouble from time to time.
  • FlatGeobuf  - new friend who you haven't actually spent much time with yet but who you've heard only good things about, from people you trust. It's just that you've got so many other friends and not much free time for another relationship. Has purple hair. You wish you could be this cool, but don't want to admit it. Rides a fixie.
  • MapInfo TAB - ah, such happy memories! They live overseas now and you never see them but you remember the good times. A real powerhouse, but kind of retired now, we think. The Stone Cold Steve Austin of geospatial file formats.
  • All other geospatial file formats - no longer want to be my friend because a) they are not in the list above and b) they have been lumped together here under a single heading alongside CLEARLY INFERIOR formats. SQLite is thinking of taking legal action because of this blog. MIF is super miffed. DXF is thinking about bespoke wooden furniture and didn't want to be on this list anyway and resents any suggestion of equivalence.

Here's an extract from one of my QGIS training workbooks where I talk about this kind of thing in a more sensible manner, followed by two maps which demonstrate that for most of my use cases the file format thing doesn't matter. 




If I don't care too much about file formats then what on earth am I doing writing all this? Well, it's something I deal with pretty much every day and in the course of doing so I see lots of talk about it but in reality I don't find it makes too much difference to me, that's why I tell people who are just learning to use GIS software not to worry too much about it, particularly because QGIS can handle them all very easily. But, having said that, it can all be wildly confusing to people who are new to geospatial and I know this because I do lots of GIS training for people who are very clever and tech-savvy already but who are sometimes baffled by the weird world of geospatial file formats. 

Oh, a tip. If you ever get an error in QGIS while exporting to geopackage - as in when it tries to export but just gives you some kind of error message, try unticking the FID field box on export, so that you're not including that field in the export. This often solves it.

So long as you know that QGIS can export to any geospatial file format anyone would ever need, my view is that a) you don't need to worry about it and b) you should default to geopackage unless you have a really good reason not to (e.g. your org is still a shapefile outfit and not everyone can load geopackages into their software).

So which GIS software is best?

For me, the easy answer is QGIS. It's 20 years old this year and I've been using it for about 9 years. For many others this is also the easy answer. For other people, this is the wrong answer - and that is totally okay. Now that I'm no longer in the higher education world, where I didn't have to think about licences and costs, I don't use ESRI® software any more, but for years I used ArcView and ArcMap and thought they were great, mostly. I even have a soft spot for things like Error 999999 and segmentation violations. 

I probably have more of a soft-spot for ArcView 3.2 than anything else, but then again I'm still quite attached to ArcGIS 10, even if I no longer have it on any of my computers. I never did become friends with ArcGIS Pro but that's fine. I'm probably just not much of a ribbon GIS guy. Same goes for MapInfo - it was the first GIS I ever used, more than 20 years ago, and I really loved getting into it. Good times. I also have a copy of Manifold on my computer, and have done a bit of PostGIS in my time too. 

Is there a definitive answer for everyone on this question, on which GIS software is best? No, I don't think so. The answer is very much like the 'what's the shortest way to London?' question. It depends upon what company you like, where you're starting from and where you want to go. Although I would say that if you're on a Mac or Linux machine then QGIS is almost certainly what you should use for GIS software if you want to be productive. Is this 'there is no single answer' answer a cop out? I don't think so. The best GIS software is the one that meets your needs most closely, even if it's not actually GIS software.

If you're working in a big org with a long history of using ESRI software (and doing great things with it) then someone saying 'just use QGIS' probably isn't the advice you're looking for - and that's totally logical. But at the same time, QGIS is now mature, robust, powerful software to rival any modern desktop GIS and this was not always the case. 

But if I was advising someone who had never used GIS before on which software they should use, I'd 100% for sure say QGIS - I may not have said this ten years ago but in 2022 it's my firm number one and if we look at some basic Google Trends data I think we can see a bit of this in the global data too - although the United States may be a bit different on that front. Again, that's fine, but I do think the landscape is shifting. 

You can see this a bit in the Google Trends charts below - first one is Worldwide data and second one is just the United States. Is Trends data any good? Well, I've been working with the Google data team for years on search data as a proxy for interest - mainly for elections - and my view is that it's certainly useful for getting a grip on what people search for and what matters most, even if it isn't perfect.


Worldwide GIS software search trends



Worldwide GIS software search trends


Here's a little looping gif of searches for QGIS (software) and ArcGIS (software) for different countries, and worldwide, from 2004 to 2022. The blue line is QGIS, the red line is ArcGIS. Note the convergence in some countries, the crossover in others, and the large gap in others. The country name is in small text in each chart, just below where it says QGIS - best viewed on a big screen obviously.

Trends in GIS software search over time, by country



If the software you use is the one you want to use, does what you need it to, you're happy with it - and you even like using it - then I'd say that's the one for you. If this means using more than one piece of software, even better. Spread the love! For millions of people worldwide this all means that the answer to my initial question in the title is 'ArcGIS is the best software' - although I'd be interested to hear from long-term ArcGIS users on how they feel their transition to Pro has gone. 

I must confess that every time I see a new piece of work from the Monet of Maps (John Nelson) I'm even more tempted to get myself a Pro licence. But there is only so much time in the day and GIS software cannot yet make more of it (unless you can afford to purchase the ArcTime® extension, which gives you 36 hours in each day).

Excel does maps now too of course, though not incredibly well as far as I am concerned.

So the best GIS software for many people is ArcGIS and/or ArcGIS Pro. I used to use both and deliberately taught both because I think it's important not to become too locked in to one solution. In fact, for a good while I had ArcGIS, MapInfo and QGIS on my main work machine, but no longer - today it's just QGIS.

Because I think QGIS is the best GIS software for me, here are some of the best things about QGIS for me, followed by something I'd change about QGIS.

The best things about QGIS

There are lots of great things about QGIS, but I can probably highlight a few here for anyone thinking of getting into GIS software but not totally sure about what one to choose.

  • Works on any operating system - Windows, Mac, Linux (and I have it installed on each of these operating systems, and previously had it on my Chromebook too)
  • You can make GREAT maps with it, just like the newsrooms of major global media organisations do (e.g. New York Times, Washington Post, BBC, the FT, and so many more)
  • It can handle any geospatial file format
  • It can export to any geospatial file format
  • I can automate the mapping process with QGIS Atlas and output thousands of different maps at the click of a button
  • I can get all fancy with expressions, filters, queries and little bit of code and combine it all to create lovely maps
  • It's already great but keeps getting better
  • Cartographically it's a powerhouse - so many options and shortcuts mean it's super-efficient
  • The Print Layout (which can seem fiddly at first) is super-powerful and adaptable
  • The Processing Toolbox - an absolute powerhouse of geoprocessing
  • Plugins - because it's open source we have so many great extensions developed by people across the world 
  • Python integration - I'm still terrible at all this but click the Python Console button and you can go far
  • The user community - this is not niche orphan software, QGIS is a huge collective of users and developers 
  • It's super-easy to add web map layers to QGIS (e.g. XYZ or WMTS format or suchlike) - this is so useful
  • Your niche problems are often solved before you even knew you had them - this is because someone else probably had that problem first and then either a) created a Plugin to solve the problem or b) wrote a tutorial to help you and the rest of the world solve the problem - this can happen super-quickly in open source software in a way that it cannot always happen for proprietary tools 
  • Multi-language support - you can use QGIS in so many different languages, thanks to the international nature of the user and developer community (see below)
  • It's free - this is WAY down the list of reasons for me, because I don't mind paying for good software and I donate to the QGIS project anyway (currently at least £500/year but hopefully over £1000/year soon)

Klingon? Not yet 


What might I change about QGIS?

No software is perfect, even if it is (cliché alert) perfect for you. In fact, I believe nearly all software is very far from perfect, but some come close. So, with this in mind, here are all the things about QGIS that I would change, if I could.


  • Fewer updates - I saw a post on Twitter commenting on QGIS that it was software 'by devs, for devs' or something like that and while I don't agree I can at the same time see where this view comes from and have some sympathy for it. And anyway it does no harm to think about these things.


That's it really. There are small things I'd tweak due to my own personal tastes if the software was only being used by me, but from the perspective of a trainer and something of a cheerleader for QGIS I would perhaps like to see a two to three yearly long term release (LTR) schedule and if the regular development versions (release candidates) are still made available (but given much less prominence on the download page) that might be good for new users and even more established users like me. I have had a lot of feedback from users when installing that the LTR vs RC thing can be confusing, as difficult as this may be to believe for those well-versed in the software.

This 'fewer updates' desire is a bit like the job interview question where you're asked if you have any faults and you reply that 'I work too hard and am such a perfectionist' because it's basically a positive disguised as a negative in that I install and enjoy the frequent updates but at the same time the timetable does make my head spin sometimes. 

Overall, though, I mainly want to thank the large and generous QGIS development team for what they have produced since Gary Sherman's initial release in July 2002. It really is remarkable that QGIS has reached the point where we have millions of users, across all types of organisation and national contexts and for many people across the world QGIS is now their desktop GIS of choice, and good company too.

I try to contribute to QGIS myself by being a sustaining member (£$), by offering free tutorials on my blog, helping people via email and DMs, as well as offering training to individuals and companies. The plan is to move up to the next financial category of sustaining membership, and hopefully that will happen soon. 


But what about making maps in R, Python and suchlike?

A good question, but not one I really mean to get into here because I'm talking about software specifically for GIS. But of course R and Python are great tools for map making, as well as lots of other things. And what about tools like Mapbox, CARTO, UrbanSDK, Felt and so on? Again, all great but these are not desktop GIS software, which is what I'm talking about here. I've used them all to varying degrees and had lots of fun doing so, but I remain rubbish at R and Python. But here's my Greggs steak bake spider map anyway (info page).

Where is the nearest Greggs?


Final thoughts 

"Which GIS software is best?" This is actually the second question, or even the third or fourth. The first question is "what do you need to do?", the second is "what do you need to do it on?" and the third might be "in what setting or context?". 

I tried not to go too hard on the 'QGIS is amazing' vibe here, and I probably failed. But I do hope that readers who have come this far will take my point that 'best' is very much context-dependent and that the solution for one person may not be the same as it is for another. And that is totally fine.

Oh, and the shortest way to London on land is 8h 46m on the Inverness to London King's Cross train from 07:55 to 16:41 or a 1h20 flight if you want to mess around in airports for half a day and then find your way into central London. 

Just make sure you don't sit next to someone talking about GIS software or geospatial file formats because that would make it THE LONGEST JOURNEY ON EARTH.



Notes

®Esri, ArcGIS Pro, ArcGIS Online, ArcPad, Web AppBuilder, ModelBuilder, ArcMap and ArcGIS are trademarks, registered trademarks, or service marks of Esri in the United States, the European Community, or certain other jurisdictions.

The Trends data is pretty interesting, but don't take it as hard evidence that x is more popular than y. Having said that, the difference between the red line and the blue line in the US chart is maybe indicative of a situation of actual ESRI market dominance on the ground. Who knows though because it's difficult to get reliable data on the desktop GIS market. 



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