Qgis Problem Solved

7 07 2008

I’ve moved on to using the models I generated with Local Authority DfT and ONS statistics to predict which areas of the country are complete and incomplete. I used the model on Lower Layer Super Output Areas (LLSOAs) which have an average population of 1500 and variable areas. Using Qgis I wanted to create a ratio of OSM road length in an area divided by the length of road the model predicts. In this way areas that have a value of 1 are complete, values under 1 show that there is not as many roads in OSM as I would predict and are therefore incomplete. Unfortunately there are a few areas with values larger than 1, indicating that the model is under predicting the road length. After extracting OSM road length for every boundary using Qgis I used OpenOffice spreadsheet to apply the model to every boundary, the problem came in re-importing the data to the shapefile for use in displaying heat maps in Qgis. The only way my colleague could find, involved a serious amount of hacking and command line stuff, which I am not very fluent in. Luckily with a bit of a search I found this solution.

All of the attribute data for the shapefile (i.e. all the data apart from the coordinates) is contained in a dBASE (.dbf) database file. Now if you attempt to open this file up as a database file in OpenOffice, ie by right clicking on it and make you open with OpenOffice Base then it will load up in OpenOffice spreadsheet in the correct file format. Select Unicode (UTF – 8 ) as the character set in the pop-up window and you’re good to go. You can manipulate the data in whatever way you like just be sure to save it as the same file name in the same file format. Then when you import the shapefile to Qgis it will contain all of your new attributes and you can make some new fancy heat maps as I intend to do.

Pretty soon I hope to have some nice image outputs from Qgis  which will show which areas of the UK are complete and which incomplete. Keep checking back for that and ask as many questions as you can muster, I’m always interested to hear from readers.


Actions

Information

Leave a comment