When I use this command :  &gt; chm &lt;- grid_canopy(gro, 1, pitfree(c(0,2,5,10,15), c(0,1), subcircle = 0.2)) Processing [-------------------------------------------]   0% (1/341) eta:  8mError: filename exists; use overwrite=TRUE   I have an error because the file exist. How can i add the overwrite argument to grid_canopy because when i use this command :  chm &lt;- grid_canopy(gro, 1, pitfree(c(0,2,5,10,15), c(0,1), subcircle = 0.2, overwrite = TRUE)   I receive this error :  Error in grid_canopy(gro, 1, pitfree(c(0, 2, 5, 10, 15), c(0, 1), subcircle = 0.2),  :  unused argument (overwrite = TRUE)
122274
I have a small issue with configuring the lidR  for parametrizing the extracted raster files with grid_metrics() function.  My question is how to set in the catalog options that:   be able to overwrite the results with a second run if I want to run my script several times and I do not want to name each output differently. instead of .tif I would like to get .grd files as output.   My current code (which is working) is the following:  normalizedctg = catalog(workingdirectory) opt_output_files(normalizedctg) &lt;- paste(workingdirectory,"/clipped/normalized/{XLEFT}_{YBOTTOM}_height",sep="") height = grid_metrics(normalizedctg, max(Z),res = resolution)   But with a second run on the same code I get the following error:  Error in .getGDALtransient(x, filename = filename, options = options,  :    filename exists; use overwrite=TRUE
109077
for layers in glob.glob("*.las"):         processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,layers+"E:/las_new/.tif")      {'output': 'PNOA_2016_CAT_huso31_346-4560.lasE:/las_new/.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4562.lasE:/las_new/.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4564.lasE:/las_new/.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4566.lasE:/las_new/.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4568.lasE:/las_new/.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4570.lasE:/las_new/.tif'}   output_ras=("E:/las_Ras")   for layers in glob.glob("*.las"):     processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,layers+"output_ras.tif")      {'output': 'PNOA_2016_CAT_huso31_346-4560.lasoutput_ras.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4562.lasoutput_ras.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4564.lasoutput_ras.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4566.lasoutput_ras.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4568.lasoutput_ras.tif'}   {'output': 'PNOA_2016_CAT_huso31_346-4570.lasoutput_ras.tif'}     for layers in glob.glob("*.las"):     processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,"output_ras.tif")      {'output': 'output_ras.tif'}   {'output': 'output_ras.tif'}   {'output': 'output_ras.tif'}   {'output': 'output_ras.tif'}   {'output': 'output_ras.tif'}   {'output': 'output_ras.tif'}   I would like to batch process many LAS files to rasters using the PyQGIS algorithm. As you can see in the code, I think the final problem is with the output. It does not write the files out to my defined output pathway as tif files. Also how can I make sure the naming of output rasters are according to the original LAS they are generated from? What am I doing wrong here? Not a pro at Python. Started 3 days ago.
87486
This doesn't work:  tar xf /tmp/foo.tar.gz foo/bar tar: foo/bar: Not found in archive   It's not obvious to me what would do this beyond extracting it in place and moving the files over.
45045
I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that:   I would like to build a attribute table of raster data use a loop through attribute table using ARCPY.SearchCursor()   Therefore, I wrote a code to build an attribute table. However, I am getting an error while running the code and not able to figure out the error in the code.  Code:  import arcpy # Create the geoprocessing object  import arcgisscripting gp = arcgisscripting.create()  #To overwrite output arcpy.env.overwriteOutput = True  #Set environment settings gp.workspace = "C:/Subhasis/Test/raster-read"  #Build Raster Attribute Table gp.BuildRasterAttributeTable_management("sti-9", "Overwrite")  Error Message: Traceback (most recent call last):   File "C:/Subhasis/Test/raster-read/test.py", line 15, in &lt;module&gt;     gp.BuildRasterAttributeTable_management("sti-9", "Overwrite") ExecuteError: ERROR 000049: Failed to build attribute table Failed to execute (BuildRasterAttributeTable).
116673
For example, I have files named   A_1.txt A_t_1.txt A_ts_1.txt A_tsa_1.txt   in a directory ~/admin/packages/.  I am building a for loop to by globbing to A_1.txt   for f in ~/admin/packages/*_1.txt   It's obvious that this can potentially glob to any one of these files.  Specifically I would like to use an "exception" command (if it exists) to say glob to any file as long as it does not have a t, s, a before _1.txt.  EDIT: I forgot to mention that I have the path stored as a variable.  PROJECT="~/admin/packages/*_1.txt"  for f in ${PROJECT}...
31583
For reasons that are beyond me, the following MWE  \documentclass{scrreprt} \usepackage{classicthesis-ldpkg} \usepackage{bm} \usepackage{amsmath}  \begin{document}  \section{The values of $\beta$ for which $\omega_i \mid \bm{\omega} \mid^{-\beta}$ is defined at the origin}  \end{document}   fails to compile with the following error:  ! TeX capacity exceeded, sorry [input stack size=5000]. &lt;to be read again&gt;                    \HyPsd@@LetCommand l.9 ...a} \mid^{-\beta}$ is defined at the origin}   I've tried increasing the amount of memory available to pdfLatex but that doesn't solve the problem. I've also googled to no avail. Is there a workaround for this problem.
110374
I need to convert files. I'm trying to use gdal_rasterize   gdal_rasterize -b 1 -burn 0 -l file file.shp work.tif   and the output is the following:     ERROR 10: Pointer 'hDS' is NULL in 'GDALGetProjectionRef'. Warning 1:   The input vector layer has a SRS, but the output raster dataset SRS is   unknown. Ensure output raster dataset has the same SRS, otherwise   results might be incorrect. Segmentation fault (core dumped)
10721
Environments are allowed to have arguments, but reference to those arguments can only appear in the opening code of the environment, and not the closing code.  What is the reason for this, and are there preferred ways around it?  e.g.  \newenvironment{foo}[1]% {some code #1} % allowed {some code #1} % not allowed
100879
I've looked at some answers on here about deleting shapefiles with QGIS but I still seem to be running into errors. I am trying to delete shapefiles that have no attribute data in them (so 0 rows). My main issue is that I get:  PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:  I have tried using QgsVectorFileWriter.deleteShapeFile(f) but that leaves the .shp and .dbf behind.   I have also tried using os.remove for each individual file extension and that gives me the Win Error 32.   It seems like my files are still being used in QGIS. Does anyone know how to work around it?   Here is my full script:  clipped_soilpoly = get_data(clipped_folder, ".shp") # makes a list of all the .shps for f in clipped_soilpoly:     shapelayer = QgsVectorLayer(f,"clipped_poly")     rowcount = shapelayer.featureCount()`  if rowcount &lt; 1:               print ("deleting " + f + " - does not intersect")          #QgsVectorFileWriter.deleteShapeFile(f) &lt;-- only deleting some of the file extensions              split_path = os.path.splitext(f)[0]             del f          #delete .shp             shp = split_path + ".shp"             os.remove(shp)          #delete .dbf                 dbf = split_path + ".dbf"             os.remove(dbf)          #delete .prj                 prj = split_path + ".prj"             os.remove(prj)          #delete .qpj                 qpj = split_path + ".qpj"             os.remove(qpj)          #delete .shx                shx = split_path + ".shx"             os.remove(shx)           else:             print ("keeping " + f)
61294
I want to create and elevation hillshade but I found the script for QGIS 2.18. What should I use instead of processing.runandload? Here is my script on QGIS 2.99 python console:  import processing rasterLyr = QgsRasterLayer("C:/Users/Mustafa Uçar/Desktop/Tutorial/qgis_data/dem/dem.asc", "hillshade") rasterLyr.isValid() processing.runandload("gdalogr:hillshade", rasterLyr, 1, False, False,1.0, 1.0, 315.0, 45.0, "C:/Users/Mustafa Uçar/Desktop/Tutorial/qgis_data/dem/hillshade.tif") #to verify the output image processing.runandload()
97449
I want to write the Ubuntu analogue of a "batch file" (a shell script). But I don't know how to use chmod +x filename command to make it so that the script can be run. Nor do I know where to use it.
10697
I'm trying to free up some disk space - if I do a df -h, I have a filesystem called /dev/mapper/vg00-var which says its 4G, 3.8G used, 205M left.  That corresponds to my /var directory.  If I descend into /var and do du -kscxh *, the total is 2.1G  2.1G + 200M free = 2.3G... So my question is, where is the remaining 1.7G ?
78023
I'm making a randomizer that randomly clones 1 of the 9 units to all armorstands called "chunk". Inside every unit is an armor_stand called "Unit" and this is the command I used:  execute @e[type=armor_stand,name=chunk] ~ ~ ~ execute @r[type=armor_stand,name=Unit] ~ ~ ~ clone ~-3 ~-1 ~-3 ~3 ~5 ~3 ~ ~15 ~  What this does is, it clones a unit 15 blocks above itself but I want it to clone ~-3 ~15 ~-3 above every armor_stand called "chunk"  You can see a random unit is clone ~ ~15 ~ above the armor_stand calling unit. The armor_stand you can see is called "chunk".
112861
I've tried defining the following custom environment, but I get errors:     \begin{gather} ended by \end{solution}   etc...   Here's a MWE showing my problem:  \documentclass{article}  \usepackage[fleqn]{mathtools}  \newenvironment{solution}{%  &lt;-Solution   \par\addvspace{1em}   \itshape{Solution:}\par\begin{gather}}   {\end{gather}\par\normalfont\hfill\qed\par\addvspace{\medskipamount}}%  \begin{document}   \begin{gather}     testing   \end{gather}    %% This does not work:   \begin{solution}     testing   \end{solution} \end{document}
60990
I am attempting to create a plane and set the color; the following code throws an error at this line:    bpy.data.materials['RSgreen'].diffuse_color=(0,0,0)   the error is:  ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3  which makes no sense to me; diffuse_color calls for 3 parameters in the .  bpy.ops.mesh.primitive_plane_add(size=4,enter_editmode=False,location=(-2,-2,0.01)) bpy.context.active_object.name='Plane2' bpy.ops.material.new() bpy.data.materials[1].name='RSgreen' bpy.data.materials['RSgreen'].diffuse_color=(0,0,0) bpy.context.object.data.materials.append(bpy.data.materials['RSgreen'])
85720
I installed QGIS 3, and tried to execute tools like "sieve" "merge" and "polygonize". All of them gave me the error message:  GDAL command output: /bin/sh: (scriptname).py: command not found   I found the scripts in both /Username/miniconda3/bin and /Username/miniconda3/lib/python3.6/site-packages/GDAL-2.2.2-py3.6-macosx-10.9-x86_64.egg-info/scripts.  Checking env in Terminal shows that miniconda3/bin is in the path:  PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin://Users/Username/miniconda3/bin  What could be causing the failure of executing those scripts?
37878
I somehow managed to create a file that doesn't seem to have a filename. I found some information regarding how to get more details of the file in the following   However, I tried some of the suggestions listed and can't seem to delete the file. I'm not sure what I did to create it, but it happened while trying to copy an xml file.   Some info on the file is as follows;  &gt; ls -lb total 296 -rw-r--r--   1 voyager  endeavor  137627 Jan 12 12:49 \177  &gt; file * :               XML document  &gt; ls -i  417777      I tried to find using the inum switch and then pipe that to rm as that seemed like the most foolproof way of getting rid of it. However, the example given at the bottom of the thread linked below failed for me. Example was:  &gt; find -inum 41777 -exec ls -al {} \; find: illegal option -- i find: [-H | -L] path-list predicate-list   so I tried using the path list first like the following, but that didn't work either:  &gt; find . -inum 41777 -exec ls -al {} \;   I'm not sure what the non-printable character \177 is or how I can pass that to an rm command, but I really want to make sure I don't mess up any other files/directories in my attempt to delete this file.