Re: GPS positions

From: Mike Ellsworth <younicycle(at)gmail(dot)com>
To: Frank Bax <fbax(at)sympatico(dot)ca>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: GPS positions
Date: 2010-05-22 03:55:40
Message-ID: AANLkTinFl5UC3oO-uYppdNAvDXhAJQSXlFdaZ-YSfyH_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

If you don't want to work with postgis, I think you could just use a bit of sqrt
using double precision - for a circle anyway.

I did something similar for a simple target archery scoring example I
set up awhile ago.
http://www.younicycle.com/web/younicycle_com/xml-hr/ex_12_a.html

Many of the other links off this page require login/privileges - but I
believe this specific page works.
round(GREATEST(10.5 - sqrt((("xyarchery"."xx" - 200) ^ 2) +
(("xyarchery"."yy" - 200) ^ 2)) / 20, 0))
where pixels are being recorded & scored.

It's been awhile since I made this, but from recall xx - yy are not
much the same as long and lat, but recorded to account for a browser
click.

Anyway -- think about it for a minute - and the lightbulb will turn
on. Believe me - I'm no math wiz.

On Fri, May 21, 2010 at 9:22 PM, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
>
>
> On Fri, May 21, 2010 at 9:19 PM, Frank Bax <fbax(at)sympatico(dot)ca> wrote:
>>
>> I'd like to create a small database for GPS positions that are currently
>> in the format "N 42° 57.750 W 081° 37.200".
>>
>> What's an easy way to store these points and how would I query data, if
>> if the only question I need answered is:
>>
>> Which positions are within 5km of a given position; where "within" can
>> be a square or circle or whatever; accuracy is not critical (let's say
>> 0.5km) is accurate enough for my purposes.
>>
>> Are there datatypes within base install of pgsql to do this?
>>
>
> http://postgis.refractions.net/
>
> Sean
>
>

--
Mike Ellsworth

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jasen Betts 2010-05-22 09:49:49 Re: GPS positions
Previous Message Sean Davis 2010-05-22 01:22:12 Re: GPS positions