[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


Re: [GRASS-user] problem add-ons and python (windows7)

2013-06-09 Thread Hamish
Mattia wrote:
 I'm trying to solve my problem for a long time. I hope
 someone can help me. 
 I'm not expert but I really want to istall 2 add-on on grass
 6.4.3RC3 on my win7. The add-ons are r.basin and r.ipso. I think
 there are problem with the python.exe and the PATHS. When I launch from
 console r.ipso I receive this error:
 
 C:\Program Files (x86)\GRASS GIS
 6.4.3RC3\extrabin\python.exe: can't open file 'r.ipso.py':
 [Errno 2] No such file or directory

the trouble with those two scripts are that they are written in python,
and GRASS 6 does not handle python addon scripts as well as it does
compiled C modules and UNIX shell scripts.

the bad news is as you experience they don't work out of the box right
now on Windows. The good news is that it is fixable. By moving and renaming
some of the files I could get them to run locally on Windows XP.
-- it's a solvable problem. I just ran r.basin.


gory technical details:
the basic one is Python.Make in GRASS 6's include/Make dir is not
currently set up to create the .bat file wrappers needed to launch
the scripts there. And/or the set PATHENV in \etc\Init.bat is not
working properly. (it knows about .py but doesn't know to associate
it with GRASS's python.exe)

Secondly, there is a .bat wrapper called %ADDONS%/scripts/r.basin.py.bat
which should be in %ADDONS%, and be named r.basin.bat. It contains a
single line, but that is wrong too, it should be set up for a python
script but it is created for a UNIX shell script. It should read like:

@%GRASS_PYTHON% %GRASS_ADDON_PATH%/r.basin %*

then the %ADDONS%\r.basin.py renamed to just r.basin, and finally
the batch file run as r.basin.bat.  Then it works.


The better solution is to fix the .py association with python.exe, but
care is needed to pick the right one, and not hijack that setting for
the entire computer, since other software might be using another version
of python.


 I note that there are 2 python.exe. One in C:\Program Files
 (x86)\GRASS GIS 6.4.3RC3\extrabin\ and one in C:\Program Files
 (x86)\GRASS GIS 6.4.3 RC3\Pyton27\. I think that last one is the right
 and I think that probably there is an error with the PATH. It is
 possible?

do you really have a python.exe in your ...\GRASS GIS 6.4.3 RC3\Python27\
directory? For me it is only in ...\extrabin\ and in Python27\ there is
only support files.

As of last night's nightly build, 6.4.3svn explicitly expects to find
its python.exe in the \extrabin\ dir.

 
 Can anyone drive me to the solution? I would need to know
 where setting the different path beacuse I'm noob! I also see that
 there is a folder in C: User\AppData\Roaming\GRASS6\addons... It is
 normal that the add-ons are istalled ther instead of in GRASS GIS
 6.4.3RC3 directory?

Yes, because the User can always write to their own AddData directly,
but on a multi-user or managed (corporate) system the user may not have
permission to change or add files to C:\Program Files.
There is a %GRASS_ADDON_PATH% variable set which says where your personal
scripts are stored. (can be set to multiple paths)
 
 When I launch r.basin I have an error that say aren't import
 sys, os and matplotlib. Even though I have istall matplotlib for
 Python27.

I don't get that error, just the one from g.parser that it can't get
the interface description (since it can't find the script). I'm surprised
that sys and os can't be found, that indicates that your %PYTHONPATH% is
broken since those two should always be built in. As for matplotlib I'm
not sure if GRASS ships that, it might not  so need to be installed
manually. (however you do that on Windows)


again, python + grass6 + MS Windows is a work in progress :)
fortunately only a few of the addons for grass6 are written in python,
so it's not a very widespread problem, but is certainly a pretty basic
need and something we want to support for the future.


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


Re: [GRASS-user] problem add-ons and python (windows7)

2013-06-09 Thread Hamish
another potential problem I see is that the Makefile for both
modules are calling Script.make instead of Python.make.

luckily, none of the problems are fatal, will get fixed, and can
be fixed in our backend server, i.e. no user-software upgrade will
be needed.

the biggest question mark for me is the one of associating .py
with the correct python installation in a good-neighbor way.


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


Re: [GRASS-user] Structure of sig file

2013-06-09 Thread Markus Neteler
Hi,

inspired by Moritz's comments, I have added an example to
the manual page of i.gensig, see new NOTES section:
http://grass.osgeo.org/grass64/manuals/i.gensig.html

(likewise for GRASS 6.5 and 7)

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


[GRASS-user] R: Re: problem add-ons and python (windows7)

2013-06-09 Thread Mattia Riccadonna
 And/or the set PATHENV in \etc\Init.bat is not
working properly. (it knows about .py but doesn't know to associate
it with GRASS's python.exe)

Honestly I have not found the PATHENV in \etc\Init.bat. Is it a problem? I 
tryed to know which one is the path that corresponds to python.exe but I wasn't 
able. The command try to open .py file always with pythom.exe from \extrabin.

Secondly, there is a .bat wrapper called %ADDONS%/scripts/r.basin.py.bat
which should be in %ADDONS%, and be named r.basin.bat.

I wasn't able to find where to set %ADDONS% too. I saw only %
GRASS_ADDON_PATH%. So confused :)

Mattia




Messaggio originale
Da: hamis...@yahoo.com
Data: 09/06/2013 13.33
A: grass-user@lists.osgeo.org, Mattia Riccadonnamatti...@libero.it
Ogg: Re: [GRASS-user] problem add-ons and python (windows7)

Mattia wrote:
 I'm trying to solve my problem for a long time. I hope
 someone can help me. 
 I'm not expert but I really want to istall 2 add-on on grass
 6.4.3RC3 on my win7. The add-ons are r.basin and r.ipso. I think
 there are problem with the python.exe and the PATHS. When I launch from
 console r.ipso I receive this error:
 
 C:\Program Files (x86)\GRASS GIS
 6.4.3RC3\extrabin\python.exe: can't open file 'r.ipso.py':
 [Errno 2] No such file or directory

the trouble with those two scripts are that they are written in python,
and GRASS 6 does not handle python addon scripts as well as it does
compiled C modules and UNIX shell scripts.

the bad news is as you experience they don't work out of the box right
now on Windows. The good news is that it is fixable. By moving and renaming
some of the files I could get them to run locally on Windows XP.
-- it's a solvable problem. I just ran r.basin.


gory technical details:
the basic one is Python.Make in GRASS 6's include/Make dir is not
currently set up to create the .bat file wrappers needed to launch
the scripts there. And/or the set PATHENV in \etc\Init.bat is not
working properly. (it knows about .py but doesn't know to associate
it with GRASS's python.exe)

Secondly, there is a .bat wrapper called %ADDONS%/scripts/r.basin.py.bat
which should be in %ADDONS%, and be named r.basin.bat. It contains a
single line, but that is wrong too, it should be set up for a python
script but it is created for a UNIX shell script. It should read like:

@%GRASS_PYTHON% %GRASS_ADDON_PATH%/r.basin %*

then the %ADDONS%\r.basin.py renamed to just r.basin, and finally
the batch file run as r.basin.bat.  Then it works.


The better solution is to fix the .py association with python.exe, but
care is needed to pick the right one, and not hijack that setting for
the entire computer, since other software might be using another version
of python.


 I note that there are 2 python.exe. One in C:\Program Files
 (x86)\GRASS GIS 6.4.3RC3\extrabin\ and one in C:\Program Files
 (x86)\GRASS GIS 6.4.3 RC3\Pyton27\. I think that last one is the right
 and I think that probably there is an error with the PATH. It is
 possible?

do you really have a python.exe in your ...\GRASS GIS 6.4.3 RC3\Python27\
directory? For me it is only in ...\extrabin\ and in Python27\ there is
only support files.

As of last night's nightly build, 6.4.3svn explicitly expects to find
its python.exe in the \extrabin\ dir.

 
 Can anyone drive me to the solution? I would need to know
 where setting the different path beacuse I'm noob! I also see that
 there is a folder in C: User\AppData\Roaming\GRASS6\addons... It is
 normal that the add-ons are istalled ther instead of in GRASS GIS
 6.4.3RC3 directory?

Yes, because the User can always write to their own AddData directly,
but on a multi-user or managed (corporate) system the user may not have
permission to change or add files to C:\Program Files.
There is a %GRASS_ADDON_PATH% variable set which says where your personal
scripts are stored. (can be set to multiple paths)
 
 When I launch r.basin I have an error that say aren't import
 sys, os and matplotlib. Even though I have istall matplotlib for
 Python27.

I don't get that error, just the one from g.parser that it can't get
the interface description (since it can't find the script). I'm surprised
that sys and os can't be found, that indicates that your %PYTHONPATH% is
broken since those two should always be built in. As for matplotlib I'm
not sure if GRASS ships that, it might not  so need to be installed
manually. (however you do that on Windows)


again, python + grass6 + MS Windows is a work in progress :)
fortunately only a few of the addons for grass6 are written in python,
so it's not a very widespread problem, but is certainly a pretty basic
need and something we want to support for the future.


Hamish


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


Re: [GRASS-user] FreeBSD Compilation Error : Update config.guess and config.sub

2013-06-09 Thread Markus Neteler
On Tue, Dec 4, 2012 at 12:33 AM, Markus Neteler nete...@osgeo.org wrote:
 On Mon, Dec 3, 2012 at 6:48 PM, Pierre Stévens pie...@geobsd.com wrote:
 I found the latest version of those files here :

 http://git.savannah.gnu.org/cgit/config.git/tree/

 Are they the good ones ?

 Perfect - I have updated the files in GRASS 7.svn. Please try again,
 I hope it now works for you.

FYI:
I have updated config.guess, config.sub, configure in all
branches/trunk to the latest version to keep up with the
autoconf improvements.

Source:
http://git.savannah.gnu.org/cgit/config.git/plain/

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


[GRASS-user] R: Re: problem add-ons and python (windows7)

2013-06-09 Thread Mattia Riccadonna
In addition, I used g.extension to get add-ons. And with that command there 
aren't make files in any folder. Have I to re-download them manually? In case, 
where have I to put make files?

Messaggio originale
Da: hamis...@yahoo.com
Data: 09/06/2013 13.37
A: grass-user@lists.osgeo.org, Mattia Riccadonnamatti...@libero.it
Ogg: Re: [GRASS-user] problem add-ons and python (windows7)

another potential problem I see is that the Makefile for both
modules are calling Script.make instead of Python.make.

luckily, none of the problems are fatal, will get fixed, and can
be fixed in our backend server, i.e. no user-software upgrade will
be needed.

the biggest question mark for me is the one of associating .py
with the correct python installation in a good-neighbor way.


Hamish



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