<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2>If I understand you correctly, I think you are missing an
order by obstacles.id in your order by clause. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2><FONT face="Times New Roman" color=#000000 size=3>create
table wp_obs as select Pointn(exteriorring(obstacles.geom ),
generate_series(1,npoints(obstacles.geom)-1)) as geom, nextval('wp_seq3') as id
from obstacles, place where obstacles.geom && place.geometry and
intersects(place.geometry,obstacles.geom) order by obstacles.id, distance
(Pointn(exteriorring( obstacles.geom),
generate_series(1,npoints(obstacles.geom)-1)),GeomFromText('POINT(3.2
-35.9)',-1));</FONT><BR clear=all></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2> </DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2>Although for efficiency (you may want to try both, I think
it may be more efficient to order your obstacles table first in a
subquery. Something like below.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007>create table wp_obs as
</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007>select
Pointn(exteriorring(o.geom ), generate_series(1,npoints(o.geom)-1)) as geom,
nextval('wp_seq3') as id </SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007>from (SELECT * FROM
obstacles ORDER BY obstacles.id) o, place where o.geom && place.geometry
and intersects(place.geometry,o.geom) </SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007>order by o.id, distance
(Pointn(exteriorring( o.geom),
generate_series(1,npoints(o.geom)-1)),GeomFromText('POINT(3.2
-35.9)',-1));</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2>As a side note - using degree point distance for
ordering doesn't guarantee proximity if you are looking at large global
areas. This is because the degree distance is not in line with actual
physical distance sort when you are looking across large areas. You may
want to order by distance_sphere instead - just a
suggestion.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=363581413-20072007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>Manu<BR><B>Sent:</B> Friday, July 20, 2007 7:10 AM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users]
Obtaining vertex order...<BR></FONT><BR></DIV>
<DIV></DIV>Hi, I am trying to create a table of vertex of a family of polygons,
order by the distance to a point (3.2 -35.9). I need also a integer column
id.<BR><BR>I made this:<BR>create table wp_obs as select
Pointn(exteriorring(obstacles.geom ),
generate_series(1,npoints(obstacles.geom)-1)) as geom, nextval('wp_seq3') as id
from obstacles, place where obstacles.geom && place.geometry and
intersects(place.geometry,obstacles.geom) order by distance
(Pointn(exteriorring( obstacles.geom),
generate_series(1,npoints(obstacles.geom)-1)),GeomFromText('POINT(3.2
-35.9)',-1));<BR clear=all><BR><BR>But id is not from ordered from 1. It seems
that it creates table firts to order later... How can I get id ordered?? I tried
to do alter table with generate series, but i coudn't make it work...
<BR><BR>Thanks<BR clear=all><BR>--
<BR>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<BR>Manuel <BR> <BR><A
href="mailto:manuelfgm@gmail.com">manuelfgm@gmail.com</A>
<BR><A
href="http://manuelfgm.blogspot.com">http://manuelfgm.blogspot.com</A>
<BR>::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: </BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
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.
</STRONG></P></BODY></HTML>