Your syntax looks right to me. The only reason I can think why it would return 0 is if they are closed rings.
What do the following SQL statements return SELECT cat, length(wkb_geometry) as line_length FROM spelhey; SELECT cat, AsEwkt(wkb_geometry) as ewktrep FROM spelhey; Hope that helps, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of temiz Sent: Tuesday, September 18, 2007 11:58 AM To: postgis-list Subject: [postgis-users] distance between two end points of a line hello I want to calculate distance between two end points of a line I used: select cat, distance(pointn(wkb_geometry,1),pointn(wkb_geometry,npoints(wkb_geometry ))) from spelhey; it gives all zero cat | distance -----+---------- 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 0 14 | 0 15 | 0 16 | 0 17 | 0 17 | 0 can you tell me what happened ? regards -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users ----------------------------------------- The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer. _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
