[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] simplify() on lat/lon data
From:       David Blasby <dblasby () refractions ! net>
Date:       2004-05-21 17:20:51
Message-ID: 40AE3A73.9020509 () refractions ! net
[Download RAW message or body]

Tyler Mitchell wrote:

>>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
> 
> 
> Do you mean distance_ellipsoid which is available in pg through 
> distance_spheroid?
> 
> 
>>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.
> 
> 


Tyler,

I'm talking about changing the actual "C" code for the simplify function 
that strk wrote.  I miss-read strk's email and thought he was talking 
about the "distance_pt_pt()" function instead of "distance_pt_seg()" - 
the distance_ellipsoid() isnt going to help you.  Sorry for the 
confusion - ignore everything I said.

 > What's a valid value for "spheroid"?

Just create one - the definition is in postgis.h.

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

To convert a "normal" degrees number (like -120.4 degrees) to radians, 
you multiply by PI and divide by 180:

     -120.4  * PI / 180

In "C" this looks like this:

    -120.4   * M_PI/180.0

M_PI is defined in math.h to be the value of PI - 3.14...

dave


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic