[postgis-users] distance_spheroid and index files

Jonas Wolf wolfey at gmx.net
Sun Feb 27 04:07:52 PST 2005


Thanks for all the replies.

I actually don't mind getting "kind of right" answers, so 
distance_sphere seems like the right choice. However, for some reason 
this function does not seem to exist. I installed PostgreSQL 7.3.4, 
Proj4 4.4.9 and GEOS 2.1.1 on Mandrake Linux. I then downloaded Postgis 
RC 3, updated the Makefile.config USE_PROJ and USE_GEOS variables, ran 
make and make install, with no errors. I set up the database and ran 
lwpostgis.sql on it. Now distance_sphere is available, as I said I've 
been using it. But no distance_sphere. Does that make any sense? 
Shouldn't this function be defined in lwpostgis.sql, like 
distance_sphere? Because it's not in there. I'm quite confused, does 
anybody have a clue what I might have done wrong?

Thanks, Jonas

Paul Ramsey wrote:
> Index usage is important. As strk notes, 4326 is measured in degrees, so 
> you'll have to convert your radius to degrees in order to create the 
> index bounding box.
> 
> Also note that distance_spheroid is very accurate but VERY EXPENSIVE. If 
> you don't mind getting "kind of right" answers, try the much faster 
> distance_sphere, which is 10 times faster.
> 
> Paul



More information about the postgis-users mailing list