[postgis-users] distance between two end points of a line

Obe, Regina robe.dnd at cityofboston.gov
Tue Sep 18 04:19:32 PDT 2007


Oops forgot to   -- verify if they are closed rings or not

SELECT cat, isclosed(wkb_geometry)
FROM spelhey 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe,
Regina
Sent: Tuesday, September 18, 2007 7:16 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] distance between two end points of a line

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: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] 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
postgis-users at postgis.refractions.net
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
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list