Monthly Archive for September, 2006

Revenue Report: Google Ads

I’m planning to write a longer post about our financial status, but that might take a while, so I thought I’d go ahead and post our Google Ads revenue, in case anyone’s curious. We first added Google Ads to the site on July 1st, 2006. Here are the figures:

  • July: $41.86
  • August: $53.38
  • September: $64.34
  • October: $82.79

It’s not a lot, but it almost covers our monthly server costs. One is $9.95 per month (for our Web site) and the other is $49.00 per month (for hosting the trip planner application). In the future, assuming more and more people are using the trip planner, that second figure could go up into the hundreds and possibly thousands.

Update

We are working on a partnership with Metro that would eliminate our server costs by hosting the trip planner on their servers. This would be tremendously helpful to the project. In addition to reducing costs, it would also make certain technical issues easier to deal with.

Python Cartographic Library (PCL) — Installing Just the Spatial Package

So let’s say you need a spatial geometry library for Python. You could write your own; you could also use the PCL. The PCL includes some packages we don’t need, like one for MapServer rendering. I only installed the minimum needed to get the spatial package working (which I’ll talk about below).

[Note: "geometry" refers to points, lines, polygons and other geometric forms used to represent real-world objects. Examples: intersection (point), street (line), zip code boundary (polygon).]

I wrote a rudimentary geometry library for the trip planner that’s been working fine, but now I need to do some more “advanced” stuff related to using PostGIS and SQLAlchemy. In particular, I want to convert database values to Python objects and vice versa.

The first part (database to Python) is fairly easy and our current library already does that, but it’s convoluted in that it gets the database value as well-known text (WKT), parses that, and creates a Python object. From what I can tell, the PCL can go straight from well-known binary (WKB) geometry to Python objects.

The second part (Python to database) is harder because it involves converting a Python object to a binary geometry value. I don’t know anything about the binary geometry format and I don’t want to know, and it looks like with the PCL I don’t need to know.

I’m assuming PostGIS and PCL will get along together because they both rely on the same libraries, proj4 and geos. We’ll see.

The installation was fairly straightforward. The PCL includes five sub-packages. We had to install two of them, PCL-Referencing and PCL-Spatial. PCL-Referencing requires proj4. PCL-Spatial requires PCL-Referencing and geos >= 2.2.2. Something in there also requires the OGR library, which is included with GDAL.

The basic steps are, install proj, geos, and gdal, then install PCL-Referencing, and lastly install PCL-Spatial. On Ubuntu 6.06 (Dapper), here’s what I actually did:

  • Installed proj4 using apt-get
  • Installed libgdal using apt-get
  • Installed geos 2.2.3 from source into /usr/lib. I installed this over a slightly older version of geos installed using apt-get; hopefully that won’t cause any issues.
  • Checked out the PCL trunk:
    svn co http://svn.gispython.org/gispy/PCL/trunk PCL
  • Installed PCL-Referencing with the usual python setup.py install
  • Installed PCL-Spatial with the usual…

Revolver Bikes and North Portland Bike Works Have byCycle Shirts

Now you can support local North Portland bike shops AND byCycle.

I pedaled up to Revolver Bikes last week to deliver shirts and check out the shop. Revolver is in a great location - next to New Seasons on Interstate and right on the Max line. Mark was very friendly, relaxed, and although busy, did not seem rushed. I think this might be one of my favorite bike shops in town.

Revolver Bikes has three grey track Shirts - one of each size, a cut out shirt and dress.

North Portland Bike Works has a selection of track shirts, mostly large sizes.

If you have a shop and what to carry our shirts, email Lauren.

You can still buy shirts from us here.

Test Driven Development, PostgreSQL, SQLAlchemy

I just tried out some o’ that new-fangle “Test Driven Development” (TDD) I’ve been hearing about. Yeah, it’s good stuff.

At the moment, I’m in the process of migrating GIS data from MySQL to PostgreSQL so we can take advantage of the PostGIS spatial extensions. I’ve also been making a bunch of related changes (AKA refactoring) in the “model”, separating things that never belonged together, and so forth.

I started out by rewriting the MySQL data import script. [Note: basically, the script pulls data out of a flat ESRI shapefile and normalizes it.] This wasn’t a complete, from-scratch rewrite–a lot of stuff I just copied over and tweaked a little bit. The biggest changes here were due to using SQLAlchemy instead of typing out SQL queries. I’ll just note that SQLAlchemy is “da bomb” and makes many things easier (once you get the hang of it).

That part was pretty straightforward, and low-level–I didn’t get into the ORM aspects of SQLAlchemy at all.

The next step was to modify the routine that creates adjacency matrices for routing. In the end, this was straightforward too. I ended up reusing some stuff from the new import script, which was cool. I refactored a lot during this process, adding some new modules and classes.

[Here's where we get to the TDD aspect.]

So, I was sitting there (here really) thinking, “Hmmm… what now?” I drew some diagrams with the new classes and associations…. OK, that’s fun…. “Wait, I know. Run the unit tests!” Doy!

I started with the address normalization service, since the other services both depend on it. The test suite for this service isn’t as comprehensive as it probably should be (there are 19 tests), but it proved to very useful for shaking out a bunch of bugs in all that refactoring. The tests also helped keep me focused, and that aspect might be more important than the bug-squashing aspect (maybe).

Today, address normalization. Tomorrow, geocoding.

FreekBox

Today we went to Free Geek and picked up a Grant Box. It’s a pretty sweet computer, especially for the price ($0). We received the box through their hardware grant program. Here’s a little about Free Geek from their mission page:

“FREE GEEK is a 501(c)(3) not for profit community organization that recycles used technology to provide computers, education, internet access and job skills training to those in need in exchange for community service.”

The box came with Ubuntu GNU/Linux pre-installed, which is excellent because that’s what I’m running on my development box and on our new virtual private server (which now hosts our project tracker and soon will host a new version of the trip planner).

Our plan for the box is to use it for testing purposes (e.g., browser compatibility) and/or as a staging server before pushing new versions out to production.

Thanks, Free Geek!

PAGIS Presentation Yesterday

The presentation yesterday went great. At least, we thought so. Giving presentations is now fun. I used to be really nervous talking in front of even a few people. Not so much any more (although this hasn’t been extensively tested on a wide variety of audiences).

In school I would just not do oral presentations. I think some of my teachers must have been sympathetic, but I kind of wish they hadn’t been.

I mentioned that I thought someone from the Oregonian would be there yesterday, but as far as I know, there wasn’t. That’s just as well, because we don’t want quite that much publicity just yet.

The presentation can be viewed online here.

Older presentations can be accessed here.

You may need to adjust the text size in your browser to see everything.