From: Bill Eisenhauer Date: 2008-01-03T23:21:03+09:00 Subject: Re: spatial search & search radius circumference with Geokit Xin Zheng wrote: > I am using Geokit to search for points within X miles of a location. > > I would like to show this search region as a circular polygon in Google > Maps. For this I need a number of points around the circle's > circumference. > > My original thoughts were to generate the boundary points myself, but > then my thoughts drifted to Geokit. > > Geokit is computing the region already. Is there a way of exposing this > so I can get the boundary points? > > Any help and advice is greatly appreciated. > > I am going take a look under Geokit's hood to see if I can find a way. Hello Xin, GeoKit uses either the Haversine or Pythagorean formulas depending upon whether you prefer the accuracy of a spherical Earth or just simply a flat Earth. But these are just formulas that are applied within an origin and a set of points. Yeah, there is an implied circumference within which points may be contained, but there's no internal representation of that needed or used by GeoKit. There are formulas you can use to derive points on a circle given a radius and a number of points desired. However, I haven't researched this topic well enough to know how such would be applied to a spherical Earth. All of that said, we could potentially roll some kind of helper into GeoKit if needed. What would the API be? Cheers, Bill -- Posted via http://www.ruby-forum.com/.