[postgis-users] earth distance via projections

Paul Ramsey pramsey at refractions.net
Tue Apr 15 09:03:50 PDT 2003

```Proj has some decent great-circle stuff too. May we should use the proj
functions instead of our homebuilt functions in cases were proj has bee
compiled into postgis.
Paul

Jan Hartmann wrote:
> Dave Blasby wrote:
>
>  > There are lots of ways of doing this.  There are routines for doing
>  > distance calculations on an ellipsoid, but I think its more general to
>  > ...
>  > 1. Find a cartesian projection thats accurate for where your data is
>  > (ie. UTM zone whatever)
>
> There is a more general way of measuring earth distances via
> projections, (using standalone PROJ), but I don't know if this can be
> done easily within PostGIS. Some projections give true distance from one
> or two control points. An example is the "Two Points Equidistant"
> projection, which gives correct distances from its two control points to
> any other point on the map. The PROJ command (with Warsaw and Amsterdam
> as control points) would be:
>
> proj +proj=tpeqd +lon_1=21d0 +lat_1=52d15 +lon_2=4d54 +lat_2=52d21
>
> This PROJ command converts all input points to x/y-coordinates from
> which correct distances can be computed to either Warsaw or Amsterdam.
> This method has been used by Bell telephone to calculate costs for long
> distance calls.
>
> Can this be done with PostGIS? PostGIS can transform coordinates using
> standard EPSG projection parameters, but can it also do transformations
> with user defined parameters, like lat/lon above?
>
> Jan
>
> PS: PostgreSQL's contrib directory has an "earthdistance" function,
> which computes distances over a grand circle. Does anyone know how exact
> this is, compared to a projected computation?
>
>
>
> Pedro Salazar wrote:
>
>> On Tue, 2003-04-15 at 15:28, Pedro Salazar wrote:
>>
>>> David,
>>>
>>
>>
>>> 2) What is the SRID for measuring the distance between geometries in
>>> meters? I'm using the SRID 4326 (WGS84). So, to what system should I
>>> transform my geometries to get the distance in meters?
>>>
>>
>> I got it. I already understood that I have to project for a UTM
>> projection for example..
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

--
__
/
| Paul Ramsey
| Refractions Research
| Email: pramsey at refractions.net
| Phone: (250) 885-0632
\_

```