Every Person in Scotland on the Map

Full size.

The mapping process creates a random point within a building shell inside of a postcode area, which is repeated for every person in a postcode. This is in contrast to a simpler process, which does not take into account buildings at all, working simply with postcode areas. This can be seen in my previous post: Population of Scotland Mapped

Inspired by:
The Guardian – Every person in England and Wales on a map by Chris Cross

Based on the 2011 Scottish Census population data.

Data from the National Records of Scotland.

Combined with the Ordnance Survey, Open Map product.

Rendered with: QGIS tile writer python script.

Forth Road Bridge Closure Impact on Drive Times

In honour of the Forth Road Bridge re-opening completely. I created a map of the impact it has had on drive times from Edinburgh.

This is based on the OS Open Roads Product, using pgRouting, and network generated using the guide from Ross McDonald.

This does not take into account the increase of traffic on the other routes, or traffic in general. Would be interesting to see a real impact map from one of the major navigation providers.

Drive time with and without the forth road bridge

Difference the forth road bridge closue caused map

Event: Historic maps of the Stirling area

Putting Stirling on the Map

Monday 29th February 2016 at 7.30pm in the Smith

Paula Williams, Curator of Maps, Mountaineering and Polar Collections, from the National Library of Scotland will talk about four hundred years of mapping the Stirling area, illustrated with maps from the NLS collection.

See the Stirling Local History Society for details:
www.stirling-lhs.org/blog/historic-maps-of-the-stirling-area

And the Flyer.

Highlighting Selections in QGIS

I have been working a lot with points recently, and one thing with the default selection highlighting in QGIS is that selections do not really stand out. This is especially true with point layers.

A bit of an extreme example, but there are 15 points selected in the middle of this image.

hard_to_see

However, we can remedy this with the Expression Plus plugin (by Nathan Woodrow) and a rule based symbology.

plugin

This plugin adds a great function: isselected()

With this we can easily create rule to symbolise features that are selected.

The rule for symbology is as follows:

QGIS 2.12+:

QGIS 2.8:

So we can see that 2.12 has added a slightly more dynamic way of applying the symbology.

symbology

We can now slightly more easily see our selection.

more_visible

But one final setting. With symbol levels we can really make the selections pop.

symbol_levels

Symbol levels can be set from the bottom right of the styles tab, through rendering order. We simply want out selection to have a higher number than the other symbologies. Thus being rendered in a later pass and appearing on top.

final_selection

Much better.

Mapping Google Location Data

A cool python script has been created that allows you to easily convert your google location (Takeout) data into a shapefile.

You can get your data from: Google Takeout
And you only need the “Location History – JSON format”

The conversion python script can be downloaded from: GitHub

The python script requires GDAL and its python bindings, but can be easily run if you installed QGIS using the OSGeo4W installer. From the advanced installer, under the Lib section.

instruct

Then using the OSGeo4W Shell.
shell

Run the command:

Example:

Then just style it in QGIS as desired.
GoogleTakeOut

Mapping Glasgow Districts

First update: Glasgow Regions Mapped – Progress Update 1

Lets map the districts/regions/neighbourhoods/suburbs of Glasgow. The divisions of a city can be hard to distinguish, there are no hard boundaries between regions and these can be dynamic over time. Where does the West End begin? As soon as you cross the M8, or later? Where does the West End end? Before Partick, halfway through, or well past Scotstoun? Have your say!

People Make Glasgow, help define its boundaries.

Start mapping!

This was done successfully in Boston: Bostonography – Neighborhoods as seen by the people.

Although Boston is a significantly easier target. Their map covered 21 different neighbourhoods. According to Wikipedia, Glasgow has at least 145 districts.

This will only be significant if we get a good number of responses. So please feel free to share!

Made possible by: Nick Martinelli from extent(PNW). Code on GitHub.

Map Glasgow’s Regions.

The Great Polish Map of Scotland Revisited

A lot of progress has been made since my last visit: Visiting the Great Polish Map of Scotland

This time I had a bit more time, staying overnight with the very accomodating girlfirend at the Barony Castle Hotel. The steak was excellent, but the sauna was not very hot. Overall a good experience though.

PANO_20151031_145802

PANO_20151031_145722

PANO_20151031_145635

As you can see from the photos restoration works are in full progress.

IMG_20151101_110954

And dontains can be made to the worthy cause at: MapaScotland.org

IMG_20151031_152433

For a view of the way up to the map, see my first post on Mapillary:

Self Hosted Leaflet Photo

There is an excellent plugin for Leaflet called Leaflet.Photo.

The plugin was created by Bjørn Sandvik. See the full post:  http://blog.thematicmapping.org/2014/08/showing-geotagged-photos-on-leaflet-map.html

The plugin has a number of examples that show usage with image hosting platforms, like Google Photos and Instagram, which have assicaited API’s for returning information about the image in question.

I was however keen to host the sollution completely myself, so simply have a folder of images that would populate on the map if they had exif GPS information.

I have created an example available on GitHub:

https://github.com/HeikkiVesanto/Leaflet.Photo/tree/gh-pages/local_file_example

Simply download the full repo:

https://github.com/HeikkiVesanto/Leaflet.Photo

Copy the local_file_example folder. Replace the images in the Photos folder with your own photos. Load it onto any php supporting webhost.

Like: BlueHost

Or for more advanced users, the examples below are on: DigitalOcean

And link to the folder with the index.html

Example:

Link.

GIS to CAD using ogr2ogr – Part 3 – Point Annotation to Text in CAD

GIS to CAD using ogr2ogr – Part 1 – Shp to DXF with Contour Data
GIS to CAD using ogr2ogr – Part 2 – GML to DXF with OS MasterMap

MasterMap Topo Sample Data:

https://www.ordnancesurvey.co.uk/business-and-government/licensing/sample-data/discover-data.html

OS MasterMap has an annotation layer, which is simple to symbolise in a GIS program. But becomes more difficult in CAD software.

With ogr2org, when writing a DXF file, if you have an input point geometry, which has an OGR_STYLE attribute, it will be written as a text geometry when opened in CAD.

So for our MasterMap data we have one layer we want to convert to text:
CartographicText

So for this we are primarily interested in “textString” and potentially “orientation”.

Lets see the layer as points first as a baseline:

Screenshot[10]

Zoomed in:

Screenshot[11]

But lets try that as text. We will keep this simple and only take into account orientation and to a small extent height. Lets look at orientation:

Orientation – The orientation of text or symbol features for cartographic placement. This is measured in tenths of a degree anticlockwise from due east (0–3599).

So conversion to degree will be simple. Orientation/10

We can also take into consideration height as a multiplier.

And “textString” stores the text itself.

The command:

Full extent:

Screenshot[12]

Zoomed in:

Screenshot[13]

Explained:

Since this is run in windows, through the regular console, the escape character for quotes is two quotes “”‘. So a combination on ‘ ” and “”‘ we can accommodate all the required quotes.

f:””Arial””,s:””‘||(height*800)||'””,t:””‘||textString||'””,a:””‘||(orientation/10)||'””,p:5

f:””Arial””
Font: Arial

s:””‘||(height*800)||'””
Size: Multiplier of the height field, I am not sure what the units are, comments appreciated.

t:””‘||textString||'””
Text: textString column

a:””‘||(orientation/10)||'””
Align: In degrees

p:5
Position: the OS position and the ogr2ogr style position are slightly different, so better placement could be achieved with some pre-processing