[GRASS-user] Error with GRASS 7.8.3
Hi all: I have had these 2 problems for a while, but tried to work around them... It may be with my build from source... PROBLEM #1... When I try to create a new LOCATION and MAPSET (just a simple lat-long LOCATION over the CONUS), I use the GUI to select the projection and datum (lat-long & WGS84)... I get something like this: Starting GRASS GIS... Traceback (most recent call last): File "/usr/local/grass78/gui/wxpython/location_wizard/wizard.py", line 1080, in OnPageChanging self.parent.parent, transforms=ret) File "/usr/local/grass78/gui/wxpython/location_wizard/dialogs.py", line 617, in __init__ transforms = '---\n\n0\nDo not apply any datum transformations\n\n' + transforms TypeError: must be str, not bytes Traceback (most recent call last): File "/usr/local/grass78/gui/wxpython/location_wizard/wizard.py", line 1080, in OnPageChanging self.parent.parent, transforms=ret) File "/usr/local/grass78/gui/wxpython/location_wizard/dialogs.py", line 617, in __init__ transforms = '---\n\n0\nDo not apply any datum transformations\n\n' + transforms TypeError: must be str, not bytes Exit was requested in GUI. GRASS GIS will not start. Bye. PROBLEM #2... when I attempt to re-project a RASTER between LOCATIONS, I get no errors, but all the raster values are NULL, even with the target LOCATION defined large enough. And sometimes, it works! r.proj will report something like this: Output: Cols: 1 (original: 5390) Rows: 1 (original: 3288) North: 4762.50 (original: 1985962.50) South: 0.00 (original: -13673137.50) West: -4762.50 (original: -11820525.00) East: 0.00 (original: 13849350.00) EW-res: 4762.50 NS-res: 4762.50 The original raster is perfectly fine. Any initial thoughts? Best, Tom ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] TPI (terrain position index) in GRASS GIS
Hi Stefan, Sure, that makes all sense! I am not used to DEM-realted indices, but I could have just thought a little...Thanks a lot! B Em quinta-feira, 8 de outubro de 2020 12:50:35 GMT+2, Stefan Blumentrath escreveu: #yiv0189279323 #yiv0189279323 -- _filtered {} _filtered {} _filtered {}#yiv0189279323 #yiv0189279323 p.yiv0189279323MsoNormal, #yiv0189279323 li.yiv0189279323MsoNormal, #yiv0189279323 div.yiv0189279323MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv0189279323 a:link, #yiv0189279323 span.yiv0189279323MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv0189279323 a:visited, #yiv0189279323 span.yiv0189279323MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv0189279323 p.yiv0189279323msonormal0, #yiv0189279323 li.yiv0189279323msonormal0, #yiv0189279323 div.yiv0189279323msonormal0 {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv0189279323 span.yiv0189279323EmailStyle18 {font-family:sans-serif;color:windowtext;}#yiv0189279323 .yiv0189279323MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv0189279323 div.yiv0189279323WordSection1 {}#yiv0189279323 Hi Brenado, TPI is rather simple and can be computed with r.neighbors + r.mapcalc: r.neighbors -c input=dem output=dem_avg_9 size=9 r.mapcalc expression=”TPI_9=dem-dem_avg_9” g.remove -f type=raster name=dem_avg_9 Cheers Stefan From: grass-user On Behalf Of Bernardo Santos Sent: torsdag 8. oktober 2020 12:35 To: GRASS User List Subject: [GRASS-user] TPI (terrain position index) in GRASS GIS Hi everyone, Do any of you know if we can calculate TPI (terrain position index) in GRASS GIS? Or should we go for other tools such as SAGA GIS? Best wishes, Bernardo Niebuhr ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] remove holes from polygon
Hi Moritz Is there a way to automatically (not by manually editing the dataset) remove all holes in all areas of a vector dataset (I guess that are polygons without a category within polygons with a category). What do you mean by remove ? Fill them as separate polygons ? Make them part of the containing polygon ? The holes shall become parts of the bigger containing polygon. I dreamed there could be a way to drop "rings" which do not have categories. Or something like PostGIS' ST_ExteriorRing. If the latter and if the holes are all smaller than existing polygons, one possible path I see is making them into actual areas using v.centroids and then merge them with the outside polygon using v.clean with the tool=rmarea. Interesting, that could work. I ended up using a slight variation, using dissolve instead of clean to not having to come up with a minimum area: v.centroids in=poly_with_holes out=poly_centroids v.category in=poly_centroids option=del cat=-1 out=poly_no_cat v.category input=poly_no_cat output=poly_same_cat option=add step=0 v.dissolve in=poly_same_cat out=poly_no_holes Thank you very much Moritz! Robert ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.generalize threshold change in Python does not affect output
Dear GRASS users, I'm trying to simplify a watercourse polygon with v.generalize in a Python script running on a x64 Windows 10 machine. The script points to the GRASS 7.8.3 distribution shipped with QGIS 3.14. Previously in QGIS, the v.generalize tool on the watercourse polygon with 'threshold' set to 100 produced the desired output, with 'Number of vertices for selected features reduced from 2323 to 30 (1% remaining)'. In the Python script, using the same arguments, v.generalize gives: grass.run_command('v.generalize', input='watercourse', output='vgen _lothresh', type='area', method='douglas', threshold=100) > 'Number of vertices for selected features reduced from 3249 to 1854 (57% remaining)' which is not the same output. And changing the 'threshold' argument from 100 to 1 has no effect on the output: grass.run_command('v.generalize', input='watercourse', output='vgen_hithresh', type='area', method='douglas', threshold=1) > 'Number of vertices for selected features reduced from 3249 to 1854 (57% remaining)' In the Python script again, pointing to a standalone GRASS 7.8.3 or old stable 7.6.1 does not solve the problem, nor using other simplification methods. What am I doing wrong here? I would appreciate your support on this. Thank you, best wishes Clement Poirier ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] remove holes from polygon
On 8/10/20 18:11, Robert Nuske wrote: Hi GRASS list, I am kind of lost and hope someone can point me in the right direction. Is there a way to automatically (not by manually editing the dataset) remove all holes in all areas of a vector dataset (I guess that are polygons without a category within polygons with a category). What do you mean by remove ? Fill them as separate polygons ? Make them part of the containing polygon ? If the latter and if the holes are all smaller than existing polygons, one possible path I see is making them into actual areas using v.centroids and then merge them with the outside polygon using v.clean with the tool=rmarea. Moritz ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user