Conversion from polar coordinates to cartesian coordinates

11 views
Skip to first unread message

Geoff Cooney

unread,
Dec 21, 2011, 5:11:12 PM12/21/11
to bobo-browse
Hi,

I work with Ken McCracken and am currently looking at adding support
for cartesian coordinates to the BTree geo index implementation under
bobo-contrib. As a reference point, I was looking through the
conversion from polar coordinates to cartesian coordinates in
GeoMatchUtil. I noticed that when bobo-browse does the conversion, it
treats the Earth as a sphere and does not apply eccentricity when
calculating the z-coordinate. I was wondering what the reasoning
behind this implementation was?

Cheers,
Geoff

John Wang

unread,
Dec 22, 2011, 12:22:07 AM12/22/11
to bobo-...@googlegroups.com
Hi Geoff:

     No particular reason. The idea behind the implementation was to apply dot-product to determine the angle between the vectors.

-John


--
You received this message because you are subscribed to the Google Groups "bobo-browse" group.
To post to this group, send email to bobo-...@googlegroups.com.
To unsubscribe from this group, send email to bobo-browse...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bobo-browse?hl=en.


Geoff Cooney

unread,
Dec 22, 2011, 9:33:44 AM12/22/11
to bobo-...@googlegroups.com
Hi John,

Thanks.  I think using cartesian coordinates to make the calculation a dot product is a great idea and we want to try implementing it.  Since you have already done this, I wanted to make sure I wasn't overlooking anything.

I believe treating the earth as a sphere leaves the z-coordinate about 0.67% too large.  This probably doesn't make a big difference when the goal is to compare two (usually proximate) points, since both points will be off by similar absolute values.

Actually, if you only want to group locations into broad distance buckets(e.g. 0-5km, 5-10km, > 10 km) such as in faceted search, it probably doesn't even matter for larger distances.

Cheers,
Geoff
Reply all
Reply to author
Forward
0 new messages