[postgis-users] simplify() on lat/lon data

David Blasby dblasby at refractions.net
Fri May 21 09:46:13 PDT 2004


strk wrote:

> Are you suggesting a spherical_simplify() ?
> If you want to try, replace distance_pt_seg at postgis_algo.c:86
> with a call to a chord distance function and see what happen.

Theres distance-on-ellipse calculations already available in postgis - 
see postgis_proj.c.

You can call distance_ellipse() to give the distance-on-ellipse or you
can call distance_sphere_method() which is much faster but less 
accurate.  For distances in the "few meters" range, I recommend the 
distance_sphere_method() - see the documentation for how it works.

REMEMBER: the lat/lot number have to be in radians (i.e. *M_PI/180.0).


dave



More information about the postgis-users mailing list