Open the start menu, and search for: environment variables
Choose the Edit the system environment variables
Choose Environment Variables.
Edit the Path Variable by adding an entry for you path to ogr2ogr.
I would recommend installing ogr2ogr using the OSGeo4W network installer and the default path. If you have done this the path is: C:\OSGeo4W\bin
You also need to add 2 new entries into the base environmental variables, one for:
GDAL_DATA
With path:
C:\OSGeo4W\share\gdal
One for:
PROJ_LIB
With path:
C:\OSGeo4W64\share\proj
Adjust the paths accordingly if you have not used the default install locations.
Windows 10
I recently upgraded to Windows 10, and have been setting up my GIS workspace settings.
Setting up your Windows path environmental variables can easily be done through the command line.
These commands can be run directly in the command line and don’t require a computer restart to take effect. To run the command prompt, simply open up the windows search (Windows Key + S) and search for “cmd”:
Then run the command to add the path.
Update: PROJ_LIB also needs to be set, to prevent “PROJ: proj_create_from_wkt: Cannot find proj.db” errors.
Determine where your QGIS is installed. I recommend using the OSGeo4W network installer and using the default location. Which would be: C:\OSGeo4W\bin
For these I simply created multiple buffers using the QGIS buffer tool. This works for small samples, but was quite frustrating. I had initially hoped to do the whole analysis in SQLite, which worked pretty well initally, but struggled on the larger buffers. It took too long to run the queries, and did not allow for visualisation. I think using PostGIS would however be pretty feasible.
But creating a multi-ring buffer plugin for QGIS also seemed like a good learning experience. Which got me thinking, does it matter if you create increasingly large buffers around the original feature, or if you buffered the resulting buffer sequentially. My hypothesis was that there would be pretty significant differences due to the rounding of corners.
My question is not about the overlapping-ness of the buffers, since I think multi-ring buffers should be “doughnuts” anyway. But rather if smoothing will occur. The only answer was to try it myself.
Buffer styles:
Buffer the resulting buffer sequentially: Sequential
Buffer the original feature with increasing buffer distance: Central
[table caption=”Speed – In seconds”]
Features, Rings,Central, Sequential
1, 5, 0.59, 0.56
55, 5, 8.06, 6.38
1, 200, 60.83, 31.76
3, 200, 62.89, 40.89
55, 200, 628.38, 586.67
1, 2000, 203.84, 67.00
[/table]
No matter how you do it the sequential style is quicker, but that may be down to my code.
Rendering
Interestingly, although understandably, the sequential style results in a lot more vertices in the outer rings. For comparison, for a 500 ring buffer the outermost ring had the following vertice counts:
[table]
Style, Vertices
Central,488
Sequential,30918
[/table]
We can see this with editing turned on.
Central:
Sequential:
We can also see a smoother profile in the sequential buffer. However the difference is not major, and hard to discern with the naked eye.
So we have at most about around a 10m discrepancy, with 500 50m rings, so around 25000m of distance from the original feature.
This impacts rendering time dramatically, an example with our 500 rings:
Central:
Sequential:
So quicker to create but slower to draw. So which one is better, quicker calculation, or quicker rendering? Or should we not do 200+ ring buffers?
Hard to say. In version 0.2 of the Multi Ring Buffer Plugin. There is an option for either in the advanced tab.
In 1774 large science was taking place in the heart of Scotland. Two men were about to weigh the earth. This was done using plumblines and measuring how much the hill in Perthshire, called Schiehallion, displaced them. Schiehallion was chosen for its uniform appearance and relative accessibility.
The two people responsible for the experiment were the astronomer Nevil Maskelyne and the surveyor Charles Hutton. Charles Hutton, in order to make calculations of the volume of the mountain, pioneered the use of contour lines. These were essential in joining up measurement points to create a continual observation. Maskelyne set up a cabin on each side of the mountain where he could live and take astronomical observations and plumbline readings. The hut on the north side of the mountain famously burned down during the whisky fuelled celebrations of completing the observations, taking with it a local boys precious fiddle. Upon returning to London Maskelyne compensated the boys loss by sending him a replacement fiddle, a Stradivarius.
A good account of the Scheihallion experiment can be found in Rachel Hewitt’s: Map of a Nation. Which also provides an excellent account of the early days of the Ordnance Survey.
My goal for the trip was to find the remains of Maskelyne’s ruined observatory, which according to some reports could still be found on the northern slopes of the mountain. The quest was inspired by Simon Ingram. Whose account of climbing Schiehallion in Between the Sunset and the Sea is definitely worth a read. I used the notes found in that book to narrow the search area.
At the head of the car park there is a memorial to the observation work that took place on the hill.
Schiehallion from the car park (parking is £2, and only coins are accepted), with a suggestion of nice weather ahead.
Unfortunately the weather in Scotland is never predictable. With hail one minute.
And sunshine the next.
View from the top of Schiehallion. My goal was to attain the summit, and on the way down break off from the path and head downslope.
The remains of the Ordnance Survey trig point at the top of Schiehallion.
The view of the northern slope, so the observatory remains would be somewhere down there. There were a couple of promising piles of rocks that could be seen from up high, but upon closer inspection turned out to be… piles of rocks.
View back up to the ridge.
Northern slope. The terrain was not difficult, but the weather was not ideal.
I was just about the give up the search, but after climbing one final rise I saw a suspiciously uniform pile of rocks.
The remains of Maskelyne’s observatory. One platform was for the cabin, with the other one for the astronomical instruments.
Backpack for scale.
A job well done. The way back was very boggy. I took some solace in the fact that I was contouring around the hill that established contour lines. I was also spurred by the success of actually finding the site.
No GIS in this post, so best to skip if you are not interested in UK election results.
The data has been released by the electoral commission, so I thought I would run a few queries in PostgreSQL to look at the numbers. These queries are based on the initial results, so may be subject to change.
First lets have a look at the description on the ballot paper (The party name or description used by the candidate on the ballot paper.) and look at a count of each:
Some descripancies to note are extra spaces in the raw data. Overall a good correlation might be to look how many descriptions each party has and election outcome.
Next what I have found puzzling is some of the analysis based on raw voter numbers. One example by AVAAZ.org:
I find it misleading to say that the SNP only received 5% of the vote. They only revived 5% of the vote overall, but even had they received a 100% vote in Scotland, and voter turnout in Scotland had been 100% they would still only have received 4094784 votes. Had the SNP run in more than the 59 Scottish constituencies, then they would have revived more overall votes. It is useless looking at overall votes compared to seats, the percentage of possible votes provides a better comparison in my opinion with the current electoral format.
To do this the data needed to be slightly cleansed, with some descriptions combined, for example:
Lib Dems are made up of:
“liberaldemocratstrongereconomyfairersociety”, “liberaldemocratsstrongereconomyfairersociety”, “liberaldemocratsdemocratiaidrhyddfrydolcymru”, “liberaldemocrats”, “liberaldemocratfocusteam”, “liberaldemocrat/democratiaidrhyddfrydol”, “liberaldemocrat”
And conservatives:
“conservatives”, “conservativeparty/ymgeisyddplaidgeidwadolcymru”, “conservativeparty”, “conservativeandunionistparty”, “conservativeandunionist”