Below you will find pages that utilize the taxonomy term “Postgres”
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.
read more