2

The expression that you are passing to arcpy.CalculateField_management() is not directly a value as such (either a string or a number), but rather a snippet of Python code to evaluate in order to get a value. The outer quotation marks do not delineate a string value within that Python code, but are rather the start and end of the actual Python code. So you ...


2

If you have polylines stored in shapefile and call them "LINES" in your mxd table of content, below field calculator expression will populate numerical field of your points table by distance from relevant line start: g=arcpy.Geometry() geomList=arcpy.CopyFeatures_management("LINES",g) def Chainage(id,shp): geom=geomList[id] L=geom.measureOnLine (shp....


2

If adding new fields to your layer is an option for you, you can do it the following: Save your two values into the fields "fixvalue" and "varvalue" Save your expression into a field ("expression") using the string indicator ' (single quote) like this: '("fixvalue" * "varvalue")' You can now calculate your result using the expression eval( "expression"). ...


1

I'm not familiar with Python in ArcGIS specifically, but, as @JGH noted in their comment, the variables in your function definition (ISLNumero and SubtipoIS) must correspond to the names you use in the function body (ISL_Numero and Subtipo_IS). If there's some kind of error log in ArcGIS, I would expect to see a NameError: name 'ISL_Numero' is not defined ...


1

import requests lyr = iface.activeLayer() count = lyr.featureCount() reqData = { "jsonrpc":"2.0", "method":"generateStrings", "params":{"apiKey":"myapikeygoeshere", "n":count, "length":20, "characters":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "replacement":True},...


1

The only solution I have found so far is to use the plugin Sort and Number. First get latitude and longitude for each point using Add Geometry Attributes then use the plugin. Input ycoord as 1st field and xcoord as 2nd field. This will had a column with the row number.


1

Usually, you can choose between two ways to format a field name in the Field Calculator: If the field name has no spaces, you can use only the field name, like this: fieldname If the field name has spaces or resembles a field calculator function, you must enclose the name in doublequotes, like this: "field name" Your field, "left(dista" looks like the ...


1

You can make an SQL query from DB Manager to create a new "virtual" layer. Turn on DB Manager standard plug-in from the menu (Plugins/Manage and Install Plugins...) Load the necessary layers, tables for join. Open DB Manager from the Database menu and look for your table among Virtual layers and Project layers. Select the second icon in the toolbar (paper ...


1

The easiest way to get this is by going to the layer properties of the Transport - District layer and go to the "Attributes Form" tab, where you can click on the FROM_TRAFFIC_IMPACTOR_CODE field and select value relation as widget type, use TRAFFIC_IMPACTOR_CODE as layer, TRAFFIC_IMPACTOR_CODE as key and DESCRIPTION as value field. Repeat this for the ...


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