Showing posts with label city. Show all posts
Showing posts with label city. Show all posts

Wednesday, 1 September 2021

A village called Trumpet (and how to find it using open data + QGIS)

This post has two main purposes. The first is to highlight the often weird and wonderful place names of Great Britain, including the village of Trumpet in Herefordshire, recently visited by my colleague Philip Brown - hence the title. The second purpose is to show anyone who is interested how to filter and find them using freely available Ordnance Survey data and free GIS software (QGIS). I'll start with a little bit of information about the data, then some maps of interesting place names, and then at the bottom I'll share more for any aspiring data boffins who might not yet know how to do this. I use these kinds of datasets in my QGIS training sessions, so that's the real reason I've been playing around with this stuff lately.

Trumpet, Herefordshire

The first step is to grab Ordnance Survey's OS Open Names dataset - a free download, available in several formats, and no registration required. There are nearly three million points in this dataset (2,952,321 as of the August 2021 file) and for each point we have the name of the feature in English, plus Gaelic or Welsh where applicable. You can read all about it in the official user guide, but for now all you need to know is that for each point there is a column which tells us whether it's a populated place, transport node, landform, some kind of landcover (e.g. a forest), hydrography (e.g. a loch) or 'other' (e.g. a primary school). For this little blog post, I filtered the data so it relates to populated places only, and this gets us a total of 43,120 places across Great Britain. This is how the places are broken down by type in the OS Open Names classification

There are four places called 'City' in Great Britain - two of these are hamlets and two are suburban areas. there is also one hamlet called 'Hamlet' and one suburban area called 'Hamlet'. 

Maps of interesting place names

Right, let's try some maps of interesting place names now - I'll leave the labels on and messy, so you won't be able to see them all on every map but that's okay, this is just a bit of trivia.

Place's, right?

Note 'London Apprentice'

Lots of Saints

Map-on-the-blog

The only exclamation in the nation


Rhymes with scone

Nicely lined up


I detect a pattern

England has cornered the market

Cat places

Such vital, vital work

Hello Romans

Yes, you get the idea. I could go on forever but I won't - I'll just add a few more and then say a little about how to structure queries for this in QGIS.




How much longer caan I go on?

I thought this should go at the bottom


How to filter to find different places in QGIS

If you are a regular reader, or if you follow me on twitter there is more than a tiny chance that you might already be a bit of a GIS nerd, so this bit may be surplus to requirements. If not, and you want to know how to filter layers in QGIS, read on.

In the final map above I have shown places containing the word 'bottom', because I am very mature. To do this in QGIS, all I did was right-click the layer in the Layers panel, click Filter... and then enter the correct query into the Provider Specific Filter Expression box, as you can see in my screenshot below.

This is using the OS Open Names points layer

Here's the filter text, if you want to copy and paste it:


"TYPE" = 'populatedPlace'

AND 

(

"NAME1" LIKE '%bottom%' 


Explanation? There is a "TYPE" column and a "NAME1" column in the OS Open Names dataset so I've used these to filter the data to show only those places that are categorised as populated places, and only where the name contains the word 'bottom'.

On the last point, the LIKE operator looks for anything between single quotes - the % signs just ensure that QGIS finds anything with bottom, including anything with text before or after it. If you put in 'bottom' it would find only places called 'bottom', if you put in '%bottom' it would find only places ending in 'bottom' and if you put in 'bottom% it would find only places that start with 'bottom'. Note that you may read that the LIKE operator is case sensitive, but in my case I was using QGIS 3.16 and it was not case sensitive (I believe this is because only certain data types will require you to take case sensitivity into account - and in those cases you can just use the ILIKE operator).

Where you have variations of spellings, etc. then you might need to be a bit more creative - e.g. in the case of the 'st.' / 'st' / 'saint' map above. This was my query for that.

"TYPE" = 'populatedPlace'

AND 

("NAME1" LIKE 'st. %' OR
"NAME1" LIKE 'st %' OR
"NAME1" LIKE 'saint %' )

One thing that can be confusing is how to search for text that contains an apostrophe, because if you just put one apostrophe between single apostrophes (i.e. single quotes) and % symbols then it won't work. The solution is to add two apostrophes, as below.

"TYPE" = 'populatedPlace'

AND 

(

"NAME1" LIKE '%''%' 


How about the hyphen-hyphen-hyphen one? Well, that goes like this:

"TYPE" = 'populatedPlace'

AND 

("NAME1" LIKE '%-%-%-%')


If you just wanted to filter to show only places of your choosing, rather than filter to find some that contains certain bits of text, then it's just a case of using the IN operator and adding places in a comma separated list, in brackets, as shown below.

"TYPE" = 'populatedPlace'

AND 

(

"NAME1"  IN ('Aberdeen','London','Southampton','Middlesbrough','Liverpool')


Slightly different example below, where I've filtered the OS Open Names dataset using a different data type so that I can show all the 'lakes' in Scotland.

"TYPE" = 'hydrography'

AND 

(

"NAME1"   LIKE '%lake%' AND "COUNTRY" = 'Scotland'

Lots of these are tiny, but they do exist


Hopefully you get the idea - hours of fun, limitless possibilities for silly blog posts, but ultimately all this is actually very useful (as well as simple) and it's the kind of thing I do day-to-day in the course of my work.

Thanks for reading.

Monday, 30 March 2020

Making 3D landscape and city models with Aerialod

This is my second post on Aerialod - the interactive path tracing renderer for height maps, by @ephtracy. It's available in 32 and 64-bit versions on Windows and it's super-lightweight but you can do some really amazing things with it. My previous post covers more of the basics, including controls and interface settings, so here I'll share some more information on how to tweak the settings (of which there are many) to create nice looking vistas. But as a quick reminder, hold down your right mouse button to rotate the map and use the space bar plus the left mouse button to move it around. Scroll wheel to zoom in and out. Keyboard shortcuts are here.

First I'll show you some new visuals I created in Aerialod, then I'll show you some of the settings I used to create them - in screenshots and in a small slide set. All the images I've posted below are in a shared folder, as well as a sample Lidar dataset for Cheddar Gorge in England that you can just drop in to Aerialod and then tweak the settings as you wish. You can of course create these kinds of images in other software (notably Blender) but Aerialod is much easier to use, though can be confusing at first.

Update (3 Nov 2020): here's an alternative shared folder on Dropbox, just in case either one is blocked where you are. The Dropbox folder is the best one to use though. I've left the other one above online as an archive.

So, let's begin with the highest peaks in Scotland, England and Wales, plus one other view that I like.

I did this using a 5m DTM (not open data)

See the curved horizon? - that's the SG lens setting

A very nice looking mountain

I've added Glen Etive because it's so lovely

But of course we don't always have to map things like mountains. If we have good quality Lidar data, as we do in much of the UK, we can create quite interesting cityscapes, as you can see below.


Here's a little Salford Sunset to get things rolling

A Newcastle-Gateshead vista, along the Tyne

The example data I've put in the shared folder is of Cheddar Gorge in the south west of England, and it looks like this once you fiddle with a few settings.

Sun low in the sky, dusky effect

I've tweaked some of the settings here to make it glow

Different angle, light filtering through the gorge

A foggier, early morning effect

So how do you do all this?
If you've not used Aerialod before then you'll really need to read my first blog post on it in order to get to grips with the controls, etc. Once you've done this, look closely at the screenshots below as the settings in them show you how I achieved the effects in the four images above. Study them closely and then see further below for a short slide set with more annotation on the settings options in Aerialod.

Take some time to Google some of the different terms and they'll begin to make a lot more sense - e.g. the Rayleigh setting refers to Rayleigh scattering, which relates to the blue colour we see in the sky. So, using the default Rayleigh setting in Aerialod you'll see a blue sky but if you reduce the number to, say 10, it will become more blue and if you put it up to 90, for example, it will look a lot less blue and instead more like a lovely glowing orange/yellow sunset. 

This relates to the first Cheddar Gorge image

This also relates to the first image

Notice the glowing light at the corners here

This is the fourth Cheddar Gorge image above

In addition to reading this, it's a good idea to check out the @ephtracy Twitter account for other tips, plus the #aerialod hashtag on Twitter. There are also now a few good video tutorials online, including this one by Steven Scott.

Here is the small set of slides, with annotated screenshots, that I made in order to help you get to grips with the settings a little better - direct link here.




All this, including the data, can be found in the Aerialod tutorial folder I made for this short blog post. Just drag and drop the .asc file I provided into Aerialod and start playing around.

I've put everything in here

The information above should be all you need to create more realistic, impressive 3D landscape or city models. It all depends of course upon being able to get good quality data at a high resolution - I've provided an example in the folder, but you can get a lot more on the Defra Lidar download page for England. You can use the OpenDem searcher to find suitable data for other parts of the world.

To end, I'm just going to post a few more images that I haven't shared anywhere else before, before a few final comments.


This is done by keeping the 'Map' option on in Grid settings

In the example above, I have all the options on in the Grid settings (Map, Ground, Vertical) and then I have used a value in the 'Step' settings on the right to match the resolution of the underlying data (in this case 5 metres) so that I get a blocky kind of effect - see below.


This works if you want to Minecraft your map

The Western Highlands of Scotland

In the image above, I just used a 1:50,000 Land-Form dataset shared by Carol Blackwood to render the Western Highlands of Scotland - I added the labels using GIMP. You can get the individual tiles as open data from Ordnance Survey as well (OS Terrain 50).


This city is home to two football teams, as you can see here

In the example above, I've just taken some Lidar open data of Liverpool and created a view looking down on Anfield and Goodison - home to Liverpool and Everton respectively. They are very close together and the densely packed terraced housing nearby also makes for an interesting example use case with this kind of data.

And, last but not least, St Kilda - a very wild and remote archipelago off the Western Isles of Scotland that is now a World Heritage Site.


In this example, I've added some fog

Notes: you can add a single file to Aerialod (it can handle PNG, JPG, TIF, IMG and ASC formats) or you can add multiple files at once using the little button on the top right that looks like a folder. That is covered in my previous blog post. If you try to load humongousbytes of data then it may crash. Sometimes it won't crash but just won't load. Generally I find it just works and the Scotland 1:50,000 terrain model above is over 600MB and worked fine for me. Just remember that when you hover over any of the tools in Aerialod you will get information on what it is and what it does at the bottom of the window. 

Citation: Blackwood, Carol. (2017). Scotland Land-Form PANORAMA® DTM, [Dataset]. EDINA. https://doi.org/10.7488/ds/1929.

Saturday, 9 March 2019

A foto da favela de Paraisópolis

This is a blog post about a famous photograph by Brazilian photographer Tuca Vieira, but also about how emotion and imagery can often be much more powerful than 'data'. I'm just posting it here as a round up of various tweets on the topic I have posted previously so that they have a more permanent place on the web. But first, here's the photo. It was taken from a helicopter above São Paulo in 2004 as part of a newspaper piece on the 450th anniversary of the city. The favela of Paraisópolis is on the left, with the much more affluent area of Morumbi to the right.

Tuca Vieira's famous image

The photo has been used to illustrate many different things, but usually it serves as an exemplar for urban inequality. I have used it to highlight how in spatial analysis near things are not always necessarily more alike (i.e. Tobler's First Law of Geography doesn't always hold) as well as to talk about inequalities. I wanted to use it in a new GIS book so I got in touch with Tuca and he agreed that we could use it (for a very reasonable fee). He also sent some of the other images he took from the helicopter that day, from slightly different angles. Very powerful stuff.

There is a separate story here about how the image took on a life of its own, detached from the photographer, and how hardly anyone credited Vieira or even acknowledged how much effort taking an image like this is. There isn't too much about the image or Vieira's thoughts on it online but see this short interview for more. By the way, Paraisópolis means 'Paradise City'.

Anyway, once I discovered that the city was on street view, I spent quite a bit of time trying to find the exact spot, and I eventually found it. It's taken from a spot roughly above Avenida Giovanni Gronchi, which you can see on the ground in this Google street view image.

My original tweet on this from 2016

 
The little street to the left separates the areas

You can also read a bit more about it on Tuca Vieira's website, though more recently I have only been able to find this via the wayback machine. The page tells a story about an exhibition in London in 2007 where he was invited, but apparently not so much included. This is how Google translates what for me is the key statement in his piece:

"this photo may make me achieve what should be the great goal of an artist: to provoke a reflection on the world and not on the work and its author".

You can of course now see the scene in 3D in Google Earth, as shown, below. Nowhere near as interesting or as powerful as the original picture but still pretty useful.

Direct link to this 3D view on Google 

Anyway, what really prompted me to look again at this recently was the arrival of Google Earth Studio, a fantastic new tool for creating pretty realistic, smooth animations of 3D scenes around the world. I decided to make a fly-to and orbit type animation of this in Google Earth Studio. The full resolution version is on my web server but I've also embedded a version below (which may not look so crisp).




Notes: as I said at the start, I'm posting this here so that all the information is in one place and not spread between various tweets. This also makes it easier for me to find the information as I'm always forgetting where I put stuff. The image itself also prompts wider questions - e.g. are we only outraged/impacted by this kind of image because the contrast is so stark and so geographically close together? Is it the proximity of wealth and inequality that is so shocking, and if so, would more distance make it more 'acceptable'? Is it only so alarming because we can see it? People will have different answers to these questions, and many more, but it is clear that the image continues to have power and relevance. Type in terms like 'urban inequality' and look at the images and this will probably still be at the top, or very near. Finally, it looks like there is another, newer version of this image on a different Brazilian website. The original seems to be this iStock one by C_Fernandes from 2016.