Subject | Re: Recommended floating-point type for latitude and longitude |
---|---|
Author | Stephen Boyd |
Post date | 2006-10-12T13:39:24Z |
I'm not sure how much accuracy you need to preserve in your lats and
longs but 4 decimal places will pin-point any location on the face of
the earth to within about 40 (12 m) feet. Six decimal places to less
than 1 foot (30 cm).
So, depending on your needs, you could safely store lats and longs as
numeric(9, 6) which would fit into a 4 byte integer in Firebird and
you wouldn't need to worry about scaling it in your program.
--- In firebird-support@yahoogroups.com, "Daniel Albuschat"
<d.albuschat@...> wrote:
longs but 4 decimal places will pin-point any location on the face of
the earth to within about 40 (12 m) feet. Six decimal places to less
than 1 foot (30 cm).
So, depending on your needs, you could safely store lats and longs as
numeric(9, 6) which would fit into a 4 byte integer in Firebird and
you wouldn't need to worry about scaling it in your program.
--- In firebird-support@yahoogroups.com, "Daniel Albuschat"
<d.albuschat@...> wrote:
>
> Hello there,
>
> I'd like to save global latitude and longitude data in my database,
> which can look like this:
> Longitude: 7.33220348221289
> Latitude: 51.1492514558089
>
> My best guess is using numeric(18,2) and always multipy the value by
> 10000000000 before
> storing it to the database, but I'd like to hear your opinion on this.
>
> Regards,
> Daniel Albuschat
>
> --
> eat(this); // delicious suicide
>