[postgis-users] Storing waypoints in Postgres
schabi at logix-tt.com
Fri Mar 31 00:24:44 PST 2006
Marc Angelo wrote:
> 1) a) Can waypoint data be stored in a Postgres Database?
> b) If it can be stored, can it then be viewed in QGIS?
> c) What data fields are required in a Postgres table if the
> waypoints can be stored? Is the geom field required?
You can e. G. create a table that has four columns:
CREATE TABLE waypoints (entry_number SERIAL NOT NULL,
time TIMESTAMP WITH TIME ZONE NOT NULL,
SELECT addGeometryColumn('waypoints', 'position', 4326, 'POINT',2);
For GPS, you should use SRID 4326 usually for the geometry column, it is
WGS84, the lat/long based coordinate system that GPS uses.
For being viewed in QGIS, the geometry column does not need to have a
specific name like "geom", call it whatever you want, but you need a
corresponding entry in the geometry_columns table. There are helper
functions in PostGIS to create those entriesm, that's why I used
addGeometryColumn() above to create the gemetry column.
And the table has to be either indexed with an int4 primary key (the
SERIAL column above), or need OIDs.
> 2) I have tried to use SPIT to import some shape files into Postgres.
> "Problem inserting features from file"
I did not try out SPIT yet, but did you try the shp2pgsql utility that
comes wth PostGIS? And maybe there's a windows port of GRASS.
Another problem could be that you did not enable PostGIS in your
database. (As it is a database specific extension, you have to enable
each database with PostGIS after installing the PostGIS package on your
machine. This allows e. G. having different PostGIS versions or other
conflicting extensions installed in different databases on the same
Can you connect to the database via psql (or any other tool that lets
you fire arbitrary queries), and then send us the output of the
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
More information about the postgis-users