Re: [GRASS-user] accumulation map from directions map
Hello again, I am still searching a method to generate a flow accumulation map from a flow direction map. I got the direction map from an arcgis user. In arcgis the module FLOWACCUMULATION(FLOW_DIR) would do this, but I want to use an open source solution. If anyone could give me a hint, where I could find a tool like this (inside GRASS it does not seem to be possible), I would be very grateful. Best regards, Achim ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] computation in a location based on infos from another location
Hello, I have 2 locations, one with a lambert projection with a 1 km grid (comes from hydro1k), covering africa, and the other with a longitude latitude projection with a 0.5 decimal degrees grid (covering the world). I have a raster map on the lambert location that has values of 1 for a given area and 0 (or null) otherwise (corresponds with upstream basins) and I would like to compute the corresponding area covered on the lonlat grid. This would lead to a value for each cell in the lonlat grid corresponding with the fraction of the grid cell covered by 1 in the lambert map. So, for example, if the cell is completly in the area in the lambert map, the value in the lonlat map should be 1, and if half of the area of the cell from the lonlat map is covered by ones in the lambert map, the value in the lonlat map should be 0.5. If the two maps were in the same location, I could set the region to be the one of the lonlat map, and do r.resamp.stats -w input=lambert_map output=fraction_covered But r.resamp.stats doesn't work with maps from different locations. And it seems to me that r.proj forgets the information about the initial grid although in this case it should be kept. I have read the manual pages and the wiki but couldn't find anything answering my question, except that it seems to be something uneasy to do in grass, since operations on different locations cannot be done in order to avoid losses of accuracy: http://grass.osgeo.org/wiki/Location_and_Mapsets I may be wrong, but it seems to me that this kind of use of ratios to interpolate from a grid to another would be something that is done regularly, and I guess that other kind of computations requiring that geographic informations are not lost for each map would also be useful. -- Pat ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] computation in a location based on infos from another location
Hi, why dont you import one map from one location to another? Some information will be lost, that would be the same like r.resamp.stats. http://grass.itc.it/grass64/manuals/html64_user/r.proj.html Achim Patrice Dumas schrieb: Hello, I have 2 locations, one with a lambert projection with a 1 km grid (comes from hydro1k), covering africa, and the other with a longitude latitude projection with a 0.5 decimal degrees grid (covering the world). I have a raster map on the lambert location that has values of 1 for a given area and 0 (or null) otherwise (corresponds with upstream basins) and I would like to compute the corresponding area covered on the lonlat grid. This would lead to a value for each cell in the lonlat grid corresponding with the fraction of the grid cell covered by 1 in the lambert map. So, for example, if the cell is completly in the area in the lambert map, the value in the lonlat map should be 1, and if half of the area of the cell from the lonlat map is covered by ones in the lambert map, the value in the lonlat map should be 0.5. If the two maps were in the same location, I could set the region to be the one of the lonlat map, and do r.resamp.stats -w input=lambert_map output=fraction_covered But r.resamp.stats doesn't work with maps from different locations. And it seems to me that r.proj forgets the information about the initial grid although in this case it should be kept. I have read the manual pages and the wiki but couldn't find anything answering my question, except that it seems to be something uneasy to do in grass, since operations on different locations cannot be done in order to avoid losses of accuracy: http://grass.osgeo.org/wiki/Location_and_Mapsets I may be wrong, but it seems to me that this kind of use of ratios to interpolate from a grid to another would be something that is done regularly, and I guess that other kind of computations requiring that geographic informations are not lost for each map would also be useful. -- Pat ___ 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] help with g.pnmcomp
Hi everybody, I want to write a script that creates an image of raster A superposed to raster B. I want that raster A have an opacity of 0.6. I tried with the command: g.pnmcomp input=raster_A,raster_B opacity=0.60,1 output=image_C width=800 height=640 but it appear the following error message: ERROR: File raster_A not found BUT I know there is. So, what am I doing wrong? Do I have to do something more first ? thank you in advance -- Alberto Pettazzi MeteoGalicia - Departamento de Climatología y Observación Consellería de Medio Ambiente, Territorio e Infraestruturas Rúa de Roma, 6 15707 Santiago de Compostela. A Coruña Teléfono: +34-881-999646 e-mail: alberto.petta...@meteogalicia.es mailto:alberto.petta...@meteogalicia.es ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
Achim Kisseler pisze: Hello again, I am still searching a method to generate a flow accumulation map from a flow direction map. I got the direction map from an arcgis user. In arcgis the module FLOWACCUMULATION(FLOW_DIR) would do this, but I want to use an open source solution. If anyone could give me a hint, where I could find a tool like this (inside GRASS it does not seem to be possible), I would be very grateful. Best regards, Achim ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user there shoud be no problem if you have oryginal DEM ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
Thanks, Jaroslaw for response, there shoud be no problem if you have oryginal DEM I know, but I do NOT have the DEM. Thats the problem. Achim Jarosław Jasiewicz schrieb: Achim Kisseler pisze: Hello again, I am still searching a method to generate a flow accumulation map from a flow direction map. I got the direction map from an arcgis user. In arcgis the module FLOWACCUMULATION(FLOW_DIR) would do this, but I want to use an open source solution. If anyone could give me a hint, where I could find a tool like this (inside GRASS it does not seem to be possible), I would be very grateful. Best regards, Achim ___ 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] accumulation map from directions map
Hi Silvia, thank you very much. I will use h.tca from JGRASS to get the desired. Best, Achim Silvia Franceschi schrieb: Hi Achim, if you are trying to use an open source GIS for hydrological applications consider to take a look at JGrass. There are a lot of geomorphological modules. Best regards Silvia Hello again, I am still searching a method to generate a flow accumulation map from a flow direction map. I got the direction map from an arcgis user. In arcgis the module FLOWACCUMULATION(FLOW_DIR) would do this, but I want to use an open source solution. If anyone could give me a hint, where I could find a tool like this (inside GRASS it does not seem to be possible), I would be very grateful. Best regards, Achim ___ 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] accumulation map from directions map
2009/11/19 Achim Kisseler a...@jupiter.uni-freiburg.de: Thanks, Jaroslaw for response, there shoud be no problem if you have oryginal DEM I know, but I do NOT have the DEM. Thats the problem. Ah, now I understand is there a way in GRASS to build an accumulation map from a directions map without a dem map? So: If you are on earth, you can get it here (mars/moon should be also available somewhere :-): http://grass.osgeo.org/wiki/Global_datasets - SRTM - ASTER GDEM especially http://grass.osgeo.org/wiki/ASTER_topography If you need to start from the accumulation map and no way to use a DEM, then I have no idea (but see the other comments) Hope this helps, Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
Dear Markus, I follow Silvias suggestion and use h.tca in JGRASS. BTW: Isn't is possible to integrate the horton-tools into grass? Thanks, Achim Markus Neteler schrieb: 2009/11/19 Achim Kisseler a...@jupiter.uni-freiburg.de: Thanks, Jaroslaw for response, there shoud be no problem if you have oryginal DEM I know, but I do NOT have the DEM. Thats the problem. Ah, now I understand is there a way in GRASS to build an accumulation map from a directions map without a dem map? So: If you are on earth, you can get it here (mars/moon should be also available somewhere :-): http://grass.osgeo.org/wiki/Global_datasets - SRTM - ASTER GDEM especially http://grass.osgeo.org/wiki/ASTER_topography If you need to start from the accumulation map and no way to use a DEM, then I have no idea (but see the other comments) Hope this helps, Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] computation in a location based on infos from another location
On Thu, Nov 19, 2009 at 01:17:13PM +0100, Achim Kisseler wrote: Hi, why dont you import one map from one location to another? Some information will be lost, that would be the same like r.resamp.stats. http://grass.itc.it/grass64/manuals/html64_user/r.proj.html Problem is that the information I want is the size and location of the cell, and this is lost when doing r.proj. I could label cells before doing the projection, use a mask for each cell for r.resamp.stats and reproject back, but this seems very complicated. -- Pat ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
On Thu, Nov 19, 2009 at 2:35 PM, Achim Kisseler a...@jupiter.uni-freiburg.de wrote: Dear Markus, I follow Silvias suggestion and use h.tca in JGRASS. BTW: Isn't is possible to integrate the horton-tools into grass? If the license is compliant to GPL (I guess so), yes. Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
BTW: Isn't is possible to integrate the horton-tools into grass? If the license is compliant to GPL (I guess so), yes. Hi Markus, Horton Machine licence is LGPL and written in Java... Silvia ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] least cost path analysis question
Hi guys. I want to use r.walk or r.cost, followed by r.drain to create least cost paths. I've got no problem doing that with only 1 starting point and 1 stopping point. My problem is when I try to use multiple starting and stopping points. I saw that the coordinate and stop_coordinate were MULTIPLE=yes. But I don't really know I to declare each point. Let's say I've got those 4 points: pts1, pts2. pts3, pts4. I want to create a path going from pts1 to pts2, pts2 to pts3, pts3 to pts4, and pts4 to pts1. I've tried this: r.walk -k elevation=dem friction=cost output=output coordinate=pts1,pts2,pts3,pts4 stop_coordinate= pts2,pts3,pts4,pts1 and a lot of other rearrangement of the coordinate and stop_coordinate parameters, without much success. I'm trying some configuration where pts4 does go back to pts1 and some where pts4 doesn't go back to pts1. Does someone know how to configure r.walk, r.cost and r.drain to include multiple coordinates? Thanks, Maxime Phaneuf -- View this message in context: http://n2.nabble.com/least-cost-path-analysis-question-tp4031982p4031982.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
Re: [GRASS-user] computation in a location based on infos from another location
Once I was in the same situation. Lambert projection is good for some analyzes, because of the equal size of the grid cells. To get the size of the grid cells, you could convert a N-S row of the rastermap into vector polygons and get the size. Not a very direct way, but it sould work. Achim Patrice Dumas schrieb: On Thu, Nov 19, 2009 at 01:17:13PM +0100, Achim Kisseler wrote: Hi, why dont you import one map from one location to another? Some information will be lost, that would be the same like r.resamp.stats. http://grass.itc.it/grass64/manuals/html64_user/r.proj.html Problem is that the information I want is the size and location of the cell, and this is lost when doing r.proj. I could label cells before doing the projection, use a mask for each cell for r.resamp.stats and reproject back, but this seems very complicated. -- Pat ___ 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] computation in a location based on infos from another location
On Thu, Nov 19, 2009 at 04:01:24PM +0100, Achim Kisseler wrote: Once I was in the same situation. Lambert projection is good for some analyzes, because of the equal size of the grid cells. To get the size of the grid cells, you could convert a N-S row of the rastermap into vector polygons and get the size. Not a very direct way, but it sould work. Indeed, that would certainly do the trick. But this seems to be quite complicated. Maybe do a map with a different value for every cell, then use r.to.vect to map every cell to a polygon, project it to the lambert map, do the calculation on the polygon, reproject it back to the other map and do a v.to.rast. Not very simple but not that complicated either. Thanks for the idea. -- Pat ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] least cost path analysis question
Hi, I think you have to determine each path separately and at the end patch them all together to get the path pts1 - pts2 - pts3 - pts4 - pts1. The least costly path from e.g. pts1 to pts3 may not go through pts2, that's why the complete path needs to be forced through pts2, pts3, and pts4 and actually consists of several paths (e.g. one circular mountain hiking trail visiting 3 peaks, the least costly path from start point to end point is staying where you are...). Something like r.walk -k elevation=dem friction=cost output=output_1_2 outdir=outdir_1_2 coordinate=pts1 stop_coordinate= pts2 r.walk -k elevation=dem friction=cost output=output_2_3 outdir=outdir_2_3 coordinate=pts2 stop_coordinate= pts3 r.walk -k elevation=dem friction=cost output=output_3_4 outdir=outdir_3_4 coordinate=pts3 stop_coordinate= pts4 r.walk -k elevation=dem friction=cost output=output_4_1 outdir=outdir_4_1 coordinate=pts4 stop_coordinate= pts1 # Knight's move, so vector output seems adequate r.drain -d input=output_1_2 indir=outdir_1_2 coordinate=pts2 voutput=voutdir_1_2 ... v.patch input=voutdir_1_2,voutdir_2_3,voutdir_3_4,voutdir_4_1 output=mypath Just a guess, Markus M Maxime Phaneuf wrote: Hi guys. I want to use r.walk or r.cost, followed by r.drain to create least cost paths. I've got no problem doing that with only 1 starting point and 1 stopping point. My problem is when I try to use multiple starting and stopping points. I saw that the coordinate and stop_coordinate were MULTIPLE=yes. But I don't really know I to declare each point. Let's say I've got those 4 points: pts1, pts2. pts3, pts4. I want to create a path going from pts1 to pts2, pts2 to pts3, pts3 to pts4, and pts4 to pts1. I've tried this: r.walk -k elevation=dem friction=cost output=output coordinate=pts1,pts2,pts3,pts4 stop_coordinate= pts2,pts3,pts4,pts1 and a lot of other rearrangement of the coordinate and stop_coordinate parameters, without much success. I'm trying some configuration where pts4 does go back to pts1 and some where pts4 doesn't go back to pts1. Does someone know how to configure r.walk, r.cost and r.drain to include multiple coordinates? Thanks, Maxime Phaneuf ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] computation in a location based on infos from another location
Hi, use r.to.vect to map every cell to a polygon, project it to the lambert map, do the calculation on the polygon, reproject it back to the you dont need to project it to lambert: just run v.to.db -p option=area map=... then you get the size for every lines cell. To get the raster-map: r.mapcalc ns_col=if(col()==1 , row() , null()) Achim ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] computation in a location based on infos from another location
On Thu, Nov 19, 2009 at 04:30:55PM +0100, Achim Kisseler wrote: Hi, use r.to.vect to map every cell to a polygon, project it to the lambert map, do the calculation on the polygon, reproject it back to the just run v.to.db -p option=area map=... then you get the size for every lines cell. To get the raster-map: r.mapcalc ns_col=if(col()==1 , row() , null()) My idea was to do the other way around. In the lonlat location (cru_maps), I do a polygon that spans the whole region and delimitates cells: rows_nr=`g.region -g |grep '^rows=' |sed 's/^rows=//'` r.mapcalc grid_map=col() + ((row()-1) * $rows_nr) r.to.vect input=grid_map out=grid_map_v feature=area Then in the Lambert map, I project and use v.rast.stats: v.proj input=grid_map_v location=cru_maps v.rast.stats vector=grid_map_v raster=lambert_map colprefix=stat then, in the lonlat location I project back v.proj input=grid_map_v location=network_af output=result_v v.to.rast input=result_v output=result_rast column=stat_sum Right now I am stuck at the first projection since it triggered an assertion... -- Pat ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] help with g.pnmcomp
Alberto Pettazzi wrote: I want to write a script that creates an image of raster A superposed to raster B. I want that raster A have an opacity of 0.6. I tried with the command: g.pnmcomp input=raster_A,raster_B opacity=0.60,1 output=image_C width=800 height=640 but it appear the following error message: ERROR: File raster_A not found BUT I know there is. So, what am I doing wrong? Do I have to do something more first ? The inputs to g.pnmcomp have to be PPM image files, not GRASS maps. If you want to create a set of GRASS raster maps (red, green, blue) from blending the colours of other raster maps, use the r.blend script. -- 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] computation in a location based on infos from another location
Patrice Dumas wrote: Right now I am stuck at the first projection since it triggered an assertion... That assertion, your ticket #818, does not happen in grass7, but in grass6.x. I think this not the solution, however, the imported vector is corrupt. I'm not an expert on projections, but projecting the whole globe into some laea could cause all sorts of problems. Instead, you could create a vector in your laea location with v.in.region first, covering the extends of your area of interest. Reproject this vector to your ll location, set the region to match this reprojected vector and align with the desired resolution. Then run the commands to generate a raster and to convert it to a vector, and reproject that vector again to the laea location. BTW, please add output of g.proj -j to ticket #818. Markus M ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] accumulation map from directions map
Markus Neteler pisze: On Thu, Nov 19, 2009 at 2:35 PM, Achim Kisseler a...@jupiter.uni-freiburg.de wrote: Dear Markus, I follow Silvias suggestion and use h.tca in JGRASS. BTW: Isn't is possible to integrate the horton-tools into grass? If the license is compliant to GPL (I guess so), yes. Hortons tools are available in svn add ons as r.stream.* suite: r.stream.extract, r.stream.order, r.stream.stats etc... see tutorial on grass wiki http://grass.osgeo.org/wiki/R.stream.* Jarek Markus ___ 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] GRASS6.4 in Linux
Greetings all I want to install GRASS in a LINUX machine where I will develop a few scripts and functions (in C). According to http://grass.itc.it/download/index.php if I want to develop I should download source code and compile Can I just install a binary, develop my functions/scripts and compile those to the compiled version? Thanks Best regards Luis Lisboa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] GRASS6.4 in Linux
Luis Lisboa pisze: Greetings all I want to install GRASS in a LINUX machine where I will develop a few scripts and functions (in C). According to http://grass.itc.it/download/index.php if I want to develop I should download source code and compile Can I just install a binary, develop my functions/scripts and compile those to the compiled version? Thanks Best regards Luis Lisboa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user yes, if you also install -dev package (headers files) Jarek ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
RE: [GRASS-user] time dependent variable
I'm not so interested in making a movie; I want to be able to explore different layers of my maps as I see the data progresses. From the wiki page, there doesn't appear to be a way to do this, though. Thanks, Katie -Original Message- From: Micha Silver [mailto:mi...@arava.co.il] Sent: Thu 11/19/2009 1:35 AM To: Carbonari, Katie (IS) Cc: grass-user@lists.osgeo.org Subject: Re: [GRASS-user] time dependent variable Carbonari, Katie (IS) wrote: Hello. I have a netcdf file that I'm visualizing in GRASS. I first convert the parameters to GeoTiffs (using gdal_translate) and then incorporate into GRASS via r.in.gdal. Each file has 48 time steps (one per hour for 2 days). Is there any way to show the progression of my data in GRASS? I want to show which schools (or other such data) is affected by the path of my data (in this case, smoke from a fire). Any have any pointers? If you're interested in making animations then on the GRASS wiki [1] there are several suggestions. One of the options is exporting the maps as png files then running a tool called gifsicle to combine them into an animated gif. I've used this [2] to make nice animated maps. -- Micha [1] http://grass.osgeo.org/wiki/Movies [2] http://my.arava.co.il/~micha/blog/?p=168 Thanks, Katie This mail was received via Mail-SeCure System. ___ 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. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user