Re: ORDER BY Zip Code Distance
"Jochen Daum" <jochen.daum@ca ns.co.nz> wrote in message
news:erjo20pems vi0dkshvmav7l9j gu1u6rqlh@4ax.c om...[color=blue]
> Hi!
>
>
>
>
> On Fri, 13 Feb 2004 03:32:45 GMT, "Doug Hutcheson"
> <doug.blot.hutc heson@nrm.blot. qld.blot.gov.bl ot.au> wrote:
>[color=green]
> >Jochen,
> >That is interesting. Can you give more details? As I read the op, the
> >problem was to find how many points from his database lay within x miles[/color][/color]
of[color=blue][color=green]
> >given point y. I am not a GIS expert by any menas, but I can't see how to
> >avoid doing the trig. each time? What am I missing? I love to learn new
> >stuff like this.[/color]
>
> Made a calculation mistake there, but it still goes with less area and
> accuracy:
>
> Store a table with fields
>
> srclong tinyint
> srclongmin tinyint
> srclat tinyint
> srclatmin tinyint
> distance float
> trglong tinyint
> trglongmin tinyint
> trglat tinyint
> trglatmin tinyint
>
> with a clustered index on the first 5 fields.
>
> Then save all possible combinations with their distance into the
> database. A calculation example:
>
> All of US is less than 30 by 60 degrees latitude/longitude (sorry if I
> mix it up). If we store 0 and 30 minutes positions only, thats
>
> ((30*2*60*2)^2) *20 bytes = 1036800000 bytes
>
> Thats for 7200 locations. Good thing is, it performs always the same
> for the same number of locations, no matter what actual value you
> store for minutes. The other performance factor is only the number of
> records returned, but you would want to limit that anyway for a web
> page.
>
> HTH, Jochen
>
>[color=green]
> >Cheers,
> >Doug[/color]
>
> --
> Jochen Daum - Cabletalk Group Ltd.
> PHP DB Edit Toolkit -- PHP scripts for building
> database editing interfaces.
> http://sourceforge.net/projects/phpdbedittk/[/color]
Jochen,
That looks like a great idea.
Thank you very much for the insight.
Cheers,
Doug
--
Remove the blots from my address to reply
"Jochen Daum" <jochen.daum@ca ns.co.nz> wrote in message
news:erjo20pems vi0dkshvmav7l9j gu1u6rqlh@4ax.c om...[color=blue]
> Hi!
>
>
>
>
> On Fri, 13 Feb 2004 03:32:45 GMT, "Doug Hutcheson"
> <doug.blot.hutc heson@nrm.blot. qld.blot.gov.bl ot.au> wrote:
>[color=green]
> >Jochen,
> >That is interesting. Can you give more details? As I read the op, the
> >problem was to find how many points from his database lay within x miles[/color][/color]
of[color=blue][color=green]
> >given point y. I am not a GIS expert by any menas, but I can't see how to
> >avoid doing the trig. each time? What am I missing? I love to learn new
> >stuff like this.[/color]
>
> Made a calculation mistake there, but it still goes with less area and
> accuracy:
>
> Store a table with fields
>
> srclong tinyint
> srclongmin tinyint
> srclat tinyint
> srclatmin tinyint
> distance float
> trglong tinyint
> trglongmin tinyint
> trglat tinyint
> trglatmin tinyint
>
> with a clustered index on the first 5 fields.
>
> Then save all possible combinations with their distance into the
> database. A calculation example:
>
> All of US is less than 30 by 60 degrees latitude/longitude (sorry if I
> mix it up). If we store 0 and 30 minutes positions only, thats
>
> ((30*2*60*2)^2) *20 bytes = 1036800000 bytes
>
> Thats for 7200 locations. Good thing is, it performs always the same
> for the same number of locations, no matter what actual value you
> store for minutes. The other performance factor is only the number of
> records returned, but you would want to limit that anyway for a web
> page.
>
> HTH, Jochen
>
>[color=green]
> >Cheers,
> >Doug[/color]
>
> --
> Jochen Daum - Cabletalk Group Ltd.
> PHP DB Edit Toolkit -- PHP scripts for building
> database editing interfaces.
> http://sourceforge.net/projects/phpdbedittk/[/color]
Jochen,
That looks like a great idea.
Thank you very much for the insight.
Cheers,
Doug
--
Remove the blots from my address to reply
Comment