[GRASS-user] Obtaining unique nodes from a topology

Hamish hamish_b at yahoo.com
Sat Jan 16 17:47:00 EST 2010


Hamish:
> > it would be nice if you could write up your findings/method
> > into a small wiki page when you are done, there is a real
> > lack of PostGIS+GRASS documentation.

Will wrote:
> Where should I write such a wiki page do you think?

http://grass.osgeo.org/wiki/PostGIS


> To be honest I'm not sure I'm using best practices - I
> needed a quick fix for a one-off job - I've been using
> shapefiles as an interchange medium. 

None the less, even if it is not the most efficient or elegant solution
in the world I'm of the thought that something is better than nothing,
and it might spark the basis of a more formal solution. Add editorial
comments as needed... 
btw, shapefiles can be a lossy format, but I'm not sure what a better
solution would be.


> I just rolled my own start/endpoint thing - it was pretty
> simple in Postgis to run
> /* get table of unique start/endpoints */
> insert into node (geom)
> select st_startpoint(geom) from bound
> union
> 
> select st_endpoint(geom) from bound
> 
> then
> /* assign node ids to bounds */
> update bound set startnode_id = (select id from node where
> node.geom = st_startnode(bound.geom))


thanks,
Hamish



      


More information about the grass-user mailing list