Tag Info

New answers tagged

4

Put a u in front of the string so the interpreter knows it's Unicode. myCalc(!Epulettipus!, u"Lakóépület")


3

You don't 'Dim' variables in python, you just declare and assign them. That said, your basic route is to set the parser to python and check Show Codeblock. In the Pre-Logic Script Code box, enter your function like this: def DoThis(fld): val = 0 if fld <> 'a certain string': val = # do your calculation here return val In your ...


-2

I'm a long time ArcGIS user but find that the QGIS field calculator is a lot more intuitive & provides options for dragging & dropping fieldnames, expressions & operators. If you are a programmer, then you'll probably find it a lot easier and you'll find it builds your knowledge for using the expression builder in ArcGIS.


0

To clarify, say, there is a raster and with random values 1-10. I want to input this raster and return a new raster that is all no data except for where the original raster = 5 I use numpy.where for that. Something like: numpy.where ( [condition], [if TRUE do this], [if FALSE do this] ) outarray = numpy.where((outarray==5),5 , 9999) ...


2

Yes - to do this I would: Use the extent of the polygon just digitized to Create [a] Fishnet of the same size Use SelectLayerByLocation on the fishnet just created to select those that overlap the polygon geometry that you digitized Use GetCount to count how many of the fishnet cells overlap with the polygon geometry Use an update cursor or CalculateField ...


1

Instead of using PIPE in the subprocess.Popen, you can use a file path to save the output. You can create the path by using the arcpy.CreateScratchName() (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/CreateScratchName/000v0000001z000000/). After the subprocess runs and you have the output in the file, you might set the output parameter ...


3

I would use the "SHAPE@" token with the search cursor, then do something like this: with arcpy.da.SearchCursor(fc, ("SHAPE@", "UNIQUE_ID")) as searchCur: for row in searchCur: myDF.extent = row[0].extent myDF.scale = 50 arcpy.RefreshActiveView() arcpy.mapping.ExportToPDF(thisMap, ...


0

I have figured it out! for anyone who might be having the same issues... Here is the expression which I used in Numbers to return the x-coords: INDEX(E,ROW(cell),1)+INDEX(B,(ROW(cell)−1),1) where E is the column containing x-shift, and ROW(cell),1 is the address of the x-shift for any given row… B is the column containing x-coords, and (ROW(cell)−1),1 ...


0

This is an older one, but since it does not have an accepted answer: GRASS GIS is divided into modules. Each module is a command line program which can by invoked in many ways. Inside GRASS itself, it is through the system command line or GUI (with our without auto-generated GUI dialog). Most of the GRASS functionality is exposed through modules. There is ...


0

I think that your problem is with this line: wd = pluginHost.getWorkingDirectory(C:\xampp\htdocs\learn\doit) The 'getWorkingDirectory' method returns a String, it doesn't take one as a parameter. I think what you want instead is this: wd = "C:\xampp\htdocs\learn\doit" pluginHost.setWorkingDirectory(wd) However, note that Whitebox will update the ...


1

You want to set it to Table View. Feature Classes inherit from this interface. So setting the data type to Table View will allow you to see Feature Classes and standalone tables in the drop down.



Top 50 recent answers are included