[GRASS-user] grasswiki: user account request disabled

2016-06-29 Thread Martin Landa
Hi,

FYI, due to massive spam attacks today I have temporary disabled
requesting for new accounts on our mediawiki. Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] area calculation after dissolve

2016-06-29 Thread Moritz Lennert

On 29/06/16 16:33, Uwe Fischer wrote:

I have a polygon dataset which needs to be dissolved by a certain item.
That works fine. But when I calculate the area size for the new created
Polygons in the next step using v.to.db, I find that the system
summarizes all the polygons with the same value in the dissolve item,
even if they are remote from each other (I mean, they do not touch).
That might be correct if I want to handle them like a multipart feature,
but those are not present in GRASS as far as I know. What I need is the
area for each single polygon after removing the inside borders, no
matter what value the polygon has. How to calculate that?

I found that polygons with the same dissolve item also have the same cat
number, which might be the reason for the common area size. But I don't
know how to clear that without losing the connection to the database
table containing the dissolve item.


You could use v.category to assign individual cat values to each polygon 
on a different layer (e.g. layer=2), add a table to layer 2 using 
v.db.addtable and then v.to.db layer=2 to fill that table.


That way you will have one layer with the original (grouped) cat values 
and the related attributes and a second layer with the new (individual) 
cat values and the related attributes. If you need to combine the two 
into one table, you could add into the layer 2 table a column for the 
cat in layer 1 and fill that using, e.g. v.distance:


v.distance from=MyPolygons from_layer=2 to=MyPolygons to_layer=1 up=cat 
col=cat_lay1


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

[GRASS-user] area calculation after dissolve

2016-06-29 Thread Uwe Fischer
I have a polygon dataset which needs to be dissolved by a certain item. That
works fine. But when I calculate the area size for the new created Polygons
in the next step using v.to.db, I find that the system summarizes all the
polygons with the same value in the dissolve item, even if they are remote
from each other (I mean, they do not touch). That might be correct if I want
to handle them like a multipart feature, but those are not present in GRASS
as far as I know. What I need is the area for each single polygon after
removing the inside borders, no matter what value the polygon has. How to
calculate that?

I found that polygons with the same dissolve item also have the same cat
number, which might be the reason for the common area size. But I don't know
how to clear that without losing the connection to the database table
containing the dissolve item.

 

Best regards,

 

Uwe

 

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

Re: [GRASS-user] problem with PIL

2016-06-29 Thread Anna Petrášová
On Wed, Jun 29, 2016 at 7:39 AM, Carmine Massarelli
 wrote:
> dear,
> I needed to add   from PIL import Image   in the
> /usr/local/lib/python2.7/dist-packages/PIL/Image.py   file to be able to see
> the decorators in grass-7.0.4, it was not necessary in grass 6.4.
> Have I a problem or misconfiguration in my pillow or PIL?

The imports of PIL changed in grass because of Pillow, but I haven't
heard about any problems because of that. I am not sure what's going
on in your case, but first thing would be to understand if you use PIL
or Pillow. If PIL, use Pillow instead.

Anna

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

Re: [GRASS-user] Best workflow

2016-06-29 Thread patrick s.

Paul, a short comment.

Depending on the information you need to process it might be enough to match 
the rasterdata to the centroid of the polyons, which is not having issues of 
overlaps with multiple tiles.

Regards,
Patrick

--
Message: 1
Date: Fri, 24 Jun 2016 11:34:47 +0200
From: Paul Meems
To: GRASS user list
Subject: Re: [GRASS-user] Best workflow
Message-ID:

Content-Type: text/plain; charset="utf-8"

Thanks Stefan,

I didn't thought of gdalbuildvrt. I'll try that option.
The polygons do not overlap and I'm not sure about the height data. Perhaps
they overlap a bit.

What I need to do in GRASS is:

   - call r.slope.aspect to calculate the slope and aspect. I had planned
   doing this for every polygon but when I'm going to use gdalbuildvrt I can
   do it for the whole dataset in one time.
   Is that a good choice? The height data spans The Netherlands and has
   0.5m resolution. Can GRASS handle such a big dataset?
   - Next command is r.mapcalc. This can be done on a subset or on the
   whole dataset at once.
   - Then I need to call r.to.vect. I think it is best to do this for a
   subset because I only need the part within the polygon. I think I can set
   the region to the polygon and then call r.to.vect to speed this up, right?
   - Then I need to clip with the border and export this vector dataset to
   PostGIS.

With the above workflow I don't think I need to convert the polygons to
raster first, right?
I'm readinghttps://grasswiki.osgeo.org/wiki/PostGIS  and I'm using GRASS v7
so if I understand it correctly I can link a PostGIS table using v.external
Can I then loop through each feature and perform the above workflow and
also update a field in PostGIS called something like 'processed' and set it
to True?
And am I right I can do this all using Python? I'm running Ubuntu server so
no GUI available.

Thanks

Paul

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

[GRASS-user] problem with PIL

2016-06-29 Thread Carmine Massarelli

dear,
I needed to add /from PIL import Image/ in the 
//usr/local/lib/python2.7/dist-packages/PIL/Image.py /file to be able to 
see the decorators in grass-7.0.4, it was not necessary in grass 6.4.

Have I a problem or misconfiguration in my pillow or PIL?
thanks

carmine



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

[GRASS-user] Updating v.net-report results directly to attribute table

2016-06-29 Thread Johannes Radinger
Hi all,

is there an easy way to transfer the information reported by v.net
(operation=report)
directly to the attribute table of the vector network (arc-table)?

The approach I am using so far is to create an temporary database table
(using python)
where I store the output from v.net operation=report, and then use a SQL
statement to update the original arc-table from the temporary table:

###
fidimo_db.execute('''CREATE TEMP TABLE arcs_temp
(cat INTEGER, from INTEGER, to INTEGER)''')

# Get for each arc the orig cat for the start (from) and end point (to)
e = [(int(x.split()[0]),int(x.split()[1]),int(x.split()[2])) for x in
grass.read_command("v.net",
quiet=True,
input="my_net",
operation="report",
arc_layer=3).splitlines()]
my_db.executemany("INSERT INTO arcs_tmp (cat, from, to) VALUES (?,?,?)", e)

my_db.execute('''UPDATE arcs SET
from = (SELECT from FROM arcs_tmp WHERE cat=arcs.cat),
to = (SELECT to FROM arcs_tmp WHERE cat=arcs.cat)
WHERE EXISTS (SELECT cat FROM arcs_tmp WHERE cat=arcs.cat)''')
##

That approach works for me, but I was wondering if there is something
easier/more direct? However it seems a direct update of the attribute table
is not included in v.net. The module v.db.update has an option for adding
start/end points of lines, however this refers to coordinate pairs rather
than to category values of nodes in a network.

Any other ideas?

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