Re: [GRASS-user] i.cluster not working in GRASS 7
Hi Ned, I have been using i.cluster in GRASS 7 on a 64-bit fedora server, without any trouble. However, I managed to replicate your problem and create a single class output by setting the parameter 'sample=5,5' as you had done in your example. If I run i.cluster without that parameter, the signature file and classification output both have the number of predefined classes. Can you see if this helps with your data? Regards, Daniel. On Thu, Feb 17, 2011 at 7:49 PM, Ned Horning horn...@amnh.org wrote: Hi - I would like to do an unsupervised classification using i.cluster from GRASS 7 on my Ubuntu 64-bit machine. When I run i.cluster then i.maxlik on a Landsat image I only get one output class, the entire image. Only one class appears in the signature file so the problem is with the i.cluster step. I tried running i.cluster on different images and always get just one class. Here is the command line I'm using: i.cluster group=TM_r15c33@PERMANENT subgroup=AllBands signaturefile=IsoDataSigs2 classes=20 sample=5,5 convergence=99.9 min_size=1 Is anyone able to get i.cluster to work properly? It would be helpful to know if it's a user problem or a bug. Thanks in advance to anyone who can help. All the best, Ned ___ 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] python pipe Popen to grass.?_command
Hi, see the GRASS Programmers' manual, python section: http://grass.osgeo.org/programming6/pythonlib.html specifically grass.pipe_command(). See the python scripts in grass7/scripts/ for a large number of examples. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] i.cluster not working in GRASS 7
Hi Ned and Daniel, I have run into this problem in the past, and I believe it may have to do with your convergence, min_size, and classes settings. Try decreasing some of those and see if you don't get better results. You can also try increasing your separation from 0.0 (the default) to 1.0 or 1.5. Nick On Fri, Feb 18, 2011 at 4:24 PM, daniel mcinerney daniel.o.mciner...@gmail.com wrote: Hi Ned, I have been using i.cluster in GRASS 7 on a 64-bit fedora server, without any trouble. However, I managed to replicate your problem and create a single class output by setting the parameter 'sample=5,5' as you had done in your example. If I run i.cluster without that parameter, the signature file and classification output both have the number of predefined classes. Can you see if this helps with your data? Regards, Daniel. On Thu, Feb 17, 2011 at 7:49 PM, Ned Horning horn...@amnh.org wrote: Hi - I would like to do an unsupervised classification using i.cluster from GRASS 7 on my Ubuntu 64-bit machine. When I run i.cluster then i.maxlik on a Landsat image I only get one output class, the entire image. Only one class appears in the signature file so the problem is with the i.cluster step. I tried running i.cluster on different images and always get just one class. Here is the command line I'm using: i.cluster group=TM_r15c33@PERMANENT subgroup=AllBands signaturefile=IsoDataSigs2 classes=20 sample=5,5 convergence=99.9 min_size=1 Is anyone able to get i.cluster to work properly? It would be helpful to know if it's a user problem or a bug. Thanks in advance to anyone who can help. All the best, Ned ___ 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 mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Parallelization - Python
Hej... I am just trying to work out how to parallelize a simple Grassgis process in python via the thread module. Is that generally possible? Lets say I have a linefeature I want to transform into a raster with follwing python command, where n should be 1,2 and 3 and the calculations should happen in parallel mode. I am thinking about following first approach: def main(n): grass.run_command(v.to.rast, input = line, output = line_raster, use = val, value = n) return 0 if __name__ == __main__: options, flags = grass.parser() sys.exit(main()) thread.start_new_thread(main, (1,)) thread.start_new_thread(main, (2,)) thread.start_new_thread(main, (3,)) Has anyone worked already with parallelization in Python in combination with GRASS GIS? How can a script look like for my purpose? I want to run the script from outside grass. Maybe someone can tell how to proceed thank you Johannes -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Python-Loop over points
Hello, Original-Nachricht Datum: Mon, 7 Feb 2011 22:25:31 -0200 Von: Daniel Victoria daniel.victo...@gmail.com An: Johannes Radinger jradin...@gmx.at CC: grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Python-Loop over points Hi Johannes, You will need to use for loop. Something like this (UNTESTED!) for p in range(5): points_map = point+str(p) out_map = output+str(p) grass.run_command(r.streams.basins, dir = flow_direction, points=points_map, basins = out_map) That should work, or at least something similar Daniel Thank you for your suggestions Daniel, I also thought about a for loop. But in your case the loop is using for each iteration a input-pointmap called point+str(p). The difference in my case is that I've got only one vector map but with several points in it and I want to iterate over the single points. How is it possible to iterate over the single points? The points are stored in a kind of list format, so it should somehow be possible to loop over this file, but how? any suggestions? /johannes On Wed, Feb 2, 2011 at 9:39 AM, Johannes Radinger jradin...@gmx.at wrote: Hello, I am performing e.g. the r.stream.basins calcutlation in python: grass.run_command(r.stream.basins, dir = flow_direction, points = point1, basins = output) that's working perfectly in the case of one single point in point1. How can I do that multiple times when the point layer consist of e.g. 5 points and I want to create an output for each point (create 5 output rasters). How can that be done in a python script? thank you Johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] i.cluster not working in GRASS 7
Also, make sure you mask any Nulls since that often seems to be the problem when i.cluster doesn't work as expected, especially if you are using landsat 7 slc-off imagery - although I've also experienced it with Landsat 4 and 5 imagery. [Sent from a mobile device] On Feb 18, 2011, at 4:38 PM, Nick Jachowski njachow...@gmail.com wrote: Hi Ned and Daniel, I have run into this problem in the past, and I believe it may have to do with your convergence, min_size, and classes settings. Try decreasing some of those and see if you don't get better results. You can also try increasing your separation from 0.0 (the default) to 1.0 or 1.5. Nick On Fri, Feb 18, 2011 at 4:24 PM, daniel mcinerney daniel.o.mciner...@gmail.com wrote: Hi Ned, I have been using i.cluster in GRASS 7 on a 64-bit fedora server, without any trouble. However, I managed to replicate your problem and create a single class output by setting the parameter 'sample=5,5' as you had done in your example. If I run i.cluster without that parameter, the signature file and classification output both have the number of predefined classes. Can you see if this helps with your data? Regards, Daniel. On Thu, Feb 17, 2011 at 7:49 PM, Ned Horning horn...@amnh.org wrote: Hi - I would like to do an unsupervised classification using i.cluster from GRASS 7 on my Ubuntu 64-bit machine. When I run i.cluster then i.maxlik on a Landsat image I only get one output class, the entire image. Only one class appears in the signature file so the problem is with the i.cluster step. I tried running i.cluster on different images and always get just one class. Here is the command line I'm using: i.cluster group=TM_r15c33@PERMANENT subgroup=AllBands signaturefile=IsoDataSigs2 classes=20 sample=5,5 convergence=99.9 min_size=1 Is anyone able to get i.cluster to work properly? It would be helpful to know if it's a user problem or a bug. Thanks in advance to anyone who can help. All the best, Ned ___ 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 mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Limit r.fillnulls to interpolate only small gaps
Is there an easy way to do this with Grass ? I only want to patch gaps in DEM data up to a certain area size. Thanks ! Kaipi -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-r-fillnulls-to-interpolate-only-small-gaps-tp6040101p6040101.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
[GRASS-user] Re: Limit r.fillnulls to interpolate only small gaps
I would do it like this: - Make a mask of the gaps with r.mask (either by masking placeholder values that stand for gaps or, if the map really has no values where there are gaps, by making an inverse mask from the real values. - Create an arbitrary raster that overlays the gaps (with the mask applied just use e.g. r.mapcalc newmap=1 - Remove the mask - Conver the raster to vectors - Delete all vectors that are small enough to be interpolated over - Conver the vectors back into raster - Interpolate all the gaps in the old map - Make an inverse mask from the raster that holds the locations of the too large gaps - Use r.mapcalc to remove the interpolated areas where the gap was too big Another way, which is in my opinion better and faster, would be to use r.clump on the raster of the gaps to give the contigious areas an identical value, then run r.stats to spit out their areas, and then reclass the raster so that the cell values match the area covered by the gaps. Then you could remove the too big areas with r.reclass. Hope that helps! :) Daniel -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-r-fillnulls-to-interpolate-only-small-gaps-tp6040101p6040155.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
[GRASS-user] Problem Script: from collections import deque
Hello, It seems there is a problem when I am trying to run a python script in GRASS GIS (every script I tried)... ...the error is: File C:\GRASS6.5.SVN\Python25\lib\threading.py, line 13, in module from collections import deque ImportError: No module named collections But if I try to run the import command directly from the IDLE python shell (from collections import deque) it seems that the module is existing and loaded properly. I am working on Windows 7 with GRASS 6.5SVN and Pyhon 2.6.5 What is there the problem? Thanks for any help johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] overlap to vector maps
http://osgeo-org.1803224.n2.nabble.com/file/n6040248/exp.jpg Hello dear grass users I have 2 vector maps, one represents a grid and the other is delimited figure. I wanted to know the fraction of the figure overlaps each cell. Is is possible to do this without converting both maps to raster? thanks regards -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/overlap-to-vector-maps-tp6040248p6040248.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] Re: Limit r.fillnulls to interpolate only small gaps
One thing to watch out for is shape - thin regions may have a large area, but are filled very nicely with r.fillnulls. Masking completely by area will drop these as too large. An idea I had a while back that I use to identify large areas considering shape, but could be extended to the inverse: 1. Use r.grow on the original DEM to grow into the null areas. Use a distance (number of cells) that r.fillnulls can cover well, divided by 2. I use 5, I think, to identify large areas. The grow will eat up the small areas. 2. Pull out these large null areas with r.mapcalc. 3. r.grow the large nulls raster the same distance. This is where I stopped for identifying large nulls. The shapes may not be the same as the original null areas. You could grow an extra half a cell before the next step to make sure there are no slivers left. 4. combine the DEM with the large null raster to identify the leftover small nulls, which you use as the mask for r.fillnulls. There may be a better way with other GRASS modules, but it works for what I originally needed to do. On Feb 18, 2011, at 8:45 AM, LeeDaniel wrote: I would do it like this: - Make a mask of the gaps with r.mask (either by masking placeholder values that stand for gaps or, if the map really has no values where there are gaps, by making an inverse mask from the real values. - Create an arbitrary raster that overlays the gaps (with the mask applied just use e.g. r.mapcalc newmap=1 - Remove the mask - Conver the raster to vectors - Delete all vectors that are small enough to be interpolated over - Conver the vectors back into raster - Interpolate all the gaps in the old map - Make an inverse mask from the raster that holds the locations of the too large gaps - Use r.mapcalc to remove the interpolated areas where the gap was too big Another way, which is in my opinion better and faster, would be to use r.clump on the raster of the gaps to give the contigious areas an identical value, then run r.stats to spit out their areas, and then reclass the raster so that the cell values match the area covered by the gaps. Then you could remove the too big areas with r.reclass. Hope that helps! :) Daniel -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-r-fillnulls-to-interpolate-only-small-gaps-tp6040101p6040155.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 - William Kyngesburye kyngchaos*at*kyngchaos*dot*com http://www.kyngchaos.com/ First Pogril: Why is life like sticking your head in a bucket filled with hyena offal? Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal? First Pogril: I don't know either. Wretched, isn't it? -HitchHiker's Guide to the Galaxy ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: Limit r.fillnulls to interpolate only small gaps
I think William's right, the shape factor is important. A way to combine the two so that the shapes of the large null areas is the same as the gaps in the original raster would be to make polygons out of the original gap areas, then use William's method with r.grow, then making polygons that match the unfilled areas. The polygons that have the area of the original gaps that also overlap polygons generated using the r.grow method would then be the polygons to use as a mask. Thus the thin gaps would be filled in. The only problem there is that large gaps with a bottleneck somewhere would be shut out of the analysis, although the bottleneck could theoretically be interpolated quite well. But that would have happened with my original suggestion too. Or you could use r.grow and just accept the fact that even the large interpolated areas will be interpolated on the edges. Then the bottlenecking problem would be gone. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-r-fillnulls-to-interpolate-only-small-gaps-tp6040101p6040361.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
[GRASS-user] r.mapcalculator / r.mapcalc not producing raster
Hi all, I'm trying to combine two raster using the r.mapcalc/r.mapcalculator but am getting no where. I'm using python. # I did this previously... so dem and rain exist as rasters grass.run_command(r.in.gdal,input=location/dem.tif,output=dem) grass.run_command(r.in.gdal,input=location/rain.tif,output=rain) # Then I try this... grass.run_command(r.mapcalculator,amap=dem,bmap=rain,formula=A * B,outfile=test_combo) The output from that gives me... r.mapcalc test_combo = ( dem * rain ) 100% Done. When I try to add test_combo to the display in GRASS, nothing shows, even when I try to zoom to the layer in GRASS. r.info gives me the following: ++ | Layer:test_combo2Date: Fri Feb 18 13:19:52 2011 | | Mapset: PERMANENT Login of Creator: jay | | Location: newLocation | | DataBase: . | | Title: ( test_combo ) | | Timestamp: none | || | | | Type of Map: raster Number of Categories: 255 | | Data Type:FCELL | | Rows: 20 | | Columns: 20 | | Total Cells: 400 | |Projection: Lambert Conformal Conic | |N: 707999.97864227S: 628766.19610209 Res: 3961.68912701 | |E: 827306.35554785W: 607862.24148022 Res: 10972.20570338 | | Range of data:min = 0.00 max = 4241302.00 | | | | Data Description: | |generated by r.mapcalc | | | | Comments: | |dem * rain | | | ++ -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-mapcalculator-r-mapcalc-not-producing-raster-tp6041018p6041018.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
[GRASS-user] Re: r.mapcalculator / r.mapcalc not producing raster
Wow, it looks like your output raster is really, really small - only 400 cells. Is that correct? It also has values (you can tell by the min/max values in the metadata). That means that GRASS is producing something. Have you tried setting the regional settings to match test_combo? If you're importing into a new location without having set the regional settings before, it could be that your regional settings don't allow GRASS to display the map. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-mapcalculator-r-mapcalc-not-producing-raster-tp6041018p6041044.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
[GRASS-user] Re: r.mapcalculator / r.mapcalc not producing raster
That's not right @ all... How would I set the region? -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-mapcalculator-r-mapcalc-not-producing-raster-tp6041018p6041165.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
[GRASS-user] Re: r.mapcalculator / r.mapcalc not producing raster
Thanks, that did the trick. Setting g.region. Question, does that function set the region globally for Grass? For instance, if I'm using grass in another python console will that region be affected if I set the region in another instance of a python session? -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-mapcalculator-r-mapcalc-not-producing-raster-tp6041018p6041309.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
[GRASS-user] Windows 6.4.1RCI-1 menus don't run
After installing version 6.4.1RCI-1-Setup for Windows, the menu commands don't run. This is command console put from g.list Traceback (most recent call last): File C:/GRASS-64/etc/wxpython/wxgui.py, line 430, in OnMenuCmd menuform.GUI().ParseCommand(cmd, parentframe = self) File c:\GRASS-64\etc\wxpython\gui_modules\menuform.py, line 2051, in ParseCommand self.grass_task = self.ParseInterface(cmd) File c:\GRASS-64\etc\wxpython\gui_modules\menuform.py, line 2022, in ParseInterface tree = etree.fromstring(getInterfaceDescription(cmd[0])) File C:\GRASS-64\Python25\lib\xml\etree\ElementTree.py, line 963, in XML parser.feed(text) File C:\GRASS-64\Python25\lib\xml\etree\ElementTree.py, line 1245, in feed self._parser.Parse(data, 0) xml.parsers.expat . ExpatError : unknown encoding: line 1, column 30 I appreciate any comments. Thank you. Edgar Pimiento Chamorro e_pimie...@yahoo.com ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] GRASS and GSFLOW
Is anyone here using GRASS with GSFLOW (the Ground/Surface Water model from the USGS)? Has anyone used it in the past? Rich ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: (no subject)
Hi Jorn, I've been able to successfully import point data into rasters using the very clear steps outlined on the GRASS LiDAR wiki page here :http://grass.osgeo.org/wiki/LIDAR with r.in.xyz (http://grass.osgeo.org/grass64/manuals/html64_user/r.in.xyz.html) especially the section titled Import LAS as raster DEM. If you are starting with the text file you can do something like r.in.xyz input=path to yourfile output=foo fs= x=1 y=2 z=3 learned that ensuring that the region (g.region rast) is set to the extent of your data and that the region resolution determines the As the tutorial says you may want to do a v.surf.rst layer=0 in=${BASEMAP}_pt elev=${BASEMAP}.rst to fill holes in the data hope this helps! -- Peter Tittmann c 707 849 4135 On Friday, February 18, 2011 at 4:01 PM, Jorn Anke wrote: Hi, I have a pointcloud, (EUREF-89, sone 32 Norway, northern hemisphere), stored in a text file with format: X Y Z R G B. I can easily import this file into commercial software like AutoCad + proprietary engineering software, and make a dem out of it, run profiling, make elevation maps, and so on. I would however very much like to be able to do the same thing in a open source software like GRASS GIS. By now, I have spent quite some hours trying out GRASS, but still not managed to have it work. I would therefore very much appreciate if someone would take the bother and walk me through the steps required, if possible with a copy of a working chain of commands required in order to accomplish my goal. An example file can be found here; http://uavmapping.com/forum/index.php?topic=17.0 (Notice, there are a considerable number of outliners, that should probably have been removed from the file). Best regards, Jorn ___ 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