Indicatrix
  • Home
  • About
  • Posts
  • Publications
  • Teaching

Posts

September 5, 2011

Mapping Real-Time Delays

Update 9/8/2011: I’ve posted a short piece about the significant biases and issues with this visualization.

TriMet delays on the evening of 9/5/2011. They cleared up the large delay east of Portland not long after I took this screenshot.

GTFS-realtime was released a few weeks ago, and I thought the time was right to create a visualization of the data. This project is an OpenLayers web map (pictured at left, click for larger version) using OpenStreetMap data (and the MapQuest-OSM Tiles), which is overlayed with a raster showing areas that are currently being affected by delays. The raster is calculated based on the average delay for every stop in TriMet’s GTFSr feed at the time, and is rendered using Inverse Distance Weighting to calculate the approximate delay for every location based on the delays of the nearest stops. The IDW layer is rendered on the client side using fmark’s openlayers-pointvis plugin. The data is refreshed every 30 seconds from a Postgres database, which is kept in sync with TriMet’s servers using my aforementioned GTFSrDB project.

read more
September 2, 2011

GTFSrDB: Plumbing for GTFS-realtime

Over the last week I’ve started a new project, GTFSrDB, which allows you to connect GTFS-realtime with an SQL database, allowing app developers to use realtime data through SQL, just as easily as they use static data. Rather than worry about plumbing to connect GTFS and GTFS-realtime, they can focus on writing apps.

It accomplishes two primary tasks:

  1. Keeping a database up-to-date with the latest realtime data, and

  2. Archiving historic real-time data.

read more
August 6, 2011

Fixed-position dialogs in jQuery UI

I’m working on a project where there is a long, scrolling page and I wanted to have a dialog that is draggable and resizeable that does not scroll away when the user scrolls down. As far as I could tell, there is no option to do this with jQuery UI’s dialog widget. But there is a quick workaround:

dialogDiv.dialog().parent().css('position', 'fixed');

I use the parent because the dialog widget wraps the content in another <div> that contains the content and the other elements of the dialog box (title bar, &c.).

read more
July 30, 2011

Using PostGIS Views for Geoprocessing

Here’s an efficiency improvement I’ve recently come up with. I’ve been working in QGIS on a hypothetical shuttle routing scenario, and one of the things I’ve come up with to improve my efficiency is running my geoprocessing on-the-fly in PostGIS. Rather than run a buffer operation in fTools every time I change the routing (and then load the result to PostGIS), I simply created this view in my PostGIS database for the project:

read more
July 25, 2011

Accessing GTFS Data in QGIS

When you load GTFS data into PostGIS using gtfsdb, you can’t access that data in QGIS because the tables don’t have a primary key in int4 format (the primary key is in text format).

If your transit system uses numeric ids in text format, an easy fix is running this against each of your tables:

ALTER TABLE stops ADD COLUMN gid int;
UPDATE stops SET gid = stop_id::int;
ALTER TABLE stops ALTER COLUMN gid SET NOT NULL;
ALTER TABLE stops ADD CONSTRAINT stops_gid_uniq UNIQUE(gid);

What this does is creates an integer ID field, populates it with the stop_id (or shape_id, &c.) cast to an integer, then adds NOT NULL and UNIQUE constraints to the column. You can’t add the constraints beforehand, because the column is initialized to NULL values. Remember you have to run these commands against every table you want to pull into QGIS directly, and remember to change stop_id to shape_id &c.

read more
July 11, 2011

Transit Appliance at OSCON

If any of this blog’s readers will be attending OSCON July 25-29th in Portland, I suggest you check out the session being led by my codeveloper, Chris Smith, leader and founder of the Transit Appliance project, citizen activist and blogger extraordinaire. He’ll be talking about the open-source roots of the Transit Appliance project, and how the use of open data, hardware and software allows us to create arrival displays that are “disruptively low cost.” More information is available on the official page for the talk.

read more
June 19, 2011

QGIS 1.7 'Wroc&#0322;aw' Released!

It’s official. QGIS 1.7 was released early this morning.

For the details, see the full press release. Note also the new qgis.org banner, which appeared as I was writing this post.

1.7 is a major new release with a multitude of new features; see the above page for a list.

Many thanks to the QGIS team for all of their hard work.

read more
May 29, 2011

Archiving Historical Data from NextBus

It seems that everyone who analyzes historical NextBus data has a different way of archiving their data. There are lots of ways one can use GIS to analyze this data, from creating movies showing the pulse of the transit system, to analyzing on-time performance, to finding bottlenecks. In that vein, I’ve created a short Python script that fetches NextBus data and puts it into a PostGIS database for analysis. You can download the latest version here. Here’s a rundown on options:

read more
May 29, 2011

Changing the Ownership of a WordPress Blog

Astute readers will have noticed that the author of this blog has just changed. Not to worry, it’s just an alter ego! I was doing some housekeeping to keep my various unrelated blogs straight as I move away from my other one. Here’s how I did it:

By the way, it may be useful to use two separate browsers so that you can be signed into one WordPress account in each.

read more
May 28, 2011

Installing QGIS-1.7 on Fedora

The QGIS instructions for building from source are targeted at Ubuntu, but they translate fairly well to Fedora. Here’s a quick guide:

Instead of preparing apt as they say, use yum or Package Manager to install these packages:

  • cmake
  • bison
  • flex
  • grass-devel
  • geos-devel
  • PyQt4-devel
  • gsl-devel
  • qwt-devel
  • gdal-devel

There may be few that I already had installed on my system and missed; if you run configure below and find missing dependencies, run yum search <whatever> in a terminal to look for it. Make sure you install any relevant -devel packages as well.

read more
  • ««
  • «
  • 2
  • 3
  • 4
  • 5
  • 6
  • »
  • »»
© Matt Bhagat-Conway 2025