|
You could try using sub-queries: CREATE TABLE wp_obs AS SELECT nextval('wp_seq3') as id, geom FROM ( SELECT geom FROM ( SELECT Pointn(exteriorring(obstacles.geom ), generate_series(1,npoints(obstacles.geom)-1)) AS geom FROM obstacles, place WHERE obstacles.geom && place.geometry AND intersects(place.geometry, obstacles.geom) ) AS foo ORDER BY distance(foo.geom, GeomFromText('POINT(3.2 -35.9)',-1)) ) AS foo2; or alternatively, add the id to your table the after you populate it with geometries in the right order: ALTER TABLE wp_obs ADD id serial; Cheers, Kevin -------- Kevin Neufeld Refractions Research Inc. [EMAIL PROTECTED] (250) 383-3022 Manu wrote: 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. |
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
