Showing posts with label my brain hurts. Show all posts
Showing posts with label my brain hurts. Show all posts

21 February 2014

GIS and Python

I recently received a copy of Learning Geospatial Analysis with Python by Joel Lawhead. I had wondered if the book was for me since the book is intended for people with strong Python skills who would like to understand digital mapping. I have a Masters in GIS and a number of years experience as a GIS Analyst and have a decent grasp of Python.

This book ended up being very useful for me as I try to get away from only being able to use esri's products for all my GIS needs. Learning Geospatial Analysis with Python did cover a lot of basics about GIS but there is also a lot of good information on how to manipulate and analyze spatial data, mostly using pure Python but also only a very few additional libraries.

I now have confidence in moving towards using more open source software for my GIS analysis knowing that it's fairly easy to fall back to pure Python to fill in any automation or analysis gaps. The examples in the book have also given me an idea on how to fix elevation data and add weather data to my GPS tracks with a simple script.

01 May 2012

Disaster Averted



Alberta's provincial election occurred on 23 April 2012. The polls had predicted a tight race with the ultra right-wing Wildrose party winning a narrow majority over the right-wing Progressive Conservative (PC) party which had been in power for 41 consecutive years. The polls turned out to be wrong as the PCs captured 61 of 87 seats in the provincial legislature with 44% of the vote. The Wildrose were second with 17 seats and 34% of the vote. The Liberals (five seats, 10% vote) and the New Democratic Party (NDP, 4 seats, 10% vote) took the remaining seats.

It may appear like the PCs won in a near landslide though they only had a minority of the votes but how close were the Wildrose to forming the government? A visit to Elections Alberta to download the results and the electoral districts (ED) shapefile leads to some interesting answers.

As the map above shows, the Wildrose dominated southern Alberta but they had narrow loses to the PCs in a number of other EDs. The red EDs are where the Wildrose lost to the PCs by less than 5%. That means, if one in 40 of all the voters in that ED was a PC voter who decided to vote Wildrose instead, those nine EDs would have gone to the Wildrose. Together, the red and yellow EDs represent where the PCs would have lost if just one in 20 voters selected Wildrose instead of PC. There are 24 red and yellow EDs so if just five percent of the electorate in just those 24 EDs switched their vote, the PCs go down five percent, the Wildrose up five percent and those EDs fall to the Wildrose. That makes the results of the election a Wildrose minority with 41 seats to 37 for the PCs.

Should an election be able to change so much on what appears to be such a small change in voting? Proportional representation in Alberta would have brought a PC minority with 38 seats to 30 for the Wildrose, nine each for the Liberals and NDP and a single seat for the Alberta Party. A 10% swing between PCs and Wildrose in just a third of the EDs would not have changed a near landslide into a minority.

Proportional representation would also have allowed many voters on the left to avoid strategic voting. In the run-up to the election, there was lots of talk about how to block the Wildrose and their regressive policies from becoming reality. It’s impossible to know the true support of the PCs in Alberta due to strategic voting and the apathy in the first-past-the-post system where people don’t vote because the outcome of their ED is nearly guaranteed. I had hoped the final polls before the election would show the intentions of many Liberal and NDP voters who then switched to the strategic vote for the PCs at the ballot box. The last polls don’t show this as Liberal and NDP support is nearly the same as in the election. The polls only indicate that borderline Wildrose supporters had second thoughts about making a deal with the dev… er… Danielle Smith and went back to the PCs.

22 April 2012

Speaker Series

On 10 April, I was finally able to see Elizabeth May speak in person. She was in the city for the day and the UofA Greens hosted her for a talk in the afternoon. Her talk focused on the recent budget and all the horrible things it included. I was able to ask a question about whether this budget is the final stages of a "starve the beast" conservative policy. The best part was I was able to get a few minutes of Ms. May's time after the talk. I would have loved to have chatted longer with her but a small crowd was forming so I shuffled off. On 16 April, I attended the book tour lecture by Jarrett Walker, author of humantransit.org and the recently published book, "Human Transit." If you have an interest in how transit works, the book is an excellent read. Jarrett's talk was also excellent. He covered a few things in the book and a few things he said will be in his next book. Some of the questions afterwards were insightful but two "questioners" were just looking for validation on their personal views of transit. One went on and on and on about the proposed LRT line through Chinatown. She was concerned about seniors in the area being hit by the LRT. It was much more of a rant than a question and I don't think Jarrett agreed with her logic. In fact, he believes people around sixty should think about their future mobility as they age and might not be able to drive. The other questioner seemed to wonder about mixed-use around LRT stations but it took him about three minutes to get around to something which was nearly a question and he never used the term, "mixed-use."

22 August 2011

Thinking about thinking

Here's my attempt to try and start writing again. Now that I've completed my Masters of GIS, I've had to do much, much, much less writing. Issues of urban mobility are still on my mind and I'm planning on sharing some of my experiences. I now live in a more walkable neighbourhood and I'm enjoying not needing the car to do everything. I hope to post about the enjoyable walks I've had taking the kids to the pool and getting groceries. My wife's been pulling the bike trailer to libraries and splash parks all summer. We also opted to take the bikes for our family trips to Heritage Days and the Fringe Festival. I hope I'll also have a post or two about a new LRT line which is supposed to pass close to my home. It's still a long way away but I'm looking forward to it.

Plus, I'll soon have some stories about suffering at the back of the pack in cyclocross races.

14 September 2007

Privacy concerns


My As It Happens podcast was about Google's Street View. You can see it in action above. Some people are concerned that having a car driving around taking a picture of every single street in the world is an invasion of privacy; that they'll be caught on camera doing something they don't want the world to see or that a user of Street View will be able to see into their front window. I don't see how this argument stands up.

If you are doing something illegal on the sidewalk, chances are you'll be suspicious of a car driving down the street with a massive piece of technology on the roof. You'll probably be looking out for cars with technology on the roof that flashes blue and red anyway. For thousands of years, people have been walking down streets and witnessing illegal activity with the privacy of the perpetrator never questioned. Companies are also allowed to put up surveillance cameras around their businesses to watch the activity outside. I'm sure that 100% of those cameras are not trained on 100% private property. If you're cheating on your wife/husband, there are better ways for your wife/husband to catch you than scouring the Internet, hoping Google will drive by, take your picture so that you're both recognizable and post the pictures on the Internet in a timely manner.

With the number of roads in the world, Google will probably only drive down your street about once every two to ten years. Every year if you live in San Francisco. Had they driven down my street, I might use that picture when I give directions to my house; that would be pretty cool to do. Of course, my house numbers are legible so it's not that necessary. I've used Google Earth to show friends and family what my roof looks like. Chances are that Google will be driving down exciting streets first and more often. Businesses could use it for advertising! "As seen in Google Street View!" So, once again, the chances of Google driving down your street, taking pictures while your drapes are open and you're standing buck naked in full view is remote. If you're going to sue Google for invasion of privacy, you'd better also sue the retired couple down the block who have little else to occupy their time and the teenage astronomy buff neighbour who isn't looking for heavenly bodies in the sky. I don't think robbers or pedophiles are going to be using Street View for reconnaissance either. As one friend found out first hand, robbers are going to do a little more work than look at a still picture on the Internet. Luckily for his family, the robber attempting to pilfer from his neighbourhood was caught and the robber's notes mentioned the "big dog" at my friend's house.

That all being said, if you zoom in on the picture above, you can that that after about a minute on Street View I found Morpheus! But that's not Neo with him.

09 November 2006

Mental Aerobics

Two weeks ago, Ying and I learned that my sister will be having her first baby and is due two days after us. Since then, we've also learned that my cousin, Julie, will be having her first baby early in May.

I must have had a little too much time to think while walking to work 'cause I've realized the following: if my sister delivers her baby in England on 1 June at around 2:00 in the morning and Ying delivers on 31 May at 22:00 here in Cowtown, Les' baby will be three hours older yet a whole day younger than ours. I'll leave that as an exercise for the class to figure out. It's the same logic as saying I would be a day older if I was born in B.C. since I was born two minutes after midnight in Alberta.

my iTunes