[postgis-users] ST_distance_sphere and creating new geom from distance and direction values
Yamini Singh
yaminijsingh at live.com
Mon Oct 18 07:20:48 PDT 2010
Dear all,
I have two questions to ask:
Q1: I have a table that has one geometry column and I want to calculate
distance (in Km) between two geometries which is in one column. I am using
select query as under, and wanted to know if this is the right way of doing
distance calculation between two points. Since, both the points are in one
table but in different rows so I am using select statement to pick the geom from
each row.
select st_distance_sphere((select the_geom from table_name where
place_name='PL1'), (select the_geom from table_name where place_name='PL2'))/1000;
Q2: I have a table that has columns distance, direction, place_name and
geometry (with SRID 4326) as under.
Id distance direction Place_name geom
1 42 km E PL1 some
geometry
Now I want to calculate new geometry with reference to given geometry based
on some distance and direction. Such that new geometry is at “42km E of some
reference geometry”. Is there a function that can do this? Or if someone can
point me to a specific link..
Thanks,
YJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101018/ae1f1959/attachment.html>
More information about the postgis-users
mailing list