I don't know a lot about lat/long either but I do know that if your points
are great distances apart then you have to use more than simple trigonometry.
(Hint: the world is not flat.) :)
- jfedock_at_ixl.com wrote:
> thanks for the advice. I'll have to check out and see if function
> based
> indexes can help.
>
> John
>
> -----Original Message-----
> Sent: Friday, October 06, 2000 1:35 PM
> To: Multiple recipients of list ORACLE-L
>
>
> John,
>
> Since those strange numbers look static - why not create a function
> to
> return that value, and create a function based index on the function?
> If
> you're not in 8i, you could create additional columns (say, for the
> value
> and it's sqrt), populated and maintained by triggers, and index them.
> Sounds
> like a good idea to me.
>
> hth,
>
> Yosi
>
> > -----Original Message-----
> > From: jfedock_at_ixl.com [mailto:jfedock_at_ixl.com]
> > Sent: Friday, October 06, 2000 12:41 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: longitude, latitude
> >
> >
> > Hello all,
> >
> > Looking for some advice on the best way to use longitude and latitude.
> > These values are stored in a table, along with other info.
> >
> > In order to get within a certain distance, our developers are
> > using the
> > following query. It actually runs well, with a few hints. I
> > feel that we
> > need to narrow down the long/lat in the where clause by a
> > certain distance.
> >
> > I'll be the first to admit I don't know much about long/lat.
> > I'm just trying
> > to tune this query a bit.
> >
> > Anybody else out there deal with this before?
> >
> >
> > SELECT DISTINCT service_provider_id,
> > SQRT(((37.6715 - LATITUDE)*(37.6715 - LATITUDE) + (-77.5465 -
> > LONGITUDE)*(-77.5465 - LONGITUDE)) * 5329) DIST
> > FROM provider_search
> > WHERE SPECIALTY_CATEGORY_ID = 'PH'
> > AND ((37.6715 - LATITUDE)*(37.6715 - LATITUDE) + (-77.5465 -
> > LONGITUDE)*(-77.5465 -LONGITUDE)) * 5329 < 100*100
> > ORDER BY DIST
> >
> >
> > Thanks.
> >
> > John
> > jfedock_at_ixl.com
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author:
> > INET: jfedock_at_ixl.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing
> Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and
> in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: Yosi_at_comhill.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: jfedock_at_ixl.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
Received on Wed Oct 11 2000 - 13:54:44 CDT