sluedtke | 9 Feb 22:59
Picon
Favicon
Gravatar

How to link or combine adjacent vector lines

Dear friends, 

I have been trying for some hours now but could not find any solution. 

We do have a shape file of a river network,  but a bad one because single
rivers consist of multiple lines. Just think of the easiest example, a river
with one tributary. I would like to end up with an vector dataset that holds
2 lines for this example, one for the river and one for the tributary of
course. In my case, the dataset holds, just as an example, 10 lines, and a
distinct set of them makes either the river or the tributary. The lines of
each set are connected by the nodes of the single lines. 

Any ideas how to get ride of this format are very welcome. 

Thanks in advance, 

Stefan

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-link-or-combine-adjacent-vector-lines-tp4381557p4381557.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

matteo poletti | 9 Feb 13:57
Picon
Favicon
Gravatar

Re: Import postgis vector form schema


> try
>
> v.in.ogr [...] layer=administrative.test

I tried this, but failed:
> v.in.ogr dsn='PG:host=aaa dbname=bbb user=____ password=*****' output=prova layer=administrative.test
ERROR: Layer <administrative.test> not available


Da: Martin Landa <landa.martin <at> gmail.com>
A: matteo poletti <pollo1_91 <at> yahoo.it>
Cc: GRASS list <grass-user <at> lists.osgeo.org>
Inviato: Giovedì 9 Febbraio 2012 12:56
Oggetto: Re: [GRASS-user] Import postgis vector form schema

Hi,

2012/2/9 matteo poletti <pollo1_91 <at> yahoo.it>:
>> db.tables -p
> ...
> administrative.test
> ...
>> v.in.ogr  dsn=./  layer=test output=prova1
> ERROR: Unable to open data source <./>
>
> I'm using GRASS 6.4.0. Command such
> v.in.ogr dsn='PG:host=aaa dbname=bbb user=____ password=*****' output=prova
> layer=prova
> worked since prova is in the public schema.

try

v.in.ogr [...] layer=administrative.test

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa




_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
matteo poletti | 9 Feb 00:59
Picon
Favicon
Gravatar

Import postgis vector form schema

Hi,
I tried to import a postgis layer from a non public schema.

I used this commands according to the documentation (http://grass.fbk.eu/gdp/html_grass64/v.in.ogr.html):
> db.connect driver=pg database="host=aaa,dbname=bbb" schema=administrative 
> db.login user=_____  'password=******'
> db.connect -p
driver:pg
database:host=aaa,dbname=bbb
schema:administrative
group:
> db.tables -p
...
administrative.test
...
> v.in.ogr  dsn=./  layer=test output=prova1 
ERROR: Unable to open data source <./>

I'm using GRASS 6.4.0. Command such
v.in.ogr dsn='PG:host=aaa dbname=bbb user=____ password=*****' output=prova layer=prova
worked since prova is in the public schema.

Many thanks!
Matteo
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Markus Neteler | 8 Feb 22:37
Favicon

Re: An error in GRASS-7 manual

On Wed, Feb 8, 2012 at 7:51 AM, Andres Kuusk <andres <at> aai.ee> wrote:
>> On Thu, Jan 19, 2012 at 9:55 AM, Andres Kuusk <andres <at> aai.ee> wrote:
>>>
>>> There is a small error in the GRASS-7 HTML-manual v.what.rast,
>>> http://grass.fbk.eu/grass70/manuals/html70_user/v.what.rast.html
>>>
>>> The required parameter is vector=name,
>>>
>>> ERROR: Sorry, <map> is not a valid parameter
>>> ERROR: Required parameter <vector> not set

Perhaps you need to recompile the code if you did it yourself (clean with
"make distclean" first)...
I recompiled GRASS 7 from scratch, it works as stated in the manual:

GRASS 7.0.svn (nc_spm_08):~/grass70/lib/gis > v.random pnts n=100
Generating points...
 100%
Building topology for vector map <pnts <at> neteler>...
Registering primitives...
100 primitives registered
...
Number of points: 100
...

GRASS 7.0.svn (nc_spm_08):~/grass70/lib/gis > v.db.addtable pnts
column="heights double precision"
Reading features...
 100%
...

GRASS 7.0.svn (nc_spm_08):~/grass70/lib/gis > v.what.rast map=pnts
raster=elevation column=heights
Reading features from vector map...
 100%
Update vector attributes...
 100%
v.what.rast complete. 100 records updated.

GRASS 7.0.svn (nc_spm_08):~/grass70/lib/gis > v.db.select pnts
cat|heights
1|130.2686462402
2|124.2121124268
3|105.6689529419
4|120.3233795166
...

AH, I got it: you are using GRASS 6 while reading the GRASS 7 manual..
the parameter name
changed! So please read here instead for GRASS 6:

http://grass.osgeo.org/grass64/manuals/html64_user/v.what.rast.html

Hope this helps,
Markus
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

leonidas | 8 Feb 22:10
Picon
Favicon

How to rescale an aspect map

I need to rescale an aspect map in a scale 0-255 where North = 0 and SE=255.
Finally I need to assign weights as follow:
0.02	N
0.02	NE
0.12	E
0.34	SE
0.20	S
0.18	SW
0.08	W
0.03	NW

Thank you!

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-rescale-an-aspect-map-tp4377272p4377272.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Picon
Gravatar

Problems to launch GRASS 7.0.svn

Hi all,

I can't launch GRASS 7.0.svn on a MacOSX 10.6.8.

Many thanks in advance,

Jose Guerrero

This is the error message:
torre-b-024:~ joseca_IMac$ '/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/grass.sh'; exit
Rebuilding Addon HTML manual pages index...
Rebuilding Addon menu...
Python 2.6.1 found.

WELCOME TO GRASS 7.0.svn

   1) Have at your side all available GRASS tutorials

   2) When working on your location, the following materials
      are extremely useful:
      - A topo map of your area
      - Current catalog of available computer maps

   3) Check the GRASS webpages for feedback mailinglists and more:

Hit RETURN to continue
Starting GRASS GIS...
Traceback (most recent call last):
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/gui/wxpython/gis_set.py", line 885, in <module>
    GRASSStartUp = StartUp(0)
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/python/wx/_core.py", line 7981, in __init__
    self._BootstrapApp()
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/python/wx/_core.py", line 7555, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/gui/wxpython/gis_set.py", line 860, in OnInit
    StartUp = GRASSStartup()
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/gui/wxpython/gis_set.py", line 55, in __init__
    self.grassrc  = self._readGisRC()
  File "/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/etc/gui/wxpython/gis_set.py", line 370, in _readGisRC
    grassrc[key.strip()] = DecodeString(val.strip())
  File "/Users/Shared/grass_dev/grass70_dev/dist.i386-apple-darwin10.8.0/etc/gui/wxpython/core/gcmd.py", line 71, in DecodeString
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 459, in getdefault locale return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 391, in _parse_localename raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
Error in GUI startup. If necessary, please report this error to the GRASS developers.
Switching to text mode now.

Hit RETURN to continue...


--
################################################################
Dr. José Carlos Guerrero
Laboratorio de Desarrollo Sustentable y Gestión Ambiental del Territorio (LDSGAT)
Instituto de Ecología y Ciencias Ambientales (IECA)
Facultad de Ciencias
Universidad de la República
Montevideo-URUGUAY
################################################################

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Johannes Radinger | 8 Feb 10:35
Picon
Picon

v.to.rast in a python loop, error

Hi,

I try to run v.to.rast of a line in a loop
to get a raster for each attribute of the vector (multiple columns).
Therefore I created a short python script, which is working
expept for that I am getting error messages:
ERROR: option <output>: <raster_attribute> exists.

Here I'd like to post the script which I tried on the North Carolina Dataset (streams vector) on GRASS
6.5SVN49268M (on Mac OSX with Python 2.6.6) with the same errors.

Can you also reproduce this? Maybe somebody knows what is causing this? Probably there is something wrong
with my script as I am just in the beginning of writing python scripts... I am wondering as the command
v.to.rast with the interactive menu works perfectly (no errors.)

Here the code:

#!/usr/bin/env python

import sys

import grass.script as grass
import grass.script.setup as gsetup

def main():

    for i in ['FULL_HYDRO','LENGTH']:

        grass.run_command("v.to.rast",
                    input = "streams <at> PERMANENT",
                    output = "rast_"+i,
                    type = "line",
                    use = "attr",
                    column = i)

    return 0

if __name__ == "__main__":
    sys.exit(main())

Best regards,
Johannes

--

-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://www.gmx.net/de/go/freephone/
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

ellsamie | 8 Feb 01:34
Picon
Gravatar

Import dgn with v.in.ogr

I am a new user to GRASS, so please forgive my stupid question. I tried to
import a dgn in V8 XM version into GRASS but the software failed to open the
source data. I confirmed with the location of my dgn and don't know what is
happening. Thanks~~~

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Import-dgn-with-v-in-ogr-tp4374534p4374534.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Patrick Proffitt | 7 Feb 18:24
Picon
Gravatar

G_calloc error using r.in.xyz

I'm using r.in.xyz on a simple xyz point cloud.  I'm operating on 64 bit Windows 7 with 4 GB RAM and 1.7GHz i5 processor.  I am running GRASS 6.4 from the MSYS command line and I am using this tutorial as a templete.

My data is simple xyz from a comma seperated text file.  I can import this txt file and use GRASS to convert it to .las format, I have set g.region and now I am working to import with r.in.xyz.  The las2txt portion is working and I can see a comma delineated text file as output.  When I attempt to run it with r.in.xyz using the following command

r.in.xyz in=FILENAME.txt fs=, out=FILENAME_RAST

I receive the error

ERROR:  G_calloc: unable to allocate 1253898072 * 4 bytes at main.c:431

Looking up documentation I thought implementing the percent option as follows would help the problem

r.in.xyz in=FILENAME.txt fs=, percent =50 out=FILENAME_RAST

However using percentage values all the way down to 1 I received the same error, however the number multiplied by 4 bytes decreased to 78563304

Has anyone else encountered this error?  Is it a command line error or insufficient processor capability?


Thanks!

Patrick

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Eric Momsen | 7 Feb 17:13
Picon
Gravatar

g.extension - ERROR: G_getenv(): Variable LOCATION_NAME not set

Not sure if I should be sending this to the mail list or reporting it
as a bug?  Seems I am doing everything right, but I still have a lot
to learn.  I hope I am missing something easy???

I want to add some extensions for all users on a shared virtual
machine (Gnome, Debian, GRASS 6.4.2RC3 (2012) ).  I have run gksudo
'grass64 -gui' and used the GUI for g.extension to install an
extension system wide.  Below is the error I received.  I checked the
environment settings, and the variable LOCATION_NAME is set.

I then tried the Download Source option -it did download the
i.landsat.toar file, but neither of the listed commands in the output
would work. (The second set of output for this attempt.)

If there isn't a quick answer, would it be easier to just run from
source with GRASS 7?  We are currently all logging into the same
virtual machine, so the admin efficiency of being able to deploy a
package isn't a big issue.

Any suggestions?  Thanks,
Eric

{{{
(Mon Feb  6 15:32:52 2012)
g.extension.py extension=i.landsat.toar
svnurl=http://svn.osgeo.org/grass/grass-addons/grass6
Fetching <i.landsat.toar> from GRASS-Addons SVN (be patient)...
Compiling...
/usr/local/grass-6.4.2RC3/include/Make/Module.make:25:
warning: overriding commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Module.make:25:
warning: overriding commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Module.make:25:
warning: overriding commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'

ERROR: G_getenv(): Variable LOCATION_NAME not set

/usr/local/grass-6.4.2RC3/include/Make/Module.make:25:
warning: overriding commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Module.make:25:
warning: overriding commands for target `install'
/usr/local/grass-6.4.2RC3/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
make[2]: *** [/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/g
isdev/1894.0/i.landsat.toar/man/man1/i.landsat.toar.1] Error
127
make[1]: *** [mancmd] Error 2
make: *** [cmd] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.
(Mon Feb  6 15:32:55 2012) Command finished (2 sec)
(Mon Feb  6 15:33:20 2012)

g.gisenv -n
GISDBASE=/home/emomsen/GRASSDATA
LOCATION_NAME=gksudoLoc
MAPSET=gkMap
GRASS_GUI=wxpython
(Mon Feb  6 15:33:20 2012) Command finished (0 sec)
}}}

{{{
emomsen <at> gisdev:~$ sudo make MODULE_TOPDIR=/usr/local/grass-6.4.2RC3
ARCH_DISTDIR=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar
INST_DIR=/root/.grass6/addons install
[sudo] password for emomsen:
make: *** No rule to make target `install'.  Stop.

emomsen <at> gisdev:~$ cd GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0
emomsen <at> gisdev:~/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0$ ls
i.landsat.toar

emomsen <at> gisdev:~/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0$ sudo
make MODULE_TOPDIR=/usr/local/grass-6.4.2RC3
BIN=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar/bin
HTMLDIR=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar/docs/html
MANDIR=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar/man/man1
SCRIPTDIR=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar/scripts
ETC=/home/emomsen/GRASSDATA/gksudoLoc/gkMap/.tmp/gisdev/10530.0/i.landsat.toar/etc/i.landsat.toar
make: *** No targets specified and no makefile found.  Stop.
}}}
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

ALT SHN | 7 Feb 14:39

Cost Path

Hello list,

I have a raster obtained through r.mapcalc whose cells values represent friction or cost.
To finish my study I'm lacking one final step - calculate the least cost path!

How do I do it? I've tried r.cost but the result is not wat I expected - My desired output is just a line from A to B, crossing the least valued cells.
 
Thanks in advance,

Cheers,

André Mano
--
---------------------------------------------------------------
Associação Leonel Trindade
SOCIEDADE DE HISTÓRIA NATURAL

Apartado 25 2564-909 Torres Vedras Portugal
Sede e Biblioteca: rua Cavaleiros da Espora Dourada, 27A 2560 Torres Vedras

Laboratório de Paleontologia e Paleoecologia: Polígono Industrial do Alto do Ameal 2565-641 Ramalhal
http://alt-shn.blogspot.com
www.alt-shn.org

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Gmane