[Manifold-l] Distance calculations

adamw at manifold.net adamw at manifold.net
Thu Sep 21 08:16:02 CDT 2006


> I then tried to do this with a select query:
> 
>  SELECT Distance(Geom ([ID]),NewPointLatLon(-77.0770,38.9657))
>   FROM [Usps 2 Table]
> 
> This works.  I get distance in degrees however when I modify the
> query to what is below to get the distance in miles:
> 
>  SELECT Distance(Geom ([ID]),NewPointLatLon(-77.0770,38.9657),"mi")
>  FROM [Usps 2 Table]
> 
> I then get nothing in the resulting column.

Your drawing seems to be in lat/lon.

Replace Distance with DistanceEarth:

 SELECT DistanceEarth(Geom([ID]),NewPointLatLon(-77.0770,38.9657),"mi")
 FROM [Usps 2 Table]

Distance computes Euclidean distance in the coordinate system of the first argument. The arguments can be points, lines or areas.

DistanceEarth computes ellipsoidal distance. The arguments should be points.

If your drawing contains lines or areas, convert it to a metric coordinate system.

--
Adam Wachowski
Manifold Development Team





More information about the Manifold-l mailing list