[postgis-users] Creating linestrings from GPS data

Johan Wehtje genwolf at gmail.com
Sun Oct 23 01:10:36 PDT 2005


I have a large amount of data collected with DGPS and GPS - it is
stored in a non spatial database in three fields - latitude longitude
and Datum.

If I can match the datum to an srid can  I build a Postgis table by doing:


Create a saved query/ view called SPLOAD defined as follows:

SELECT tbl_sites.site_name AS tag, "POINT(" & tbl_sites.latitude & ","
& tbl_sites.longitude & ")" AS geom
FROM tbl_sites;

Then run the following
INSERT INTO tbl_sites_geom (tag, geom) SELECT SPLOAD.tag,
GeomFromText((SPLOAD.geom::text), 20250);

Assuming that the tbl_sites_geom exists as a Postgis table.

This is assuming that my Latitude and longitude feilds have been
cleaned up so that they have had the spaces stripped out and any
extraneous characters, and that the srid i choose is a good match for
the datum used to collect the data in the first place.

Cheers
and thanks in advance
Johan Wehtje



More information about the postgis-users mailing list