Re: [GRASS-user] Merge parallel roads

2013-06-15 Thread Markus Neteler
On Wed, Jun 12, 2013 at 11:21 AM, Hendrik Hoeth ho...@linta.de wrote:
...
 BTW, is there a way to connect the end points of two lines that are
 close together, but not any of the vertices along the lines? So
 something like v.clean tool=snap, but only for the end points?

I assume that endpoints are aware of being endpoints - could this
become a new tool for v.edit?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Merge parallel roads

2013-06-12 Thread Hendrik Hoeth
Hi Markus, hi Hamish,

thanks for your comments and ideas. I had already tried the approach
v.to.rast - r.grow - r.thin - r.to.vect before, and while it kind of
worked, junctions and splittings are problematic in the cleanup stage at
the end, and the size of the raster map is prohibitively large (I ended
up patching r.thin such that the tempfile is created on a tmpfs, in
order to speed things up).

I will look into your approaches during the next few days, and also give
skeletron another try.

BTW, is there a way to connect the end points of two lines that are
close together, but not any of the vertices along the lines? So
something like v.clean tool=snap, but only for the end points?

Cheers,

Hendrik

-- 
If your dreams don't scare you, then you are not dreaming big enough.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Merge parallel roads

2013-06-12 Thread Hamish
Hendrik wrote:
 BTW, is there a way to connect the end points of two lines
 that are close together, but not any of the vertices along the
 lines? So something like v.clean tool=snap, but only for the end
 points?

I wonder if you could do v.to.db to extract the line-end node
positions, then run v.distance with a carefully set threshold to
make lines between them, then v.patch it all back together.
You'd probably want to run v.build.polylines both before and after.
?


Hamish
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Merge parallel roads

2013-06-09 Thread Hendrik Hoeth
Hi,

I need to merge parallel roads, like highway lanes, into one. I've
looked around a bit and found solutions for ArcGIS (Collapse Dual Lines
To Centerline) and for OSM XML files (Skeletron), but nothing that
works straight in GRASS. What's the best way of doing this in GRASS? 

Cheers,

Hendrik

-- 
If your dreams don't scare you, then you are not dreaming big enough.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Merge parallel roads

2013-06-09 Thread Markus Neteler
On Sun, Jun 9, 2013 at 10:11 AM, Hendrik Hoeth ho...@linta.de wrote:
 Hi,

 I need to merge parallel roads, like highway lanes, into one. I've
 looked around a bit and found solutions for ArcGIS (Collapse Dual Lines
 To Centerline) and for OSM XML files (Skeletron), but nothing that
 works straight in GRASS. What's the best way of doing this in GRASS?

I have an unsubmitted module v.centerline which extracts the
centerline from irregular vector polygon(s). Perhaps this approach
could be used here as well. It works like this (I would be pleased to
make this script available to a user who wants to make it production
ready as I don't find the time):

- extract vertices from polygon
- triangulate (v.voronoi)
- restrict to polygon of interest (v.overlay, maybe not needed for you)
- TODO: here add remove-boundaries magic (with convex hull?)
- skeletonize (v.net.spanningtree)
- TODO: extract longest line (no idea)

I think that GRASS 7 should get a generic v.centerline which does the
job for both lines as well as polygons.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Merge parallel roads

2013-06-09 Thread Hamish
Markus N wrote:
 I have an unsubmitted module v.centerline which extracts
 the centerline from irregular vector polygon(s). Perhaps this
 approach could be used here as well. It works like this
 (I would be pleased to make this script available to a user
 who wants to make it production ready as I don't find the time):

is the prototype working well? or is it still at the theoretical/
experimental stage?

I have thought about this problem a lot, it is related to the
classic river mile problem which requires defining the center
line of the river in a non-arbitrary way.

the basic idea is to combine both parallel lines into a single map,
run v.buffer to enclose them both, then get a big mosquito to pull
all the volume out of the buffer until it is thinned to a single line.
for two parallel lines it is not so bad, but when you get splits and
convergences and islands it gets ugly. actually the raster tools are
pretty good for it but they don't work well when the length:width ratio
are so very different as they are for a road or a river. maintaining
a similar digitization scale/vertex resolution as the original polygon
is another tricky but not critically important final detail.


 - skeletonize (v.net.spanningtree)
 - TODO: extract longest line (no idea)

this is an approach I have not considered. will take a little thinking
about. but if v.net.spanningtree solves the worst part of the problem
then I think the longest line should not be so hard to solve with one
of the v.net tools.


there is a bit in the archives, as well as a user donated v.centerline
module,

http://thread.gmane.org/gmane.comp.gis.grass.devel/36271/focus=36290
http://thread.gmane.org/gmane.comp.gis.grass.devel/36294


More on the difficulties of the river mile problem and ideas about it:
  http://thread.gmane.org/gmane.comp.gis.grass.user/22063/focus=22097

see also:
http://article.gmane.org/gmane.comp.gis.grass.devel/11504
http://thread.gmane.org/gmane.comp.gis.grass.user/24385
http://thread.gmane.org/gmane.comp.gis.grass.user/42693/focus=42722
http://search.gmane.org/?query=river+milegroup=gmane.comp.gis.grass.user


regards,
Hamish
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user