Re: [GRASS-user] DTM with contour lines and points

2012-04-20 Thread Paolo Cavallini
Il 20/04/2012 00:51, Pedro Venâncio ha scritto:

 I thought a way to get around, which is to convert the contours to equally 
 spaced points and join these points whith the elevation points layer. Is 
 there a more correct and straightforward way to do?
your real data are vertices anyway, so I think extracting them and
patching them with points is the straightforward way.
All the best.

-- 
Paolo Cavallini
See: http://www.faunalia.it/pc

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


Re: [GRASS-user] r.stream.extract: map mis-match error

2012-04-20 Thread Markus Metz
On Thu, Apr 19, 2012 at 10:57 PM, Rich Shepard rshep...@appl-ecosys.com wrote:
  On one project the r.stream.extract error, Accumulation map does not
 match elevation map!, was caused by a mask on the elevation map. With this
 project the mask was removed, and no longer limits the DEM region.

It is perfectly ok to set the region to a subregion of the DEM and to
set a MASK. These settings should not be modified, however. As long as
r.watershed and r.stream.extract are used on the same region settings
and the same MASK, the map mismatch error should not happen. Just in
case, masking should be done by creating a MASK, not by modifying the
elevation values.


  I started over to ensure the elevation map was not masked. Because of the
 large size, I used the NHD basin map's region to set the analytical region:

        g.region vect=basins align=dem_proj

 Then changed resolution from 1 US Foot (0.305m) to 10m (30 US Feet).

In your last posts you were using a resolution of 30m?

  This is the same region and elevation map used in the process leading to
 application of the r.stream.extract module, the accumulation map was
 generated by r.watershed, and r.stream.extract has no problem running with
 the unweighted accumulation map. Therefore, I assume the error arose in the
 calculation of weight or applying that weight to the unweighted accumulation
 map.

But in your last posts, applying the weight worked fine (map1.pdf,
map2.pdf, map3.pdf)? The weighed accumulation map seemed to produce
the best results. BTW, the vector output of r.stream.extract would
have been easier to see on the screenshots.


  If this assumption is correct, where do I look to find how to resolve the
 problem?

Try to set the region and MASK before the analysis, then don't modify
these settings during the analysis. Something like

g.region vect=basins align=dem_proj
g.region res=10m -a
r.resamp.stats in=dem_proj out=dem_10m method=average -w
v.to.rast in=basins out=MASK type=area use=val val=1
r.watershed elevation=dem_10m acc=dem_10m.acc basin=dem_10m.basin
threshold=15
r.mapcalc dem_10m.acc.w = dem_10m.acc * weight
r.stream.extract elevation=dem_10m acc=dem_10m.acc.w
stream_rast=dem_10m.streams stream_vect=dem_10m_streams threshold=???

You may need to try different values for threshold with
r.stream.extract in order to get the desired detail.

HTH,

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


[GRASS-user] Re: internal buffer of polygon

2012-04-20 Thread Patrick S.
Another workaround. Don't know if that helps and never tried it out, but 
my approach for inner offset would be a decomposition of the polygons:


v.type in=poly out=poly_as_line type=boundary,line
v.parallel
v.clean tool=break
v.type type=line,boundary
v.centroids
v.build

If you can not define the side-paramter of v.parallel (is it always the 
same?), you might want to create parallels and polygons for both sides 
and remove the outer by querying if the original polygon lies inside, 
e.g. if the perimeter-lenth is longer than the original one


greetz, patrick

On Thu, Oct 29, 2009 at 4:59 PM, Milton Cezar Ribeiro 
miltinho.astrona...@gmail.com wrote:



  Hi Maning,

  Sometimes I have the same issue, but I don't solve this on vector.
  Just supose you have a map where 1 is your raster-based-polygon
  and NULL is outside of polygon. You can use r.mapcalc to
  invert it, in the maner that 1 come to be your non-polygon, and
  NULL your polygon. So you can run r.buffer with positive value
  and at the end may be you need to do some kind of crossing
  between original and output maps.
Bests.

  miltinho

  2009/10/29 maning sambaleemmanuel.samb...@gmail.com


  I tried using a negative values as
  buffer=-3000 in v.buffer but it doesn't give me internal buffer in a
  polygon layer.

  Any hints?

  --
  cheers,
  maning


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


[GRASS-user] GRASS module (python, gparser): Set a tick for flag by default

2012-04-20 Thread Johannes Radinger
Hi,

I am working on a python script which involves a g.parser module (to get the 
input mask for a module as for other modules in GRASS).

So far I know how a flag is produced in the beginning of the script.
E.g.:

#%Flag
#% key: f
#% description: My Flag of Interest
#%end

Is there any possibility to set the flag ticked by default? So like providing
an answer for options.

Best regards,

Johannes
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] GRASS module (python, gparser): Set a tick for flag by default

2012-04-20 Thread Glynn Clements

Johannes Radinger wrote:

 I am working on a python script which involves a g.parser module (to
 get the input mask for a module as for other modules in GRASS).
 
 So far I know how a flag is produced in the beginning of the script.
 E.g.:
 
 #%Flag
 #% key: f
 #% description: My Flag of Interest
 #%end
 
 Is there any possibility to set the flag ticked by default? So like providing
 an answer for options.

No. Unlike options, where the user can override a default by providing
an explicit value, there's no way to disable a flag which is enabled
by default, and no way to specify GUI behaviour distinct from
command-line behaviour, so flags always default to false.

The only option is to invert the sense of the flag, i.e. enable the
behaviour by default and provide a don't ... flag to disable the
behaviour.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] vector import issues v.in.ogr

2012-04-20 Thread Daniel Lee
Hi Pankaj,

What format are you exporting to? The vectors in india_basins_vector.png
look good.

Daniel

--

B.Sc. Daniel Lee
Geschäftsführung für Forschung und Entwicklung
ISIS - International Solar Information Solutions GbR
Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

Softwarecenter 3
35037 Marburg
Festnetz: +49 6421 379 6256
Mobil: +49 176 6127 7269
E-Mail: l...@isi-solutions.org
Web: http://www.isi-solutions.org




Am 20. April 2012 11:16 schrieb Pankaj Kr Sharma pks...@gmail.com:

 I am using latest grass v7 svn.

 Today, I created a vector map by patching some raster and converting it to
 vector.

 Thereafter, I exported it and then imported it back.

 However, in the imported vector, some polygons are missing.

 The centroid is visible, but the polygon is missing.

 What could be the reason.

 ___
 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] vector import issues v.in.ogr

2012-04-20 Thread Pankaj Kr Sharma
I created this vector by r.to.vect command.
Then, I ran v.out.ogr.
And, thereafter I tried v.in.ogr. Which resulted in erroneous vector.

On Fri, Apr 20, 2012 at 4:31 PM, Daniel Lee l...@isi-solutions.org wrote:

 Hi Pankaj,

 What format are you exporting to? The vectors in india_basins_vector.png
 look good.

 Daniel

 --

 B.Sc. Daniel Lee
 Geschäftsführung für Forschung und Entwicklung
 ISIS - International Solar Information Solutions GbR
 Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

 Softwarecenter 3
 35037 Marburg
 Festnetz: +49 6421 379 6256
 Mobil: +49 176 6127 7269
 E-Mail: l...@isi-solutions.org
 Web: http://www.isi-solutions.org




 Am 20. April 2012 11:16 schrieb Pankaj Kr Sharma pks...@gmail.com:

 I am using latest grass v7 svn.

 Today, I created a vector map by patching some raster and converting it
 to vector.

 Thereafter, I exported it and then imported it back.

 However, in the imported vector, some polygons are missing.

 The centroid is visible, but the polygon is missing.

 What could be the reason.

 ___
 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] GRASS module (python, gparser): Set a tick for flag by default

2012-04-20 Thread Johannes Radinger
Thank you.

Good to know that, so that I'll do a reverse of the meaning
of the flag as you mentioned (...don't...).

cheers,
Johannes

 Original-Nachricht 
 Datum: Fri, 20 Apr 2012 11:26:55 +0100
 Von: Glynn Clements gl...@gclements.plus.com
 An: Johannes Radinger jradin...@gmx.at
 CC: grass user list grass-user@lists.osgeo.org
 Betreff: Re: [GRASS-user] GRASS module (python,   gparser): Set a tick 
 for flag by default

 
 Johannes Radinger wrote:
 
  I am working on a python script which involves a g.parser module (to
  get the input mask for a module as for other modules in GRASS).
  
  So far I know how a flag is produced in the beginning of the script.
  E.g.:
  
  #%Flag
  #% key: f
  #% description: My Flag of Interest
  #%end
  
  Is there any possibility to set the flag ticked by default? So like
 providing
  an answer for options.
 
 No. Unlike options, where the user can override a default by providing
 an explicit value, there's no way to disable a flag which is enabled
 by default, and no way to specify GUI behaviour distinct from
 command-line behaviour, so flags always default to false.
 
 The only option is to invert the sense of the flag, i.e. enable the
 behaviour by default and provide a don't ... flag to disable the
 behaviour.
 
 -- 
 Glynn Clements gl...@gclements.plus.com
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract: map mis-match error

2012-04-20 Thread Rich Shepard

On Fri, 20 Apr 2012, Markus Metz wrote:


It is perfectly ok to set the region to a subregion of the DEM and to set
a MASK. These settings should not be modified, however. As long as
r.watershed and r.stream.extract are used on the same region settings and
the same MASK, the map mismatch error should not happen. Just in case,
masking should be done by creating a MASK, not by modifying the elevation
values.


Markus,

  For the current there is no mask and the region is set to the same
parameters before the model is run. That's why I cannot find the source of
the error.


In your last posts you were using a resolution of 30m?


  No. The location units are US Feet so g.region reports them as 30. That's
approximately 10m and I use the latter as a descriptor. The original DEM has
a cell size of 1 x 1 feet (0.305 x 0.305 m) and is much too large to process
on a system with 4G RAM.


But in your last posts, applying the weight worked fine (map1.pdf,
map2.pdf, map3.pdf)? The weighed accumulation map seemed to produce the
best results. BTW, the vector output of r.stream.extract would have been
easier to see on the screenshots.


  This is true. The problem was the residual mask that caused two
comparatively large areas to not be defined as basins by r.watershed. That's
shen I removed that map and started over with the full-size DEM rather than
the one 'clipped' to the vector basin boundaries. Now I get too many small
basins but the former white areas with null elevations do contain identified
basins.


Try to set the region and MASK before the analysis, then don't modify
these settings during the analysis. Something like

g.region vect=basins align=dem_proj
g.region res=10m -a
r.resamp.stats in=dem_proj out=dem_10m method=average -w
v.to.rast in=basins out=MASK type=area use=val val=1
r.watershed elevation=dem_10m acc=dem_10m.acc basin=dem_10m.basin
threshold=15
r.mapcalc dem_10m.acc.w = dem_10m.acc * weight
r.stream.extract elevation=dem_10m acc=dem_10m.acc.w
stream_rast=dem_10m.streams stream_vect=dem_10m_streams threshold=???


  This is different. I'll work on this today. The r.stream.extract,
r.stream.basins, r.stream.order, and r.basin modules are essential for the
two current big projects. So, I want to learn and better understand how to
use them to get meaningful results.


You may need to try different values for threshold with r.stream.extract
in order to get the desired detail.


  I've tried different thresholds for r.watershed but not -- yet -- for
r.stream.extract. I need to try the latter as well as looking at vector
output.


HTH,


  I'm sure it will.

Thank you very much,

Rich

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


Re: [GRASS-user] r.stream.extract: map mis-match error

2012-04-20 Thread Rich Shepard

On Fri, 20 Apr 2012, Markus Metz wrote:


g.region res=10m -a
r.resamp.stats in=dem_proj out=dem_10m method=average -w


  What is the reason to run r.resamp.stats if the region's resolution has
been changed to that cell size?

Thanks,

Rich

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


Re: [GRASS-user] r.stream.extract: map mis-match error

2012-04-20 Thread Rich Shepard

On Fri, 20 Apr 2012, Markus Metz wrote:


The resolution has been decreased, in this case several of the original
cells fall into one new cell. A reasonably accurate new value can be
obtained by using the average of all cells falling into a new cell. If on
the contrary resolution is changed from e.g. 30 to 10 feet (increased),
r.resamp.interp with bilinear or bicubic resampling would be a good
choice.


Markus.

  Thank you for clarifying. I wasn't thinking about what happens to cells
when the resolution is made more coarse so I did not see the necessity of
running r.resamp.stats. Now I do.

Rich

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


Re: [GRASS-user] r.stream.extract: map mis-match error

2012-04-20 Thread Rich Shepard

On Fri, 20 Apr 2012, Markus Metz wrote:


Try to set the region and MASK before the analysis, then don't modify
these settings during the analysis. Something like

g.region vect=basins align=dem_proj
g.region res=10m -a
r.resamp.stats in=dem_proj out=dem_10m method=average -w
v.to.rast in=basins out=MASK type=area use=val val=1
r.watershed elevation=dem_10m acc=dem_10m.acc basin=dem_10m.basin
threshold=15
r.mapcalc dem_10m.acc.w = dem_10m.acc * weight
r.stream.extract elevation=dem_10m acc=dem_10m.acc.w
stream_rast=dem_10m.streams stream_vect=dem_10m_streams threshold=???


  My only modifications to the above were to run r.param.scale after
r.watershed and r.mapcalc to calculate weight from the r.param.scale
tangential curve output maps before calling r.mapcalc to apply the weights.
Could these be problematic?

  The results are still

GRASS 6.5.svn :~/grassdata  r.stream.extract
elev=dem_10m acc=dem_10m.acc.w stream_rast=dem_10m.rstreams.w
stream_vect=dem_10m.vstreams.w thresh=1000 --o
Load input maps and get start points...
ERROR: Accumulation map does not match elevation map!

  I'm completely puzzled ... and a bit frustrated that the same error is
thrown so consistently.

Rich


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


Re: [GRASS-user] DTM with contour lines and points

2012-04-20 Thread Pedro Venâncio
Thank you Paolo!

Best regards!
Pedro




- Original Message -
From: Paolo Cavallini 

Il 20/04/2012 00:51, Pedro Venâncio ha scritto:

 I thought a way to get around, which is to convert the contours to equally 
 spaced points and join these points whith the elevation points layer. Is 
 there a more correct and straightforward way to do?
your real data are vertices anyway, so I think extracting them and
patching them with points is the straightforward way.
All the best.

-- 
Paolo Cavallini
See: http://www.faunalia.it/pc

___
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


[GRASS-user] v.triangle -- module to produce TIN with breaklines using Triangle utility

2012-04-20 Thread Alexander Muriy
Hi all.

I wrote a shell-script module v.triangle that is front-end for the
famous Triangle utility (http://www.cs.cmu.edu/~quake/triangle.html) of
J.R. Shewchuk. I'm planning to add it to GRASS-Addons wiki page :)

Triangle makes exact Delaunay triangulations, constrained Delaunay
triangulations, conforming Delaunay triangulations and high-quality
triangular meshes. On GIS terminology, it produces 2D TIN, optionally with
breaklines.

Link:  https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle


P.S. It generally works but centroids in final TIN have 0 heights. Now I
think about some hack to make the right centroids in all areas of TIN.

-
Comparison of the one resulting TIN with the TIN produced in ArcView 3D
Analyst see in linked PDF (
http://dl.dropbox.com/u/42016908/ArcView_GRASS_TIN_breaklines.pdf)
-
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.triangle -- module to produce TIN with breaklines using Triangle utility

2012-04-20 Thread Sylvain Maillard
Hi,

I'm not sure to understand the difference between your v.triangle and the
v.delaunay (
http://grass.osgeo.org/grass64/manuals/html64_user/v.delaunay.html) already
in grass core ... for what I see in your pdf exemple, it seems that your
new module is giving almost the same result as v.delaunay would do ...

can you explain the differences ? I like to learn new things in grass ;)


cheers,
Sylvain


2012/4/20 Alexander Muriy amu...@gmail.com

 Hi all.

 I wrote a shell-script module v.triangle that is front-end for the
 famous Triangle utility (http://www.cs.cmu.edu/~quake/triangle.html) of
 J.R. Shewchuk. I'm planning to add it to GRASS-Addons wiki page :)

 Triangle makes exact Delaunay triangulations, constrained Delaunay
 triangulations, conforming Delaunay triangulations and high-quality
 triangular meshes. On GIS terminology, it produces 2D TIN, optionally with
 breaklines.

 Link:  https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle


 P.S. It generally works but centroids in final TIN have 0 heights. Now I
 think about some hack to make the right centroids in all areas of TIN.

 -
 Comparison of the one resulting TIN with the TIN produced in ArcView 3D
 Analyst see in linked PDF (
 http://dl.dropbox.com/u/42016908/ArcView_GRASS_TIN_breaklines.pdf)
 -


 ___
 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