Monthly Archive for January, 2007

Pittsburgh Removed From Trip Planner

After months of deliberation, we finally decided to go ahead and remove the Pittsburgh region from the trip planner (and, poof, it’s gone). The immediate trigger for the removal was a forwarded email that contained, amongst other things, the following: “Being from Pittsburgh, I chose Pittsburgh. I couldn’t get anything to work.” Ouch.

Here’s the (heavily condensed) story behind the Pittsburgh trip planner. At the end of 2005 we were contacted by someone in Pittsburgh who was interested in integrating the area into the trip planner. She had a plan to get a grant from a local organization to support her work. She eventually got the grant and worked for several months to get the region online.

Unfortunately, for various technical and other reasons, the Pittsburgh version was never quite “up to snuff” (as they say). It was never supported by any Pittsburgh-local organizations, and after the initial integration, the person who did the integration moved to another city and hasn’t worked on it since.

Most of the feedback we have gotten from people in Pittsburgh has been negative–addresses not found, routes on the highway, etc.

We have never had the resources to work on the Pittsburgh version ourselves and have been hoping that a Pittsburgh bike organization (or some individual) would step up to the task, especially given that a proof-of-concept version had been created and, in all likelihood, just needed a bit of ongoing love and attention.

Many times we’ve discussed whether we should remove the Pittsburgh region. On the plus side, we had something that worked and that someone could work from to create something better. On the minus side, it was unsupported, didn’t work well, and was reflecting poorly on us. (Please note that I’m not saying the other regions are perfect, but they are at least nominally supported by local organizations.)

If you or someone you know or some group is interested in working on and supporting the Pittsburgh trip planner, please get in touch.

Using PostGIS with SQLAlchemy

The development version of the Trip Planner uses a Postgres/PostGIS backend (instead of MySQL) SQLAlchemy as the ORM (instead of raw SQL), and PCL for Python geometry types (instead of our own ugly hacked versions).

Question: How do you move geometries out of Postgres/PostGIS into PCL types via SQLAlchemy and vice versa?

Answer: Create a custom geometry column type.

Here’s our SQLAlchemy geometry type definition and subtypes (points, linestrings, and multilinestrings; adding other types should be trivial):

sqltypes.py

Look here for an example of using it:

tables.py

The type is pretty simple. The only tricky part was figuring out how the database stores the geometry. It’s in ASCII hex, so we use binascii.a2b_hex to get a binary representation and feed that to the PCL fromWKB factory. In the other direction we use binascii.b2a_hex on the WKB representation of the PCL geometry.

Trip Planner Updates 1/25

We hadn’t touched the online version of the trip planner in months, since we’ve been working on a new (imporoved!) version. In the last week or so, though, I got sick of looking at the old design and decided to make a few changes.

This wasn’t a complete overhaul, as we are focusing our efforts on the upcoming version, but I think it’s quite a bit nicer than before. Overall, it just feels less clunky.

Under the hood, nothing has changed. For example, for the Portland region, we’re still using data from 2004 (with some updates), but that should be changing fairly soon–hopefully within the next month or so.

Please check it out and let us know what you think.

WordPress CMS

Previously, we were using a hacked together “content management system” (CMS) to maintain this site. We had integrated WordPress for blogging, but all the pages were stored in separate files. Keeping things updated was a pain in the ass.

In order to simplify things, we wanted to move the whole site and blog into a unified CMS. We tried Mephisto, and it’s pretty nice, but we didn’t want to be tied to using Ruby on Rails, which Mephisto is built on.

We can run WordPress almost anywhere, easily, and inexpensively. There’s also a ton of info for hacking WordPress on the Web. PHP is pretty weak compared to Python or Ruby, but that doesn’t really matter for this purpose.

The theme for the site is being developed by Wyatt and is available for download via Subversion (you might need to log in with username:password guest:guest):

svn co http://svn.bycycle.org/bycycle.org/wordpress/themes/byCycle/trunk byCycle

We may have introduced some broken links or other problems during this change. If you notice anything, please let us know.

Trevor in Austin

As you may have noticed from a previous post, Trevor is in Austin working with various people to try and get Austin integrated into the bicycle route finder. We met him some time last year (at Vita Cafe on NE Alberta) after he contacted us about the idea of bringing the trip planner with him when he moved back to Austin. He is going to be blogging about the proceedings here, so “stay tuned.”

Personal Sites

In case anyone’s interested (if anyone’s actually reading this), Lauren and I have been working quite a bit on our personal Web sites/blogs, which cover some of our other interests and pursuits outside of byCycle:

In case no one is interested (or reading), uh, well, too bad or whatever. I mean, I just put these links here to boost our page rank anyway. What I really mean is, I put them here in case anyone is interested in more detail about the people who are behind these shenanigans.