How to get point in the path?

From: "LeeXiang" <lixiang(at)pset(dot)suntec(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to get point in the path?
Date: 2004-12-03 09:52:57
Message-ID: 002201c4d91d$de198570$2732a8c0@LeeXiang
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

select seq_id,npoints(latlon_path) as path_points,
(latlon_path[0])[0] as path_pt1_x,(latlon_path[0])[1] as path_pt1_y,
(latlon_path[1])[0] as path_pt2_x,(latlon_path[1])[1] as path_pt2_y,
(latlon_path[2])[0] as path_pt3_x,(latlon_path[2])[1] as path_pt3_y,
(latlon_path[3])[0] as path_pt4_x,(latlon_path[3])[1] as path_pt4_y,
(latlon_path[4])[0] as path_pt5_x,(latlon_path[4])[1] as path_pt5_y
from t_logdata
where seq_id = 1
My Sql is as above. latlon_path is a field of type:path. Now the record with seq_id = 1 havs five points in this field. I'm trying to read every points in the path. I got the err message:"cannot subscript type path because it is not an array". I use the sql as above to get the two points of a Box. Now that the path is not a point array as box, how can I get points in a path?
Besides, I'm wondering whether there's an simple way to judge if a Path intersects with a Box or not?
Thank you for your replying~ I'm waiting for any help~

Browse pgsql-general by date

  From Date Subject
Next Message Net Virtual Mailing Lists 2004-12-03 12:03:45 Re: 3rd RFD: comp.databases.postgresql (was:
Previous Message Richard Huxton 2004-12-03 09:10:52 Re: general questions on Postgresql and deployment on win32