Re: Data type to store latitude and longitude - Mailing list pgsql-general

From woodb@niwa.co.nz
Subject Re: Data type to store latitude and longitude
Date
Msg-id 59731.192.168.57.128.1121292356.squirrel@secure.niwa.co.nz
Whole thread Raw
In response to Data type to store latitude and longitude  (MaRCeLO PeReiRA <gandalf_mp@yahoo.com.br>)
List pgsql-general
> Hi guys,
>
> Is there a data type to store data extracted from a
> GPS? The only thing I need is store latitude and
> longitude.
>
> Thanks in advance,
>


There are a few options,

Using basic Postgresql:
store the lats as +-90 & longs as 0-360 or +-180 numeric datatypes.
create a numeric array attribute with two values much as above
use the native Postgres point datatype (largely unsupported and I don't
know if it still exists in current versions)

Or as Tom suggested, use PostGIS to add OGC compliant geometric datatypes
including points, lines and polygons, an effective spatial index, as well
as a good set of spatial functions/operators to Postgresql.

I'd recomend the latter, also adding something like QGIS to add an Open
Source GIS (Geographic Information System) package which allows you to
plot and query PostGGIS tables as layers/themes in a desktop GIS.

Both should be OK in Linuz/Windows/Mac environments.... I've only used
them with Linux.

I have used PostGIS/QGIS with a system where a Perl script parsed &
inserted NMEA GPS data into a PostGIS table, if you are downloading data
as Garmin/Magellan or whatever exports, then you might find gpsbabel
useful.


Cheers,

  Brent Wood



pgsql-general by date:

Previous
From: Richard_D_Levine@raytheon.com
Date:
Subject: Re: Standalone Parser for PL/pgSQL
Next
From: Gregory Youngblood
Date:
Subject: Re: To Postgres or not