[postgis-users] Storing waypoints in Postgres
computrain at paradise.net.nz
Fri Mar 31 07:27:57 PST 2006
Thank you very much for the reply Markus. I will work through what you have
written over the week-end and get back to you. I can give you a couple of
responses to some of your reply.
- I did try shp2pgsql but with no success but having said that it could of
been more user than anything :)
- As for enabling Postgis in Postgres I am unsure how to do that (The
windows version doesn't seem to have a lot of documentation) When I
installed Postgis two tables were created in the database one was called
geometry_columns (14 fields) and the other table was called spatial_ref_sys
(5 fields). The first was empty but the spatial table appeared to have all
the proj4 init strings. The one shape file that did work produced a table
inside Postgres that had a geom field which did contain data so from that I
was assuming that PostGIS was active.
- I ran an arbitary query on Postgres as you suggested and got the following
"PostgreSQL 8.1.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
(mingw-special)";"POSTGIS="1.1.1" GEOS="2.2.1-CAPI-1.0.1" PROJ="Rel. 4.4.9,
29 Oct 2004" USE_STATS"
I will create a table this week-end and give that a try - I'll let you now
the results. I'm a little unsure what data is required in the 14 fields of
the geometry_columns table and what data type the long/lat data should be
in - the geometry_columns table appears to have 4 primary keys
(f_table_catalog, f_table_schema, f_table_name, f_geometry_column)
Very much appreciated your response. Having just recently got into dealing
with spatial data my head is swimming (or should say drowning :)) in trying
to grasp everything. Your email has certainly lifted the fog on a lot of the
problems I was having.
----- Original Message -----
From: "Markus Schaber" <schabi at logix-tt.com>
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Sent: Friday, March 31, 2006 8:24 PM
Subject: Re: [postgis-users] Storing waypoints in Postgres
> Hi, Mark,
> 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,
> annotation varchar);
> 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
> following query:
> select version(),postgis_full_version();
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf. | Software Development GIS
> Fight against software patents in EU! www.ffii.org
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.3/298 - Release Date: 30/03/2006
More information about the postgis-users