Re: [GRASS-user] zonal statistics for multiple areas

2018-10-31 Thread Micha Silver
On 10/31/18 11:59 AM, Alessandro Sebastiani wrote: Dear all, i was able to compute zonal statistics for multiple areas using this script. I used > import grass.script as gscript > v_list = gscript.read_command("g.list" , type = "vect").strip().split("\n") # i have 5 vectors in my list >

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Markus Metz
Hi Frank, On Wed, Oct 31, 2018 at 1:39 PM Frank David wrote: > > Hello Vero, > > Thanks for your reply. It took almost one hour to extract my area (I guess because of topology). I do the same with Qgis from a shape in less than 10 minutes (but with several operations)... it's may be a bad idea

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Rich Shepard
On Wed, 31 Oct 2018, Moritz Lennert wrote: try psql -h 127.0.0.1 willamette-river-hg Does this work ? Moritz, I've uncovered a postgres glitch: it's looking for libpq.so.5 in a postgresql/10.2/ rather than in the 10.3/ directory. I'm looking for the the wrong pointer now. Will fix that

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Moritz Lennert
On 31/10/18 16:49, Rich Shepard wrote: On Wed, 31 Oct 2018, Moritz Lennert wrote: This sounds like Stefan might be on the right path: are you sure your Postgresql server accepts connections from the network ? What is 'listen_addresses' set to in your postgresql.conf ? And is password

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Rich Shepard
On Wed, 31 Oct 2018, Moritz Lennert wrote: This sounds like Stefan might be on the right path: are you sure your Postgresql server accepts connections from the network ? What is 'listen_addresses' set to in your postgresql.conf ? And is password authentication enabled in pg_hba.conf ? Moritz,

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Moritz Lennert
On 31/10/18 15:56, Rich Shepard wrote: On Wed, 31 Oct 2018, Moritz Lennert wrote: You database seems to be called 'willamette-river-hg', i.e. all hyphens, whereas you are trying to db.copy to 'willamette_river_hg', i.e. one hyphen, one underscore. Moritz, Thank you. I use hyphens in

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread st_kiefer
The reason I ask is because you have to configure authentication and enable remote access to connect to the database from an application. For me I had to do that to use PG with GRASS. psql connects via trusted connection because user postgres connects to the DB from local machine. Postgres

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Rich Shepard
On Wed, 31 Oct 2018, st_kie...@web.de wrote: is it possible to connect to the DB with PGAdmin? Stefan, I don't run pgadmin. The database is on this host, a server/workstation desktop. The postgres shell has no problems connecting to any database (they're all owned by me). For example:

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Rich Shepard
On Wed, 31 Oct 2018, Moritz Lennert wrote: You database seems to be called 'willamette-river-hg', i.e. all hyphens, whereas you are trying to db.copy to 'willamette_river_hg', i.e. one hyphen, one underscore. Moritz, Thank you. I use hyphens in multi-word file names while applications such

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread st_kiefer
Hi, is it possible to connect to the DB with PGAdmin? Resp. is remote access enabled? see https://blog.bigbinary.com/2016/01/23/configure-postgresql-to-allow-remote-connection.html https://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html Regards. Stefan > Rich Shepard hat am 31.

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Moritz Lennert
On 30/10/18 22:37, Rich Shepard wrote: On Tue, 30 Oct 2018, Rich Shepard wrote: I was thinking of working within grass rather than at the bash prompt. You're right: I know the difference between double and single quotes but blew it on this instance. I'm still missing something. From

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Frank David
Hi Stefan, Thank you. I did not know. That's great. Cheers, Frank Le 31/10/2018 à 13:53, Stefan Blumentrath a écrit : Hei Frank, Did you try the “spatial” option in v.in.ogr (or the r-flag) (if your data is in a shape-file to start with):

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Rich Shepard
On Wed, 31 Oct 2018, Markus Metz wrote: try to set host and port with db.login. Username and password are not required if a ~/.pgpass file exists. See the manual of db.login, following the link to PostgreSQL that describes the GRASS PG driver. Markus M, Here ~/.pgpass contains host, port,

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Stefan Blumentrath
Hei Frank, Did you try the “spatial” option in v.in.ogr (or the r-flag) (if your data is in a shape-file to start with): https://grass.osgeo.org/grass74/manuals/v.in.ogr.html ? And is v.clip slower than v.overlay (that could be used as well)? Cheers Stefan From: grass-user On Behalf Of Frank

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Frank David
Hello Vero, Thanks for your reply. It took almost one hour to extract my area (I guess because of topology). I do the same with Qgis from a shape in less than 10 minutes (but with several operations)... it's may be a bad idea to have a so heavy vector map in Grass... Cheers, Frank Le

Re: [GRASS-user] Question about .ply file with a trailing white space at the end

2018-10-31 Thread Moritz Lennert
Dear ? May I encourage you to send such questions to the mailing list, and not as private mail to the developers. On 31/10/18 11:43, ifmendo...@gmail.com wrote: Dear Moritz I having the same problem you solved here

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Frank David
Hi Jon, Thanks for your reply. It's very interesting to make a python script, even if the input data doe not come from grass database as I would like. Cheers, Frank Le 31/10/2018 à 12:35, Jón Eiríksson a écrit : The following partial script may be helpful (having the source map in shape

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Jón Eiríksson
The following partial script may be helpful (having the source map in shape format): assume folder in home directory containing source map - in this case contours.shp v_w,v_s,v_e,v_n are string variables with destination region the commands create a subset defined by the destination region:

[GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Frank David
Hello, What is the best and fast way to make a copy of a part of vector map (national) to get a smaller territory ? (partial copy). Thank you for your advice ! Frank ___ grass-user mailing list grass-user@lists.osgeo.org

Re: [GRASS-user] zonal statistics for multiple areas

2018-10-31 Thread Alessandro Sebastiani
Dear all, i was able to compute zonal statistics for multiple areas using this script. I used > import grass.script as gscript > v_list = gscript.read_command("g.list" , type = "vect").strip().split("\n") # i have 5 vectors in my list > method = ("sum" , "average") > for v in v_list: >

Re: [GRASS-user] v.patch and keeping the attributes

2018-10-31 Thread Mira Kattwinkel
Sounds good and precise to me. Mira On 30/10/2018 21:34, Markus Metz wrote: On Tue, Oct 30, 2018 at 9:13 PM Markus Neteler > wrote: > > On Tue, Oct 30, 2018 at 5:36 PM Markus Neteler > wrote: > > On Tue, Oct 30, 2018 at 10:26 AM Mira

Re: [GRASS-user] Migrating to new RDBMS

2018-10-31 Thread Markus Metz
On Tue, Oct 30, 2018 at 10:54 PM Rich Shepard wrote: > > On Tue, 30 Oct 2018, Markus Metz wrote: > > > db.connect only sets the default database, it does not test if it exists > > or is accessible. For PG, you need to use db.login first in order to > > actually use the PG database. > > Markus M,