Thread: Data type to store latitude and longitude

Data type to store latitude and longitude

From
MaRCeLO PeReiRA
Date:
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,

Regards,

Marcelo P
Campinas/SP/Brazil





_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis.
Instale o discador agora! http://br.acesso.yahoo.com/

Re: Data type to store latitude and longitude

From
Tom Lane
Date:
MaRCeLO PeReiRA <gandalf_mp@yahoo.com.br> writes:
> Is there a data type to store data extracted from a
> GPS? The only thing I need is store latitude and
> longitude.

You might be interested in postgis
http://www.postgis.org/

            regards, tom lane

Re: Data type to store latitude and longitude

From
woodb@niwa.co.nz
Date:
> 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