13

There are a couple of ways to approach this: Create a list of filter values in the parameters property. Create the list in the validation script. I prefer the second route since you have more control over what values are valid as well as extracting unique values from fields. Going the first route: Set the data type to string (as shown in your picture) ...


11

You can see the proj string used by QGIS to transform from and to WGS84 when you look at Settings->Project settings, CRS tab, and search for the EPSG code or name of a CRS. All CRS are referenced by their EPSG code, or user defined CRS. Uusally, all EPSG-codes are bundled with one certain transformation to WGS84 which was decided to be most appropriate....


9

import arcpy import shutil outbasename=arcpy.GetParameterAsText(0) #outfilename=r"C:\" + outbasename + ".txt" # Original with typo outfilename = "C:\\" + str(outbasename) + ".txt" shutil.copyfile("C:\\test.txt",outfilename) this is how I would do it in arcpy in a script tool


9

You can put the WKT text into a text file, and run gdalsrsinfo on it: gdalsrsinfo test.txt >out.txt PROJ.4 : '+proj=lcc +lat_1=26.666667 +lat_2=29.333333 +lat_0=28.002808 +lon_0=84 +x_0=500000 +y_0=500000 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs ' The ellipsoid parameters look very much like Kalianpur 1962, EPSG 4145: +proj=longlat +a=...


9

This was a simple question that had found difficult to answer. I searched through the Esri documentation, which is usually very thorough, but just overlooked it. I wanted to share my answer here in a concise manner. In the Parameters dialog, set up a parameter, and set its direction to "output". Set the type to "Derivative" if applicable. In the script, ...


9

Change the "Obtained from" property for the input to the shapefile parameter.


8

When you define the parameters for your script. For the "State" parameter, you have to set the "obtained from" parameter properties to "Prepared Footprint".


8

You can't hide parameters, but you can enable/disable them through script tool validation. E.g.: if self.params[0].value: self.params[1].enabled = True else: self.params[1].enabled = False Will enable parameter 1 if and only if parameter 0 has a value. This would go in the ToolValidator's updateParameters function.


7

Under your Fields to Choose option, change it to Field instead of Field Mappings. That will give you a list of the feature layer fields.


7

You're not really supposed to do this, but you could open a cursor in your validator's updateParameters method. if self.params[0].value and arcpy.Exists(self.params[0].value): value_set = set(row.getValue('COL_NAME') for row in arcpy.SearchCursor(str(self.params[0].value)))) self.params[1].filter.list = sorted(value_set) This ...


7

Python Toolbox: If your script is in a Python Toolbox, you can use a Value Table (GPValueTable). def getParameterInfo(self): param0 = arcpy.Parameter( displayName='Elevation and Temperature', name='in_features', datatype='GPValueTable', parameterType='Required', direction='Input') param0.columns = [['Long', ...


7

Your issue is arising due to the use of a comma as the decimal mark. It may help to understand that in your script you are not converting a double into a float, you are converting a string into a float. The string, when a comma is used as the decimal mark, is invalid. I would make use of the Replace method here to ensure that a decimal point is used in the ...


6

If you mean for a geoprocessing script, then not easily. You can create your own dialog stylesheet and do some XSLT and Javascript programming to customize the controls, but all of that is super painful and not really worth the trouble. I'd recommend just living with the fact that it's as wide as the screen.


6

Instead of using the Field Calculator tool, a possible workaround is to create a custom script which allows the user to choose an attribute field and update it with a value they enter. To do this, go to Processing Toolbox > Scripts > Tools > Create new script and copy the following: ##Update field by number=name ##Layer=vector ##Fields=Field Layer ##Number=...


6

A TimeStamper will create an attribute with yyyymmdd. Next you can fanout on both filename and sheetname:


6

The best explanation I came across is this: the ratio of the difference of the red and infrared radiances over their sum as a means to adjust for or “normalize” the effects of the solar zenith angle. Originally, they called this ratio the “Vegetation Index” (and another variant, the square-root transformation of the difference-sum ratio, the “Transformed ...


5

Links to specifications for the various WMS versions are here http://www.opengeospatial.org/standards/wms and list all standard parameters. Individual vendors have been known to add their own parameters on occasion.


5

I was able to get the SQL Expression parameter's dialog to populate by setting its Obtained From property to the input Feature Layer parameter I created: Note that Feature Layer parameters also accept feature classes, e.g. a path to a shapefile or feature class, in addition to the name of a feature layer in the current map document or in the current ...


5

It looks like the arcpy.SetParameterAsText() function takes two parameters: the parameter index position, and the parameter value. Rather than trying to assign the value to the function you need to provide it as the second parameter. This: arcpy.SetParameterAsText(0, decadesText) Not this: arcpy.SetParameterAsText(0) = decadesText


5

If you're referring specifically to the tool right click > make variable > from parameter > X, then no, there is no way to expose them all at once. You need to do them one at a time.


5

The parameter you need is: workspace


5

This is more of a workaround as I'm not sure if it's possible at the moment to allow a user to select from a range of string values. Instead, you could use booleans which would represent your formulae (these would be connected to a custom script which will contain your formulae). So that when a user clicks on a boolean from the modeler, the script will ...


5

The widthcolumn and heightrow variables are string and need to be type integer: Try: widthcolumn = int(arcpy.GetParameterAsText(3)) heightrow = int(arcpy.GetParameterAsText(4))


5

No, there's no support for this in existing QGIS versions (<= 3.8). You'd need to address this at runtime, and add a check that the evaluated parameter value falls into the acceptable range (raising a QgsProcessingException otherwise)


4

When you are building your model just don't assign a data source to it. Leave it blank. If you need to reset the model just click on the "Validate" button on the model builder toolbar (it's a checkmark) that should reset anything that was holding over from a previous run.


4

How to access parameters in a script tool using arcpy.GetParameterAsText() is described here. The way that you tried, arcpy.SetParameterAsText(), is intended for setting output rather than input parameters


4

Have a look at the os.path namespace for common pathname manipulations. I would also parameterize the input file and output locations instead of hardcoding them but of course that's up to you. I would do something like this: import arcpy, os, shutil inputfile = arcpy.GetParameterAsText(0) ext = os.path.splitext(inputfile)[1] # returns file extension, e.g. "...


4

Set it as a File type. You can use parameter validation to ensure the file extension is ".pdf" or as @blah238 notes, use the filter option to restrict file type to pdf.


4

Try replacing this: Ausrichtung = float(arcpy.GetParameterAsText(9)) if Ausrichtung == '#' or not Ausrichtung: Ausrichtung = "0.0" arcpy.AddMessage("Ausrichtung"+ Ausrichtung) with this: Ausrichtung = arcpy.GetParameterAsText(9) # do not float() until you know it's numeric if Ausrichtung == '#' or not Ausrichtung: Ausrichtung = 0.0 # a float, ...


4

You have to get the mxd parameter in the Python code as a string first and then create an ArcMap document object. In the script tool properties, you can still use the parameters data type you've specified, but you cannot pass directly this object to the arcpy code. mxd = arcpy.GetParameterAsText(0) mxd_doc = arcpy.mapping.MapDocument(mxd) #create an ...


Only top voted, non community-wiki answers of a minimum length are eligible