Re: [GRASS-user] how to make a grid with my DEM

2012-02-12 Thread Hamish
Janet wrote:
 Hi all,i want to simply divide my DEM into 30m grid cells - does anyone
 know how to do this?

have a look at the r.resamp.stats module.


a more complicated way is with v.mkgrid and v.rast.stats.


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


Re: [GRASS-user] how to make a grid with my DEM

2012-02-12 Thread Nick Jachowski
Hi Janet,
Do you mean you want to create contour lines at 30m intervals? If so,
r.contour would do the trick.
Best,
Nick

On Sat, Feb 11, 2012 at 1:56 AM, Janet Choate jsc@gmail.com wrote:

 Hi all,
 i want to simply divide my DEM into 30m grid cells - does anyone know how
 to do this?
 i have previously used r.clump on a 30m DEM to create unique spatial units.
 however, since r.clump finds all areas of contiguous cell category values
 and groups them to form physically discrete areas, i end up with some
 spatial areas that may be larger than 30m.
 any help is very much appreciated!
 thank you,
 Janet






 ___
 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] How to link or combine adjacent vector lines

2012-02-12 Thread Markus Metz
On Sat, Feb 11, 2012 at 7:49 PM, Stefan Luedtke slued...@gfz-potsdam.de wrote:
 Sorry for the delay... and thanks for the fast answer.

 Adding a column and then running a command in the sense of v.dissolve is
 not an option because there are just to many. I was thinking of a way that
 combines two lines into one if they share the same node. For the example
 mentioned the last time, this means, keeping the line as a single one until
 the tributary merges the main river. The main river might consist of more
 than one line, but a short tributary should not.

Maybe v.build.polylines is what you are looking for. If there are
attributes associated with the lines, the cats option should probably
be set to first or multi.

HTH,

Markus M


 I hope I dont miss anything obvious  ;-)

 Cheers,

 Stefan


 On Fri, 2012-02-10 at 17:04 +0200, Micha Silver wrote:

 On 02/09/2012 11:59 PM, sluedtke wrote:

 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.


 You might be interested in this thread from a year ago.
 http://osgeo-org.1560.n6.nabble.com/snap-point-to-line-break-line-at-given-points-tp3887413p3887413.html

 The short story is that GRASS builds topology when importing a line vector.
 So each intersection of two lines (i.e. a tributary that branches off the
 main channel) will be made into a separate line. You can force GRASS to
 ignore topology, but you probably don't want to.  And a correct river
 network does indeed keep each stream reach as a separate line. (Then you can
 use the various river network modules r.stream.*). So maybe your original
 shapefile is not bad...

 What you can do it add an additional column to the vector attrib table and
 indicate, in that column, which tributary each segment belongs to.  THen you
 can select, display, label, calculate, etc based on this tributary
 attribute column. Would that help?


 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@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

 This mail was received via Mail-SeCure System.





 --
 Micha Silver
 GIS Consultant, Arava Development Co.
 http://www.surfaces.co.il


 ___
 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] How to link or combine adjacent vector lines

2012-02-12 Thread Stefan Luedtke


Thanks for the  detailed answer, but, my problem is much more trivial. 

I attached a screenshot to make myself more clear.

/* The numbers refer to the categories of each line segment */

the tributary with cat 69 is fine, but the man channel consists of
multiple lines, and, in fact, a lot of tributaries look similar. As I
mentioned before, adding an additional column (to run kind of
v.dissolve) is not really feasible because I have around  600 cat
values. 

The task would be, to tell GRASS, to combine all lines of the main
channel, for this example. But I think that is quite ambitious- like
Micha wrote in his post. 





On Sat, 2012-02-11 at 15:19 -0800, Hamish wrote 

 sluedtke wrote:
  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. 
 
 so you have a vector line map of a braided river (be it a real one or the
 product of a computer surface water flow program which creates artifacts)
 and you wish to generalize it into an idealized schematic vector network.
 An interesting challenge.
 
 I think the first step is to run v.buffer with a buffer distance greater
 than half the maximum width of the parallel braids. The next step is the
 reduction back to a center line, like r.thin but for vector areas. Often
 you could do v.to.rast - r.thin - r.to.vect, but that doesn't work well
 for rivers as they are usually long and thin: in order to fit the entire
 length of the river into the raster array you need to make the cell res
 very coarse compared to the width of the river.
 
 so it becomes the classic river mile / river centerline problem, and
 if you have a good solution to that (especially for cases when there are
 shoals and islands in the middle of the river and you don't have full
 riverbed bathymetry to find the thalweg) I'd be very interested to hear
 about it.
 
 the best I ever managed was v.to.rast at very high cell resolution then
 r.cost to find distance from the riverbank, then r.param.scale feature
 map to extract the ridgelines, then r.thin, and r.to.vect.
 (instead of r.param.scale you could also use r.slope.aspect and look for
 places where the slope of the cost-to-shore map is less than some small
 threshold)
 
 another idea is to make the crappy lo-res river centerline with r.thin,
 then use v.lrs or v.transects(addons) to make step points, then run a
 moving window along the river buffer area at high raster res, using one
 of the g.region temporary zoom addon modules (g.region.point is one).
 Then patch all the new vector segments together and run v.generalize to
 smooth the result. I'm pretty confident that would work reasonably well,
 but it wouldn't be very efficient.
 
 It would be much more efficient to have a geometric solution than one
 that needs rasterization, maybe something like filling the vector buffer
 area with lots of little circles of varying sizes, merging as many of them
 as possible, then extracting the center coord of each surviving big circle.
 
 as I said earlier, it's an interesting problem..
 
 
 Hamish
attachment: river_network_subset.png___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to link or combine adjacent vector lines

2012-02-12 Thread Hamish
Stefan wrote:
 Thanks for the  detailed answer, but, my problem is much more trivial.
 I attached a screenshot to make myself more clear.
 /* The numbers refer to the categories of each line segment */
 the tributary with cat 69 is fine, but the man channel consists of
 multiple lines, and, in fact, a lot of tributaries look similar.
...
 The task would be, to tell GRASS, to combine all lines of the main
 channel, for this example.

ok. do they overlap or join end-to-end?

if they join, try Markus M's suggestion of v.build.polylines.
if they overlap, try 'v.clean tool=rmdupl'


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


Re: [GRASS-user] two questions: snap and close lines

2012-02-12 Thread Paolo Cavallini
Sample location here:
http://int.faunalia.it/~paolo/test.tar.gz
Confirmed by other users.
Thanks.

Il 27/01/2012 18:53, Markus Metz ha scritto:

 The only two options I can think of is giving v.edit a try, otherwise
 hand-editing.

Urgh! Too bad, thanks anyway.

 Why does breaking not work? Maybe you need remove duplicates and clean
 small angles at nodes. You could try
 v.clean input=patched@paolo type=line tool=snap,break,rmdupl,rmsa
 thresh=1,0,0,0 output=patched_1

I'm not quite sure break do not work: new nodes are there, but in subsequent 
steps
they are not treated as closed polygons.

Thanks.
-- 
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] error in example

2012-02-12 Thread Markus Neteler
On Fri, Feb 10, 2012 at 7:23 PM, Paolo Cavallini cavall...@faunalia.it wrote:
 Hi all.
 I'm following the examples in:
 http://casoilresource.lawr.ucdavis.edu/drupal/node/438
 but I get an error in:
 new_data - SpatialGridDataFrame(grd, data=data.frame(k=rep(1,G$cols*G$rows)),
 proj4string=CRS(x@proj4string@projargs))

 Error in validityMethod(object) :
  unequal number of objects in full grid and data slot

 Any hint?
 Thanks a lot.

 BTW: the link to sample data should be changed to
 http://mirrors.ibiblio.org/grass/sampledata/spearfish_grass60data-0.3.tar.gz

Perhaps Dylan (author, in CC) has an idea?

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


Re: [GRASS-user] How to link or combine adjacent vector lines

2012-02-12 Thread Stefan Luedtke
That did the trick, almost.

They join each other -so v.build polylines ... worked, but, the table is
exactly the same as it was before. The command output said, that the
number of lines was reduced to almost 50%. Furthermore, if I check the
cat number next to the lines (via d.vect) it looks fine for both
methods, first and multi. But the table does not show any diffs and
holds the same number of entries like the original one. I could not find
anything about that in the manual. 

Anyway, thanks for hints, that helped a lot. 

Stefan

On Sun, 2012-02-12 at 10:56 -0800, Hamish wrote: 

 Stefan wrote:
  Thanks for the  detailed answer, but, my problem is much more trivial.
  I attached a screenshot to make myself more clear.
  /* The numbers refer to the categories of each line segment */
  the tributary with cat 69 is fine, but the man channel consists of
  multiple lines, and, in fact, a lot of tributaries look similar.
 ...
  The task would be, to tell GRASS, to combine all lines of the main
  channel, for this example.
 
 ok. do they overlap or join end-to-end?
 
 if they join, try Markus M's suggestion of v.build.polylines.
 if they overlap, try 'v.clean tool=rmdupl'
 
 
 Hamish
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Loosing color table when reprojecting raster file

2012-02-12 Thread Kurt Springs
Hi folks,

I was preparing a some maps for a presentation and ran into a snag. I am trying 
to reproject raster maps from a Lat/Long to Irish national grid.  I've done 
this before.  This time I found that I had no color.  I am using William 
Kyngesburye's GRASS 6.4.1-5.  I also tried Michael Bartons GRASS 7 SVN. There 
are tiles already in the Project location that I reprojected before.  They 
still have their color.  It's just that these latest attempts seemed be be 
stripped of their color and I can just use r.color to put it back.  That 
doesn't seem to work either.

Any ideas as to what the problem might be?

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


[GRASS-user] Re: How to rescale an aspect map

2012-02-12 Thread leonidas
I need the most suitable areas (with SE aspect) to have the value of 255 and
the unsuitable (North aspect) to have the value of 0. Grass returns N=90 and
SE=315 and flat=0.
So the minimum value of aspect raster is flat areas and the max is areas
with 359 degrees of east.
I should set North as the minimum value and SE as the max value (most
suitable areas).
I should rescale the raster because I need to include it in an AHP method.
All rasters will be rescaled in a common 0-255 scale. 


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