Arc GIS Desktop. Simple calculations Python built-in functions Using code blocks Code samples—math Calculate fields using logic with Python Calculate fields using logic with VBScript Code samples—geometry Geometry unit conversions Code samples—dates Code samples—strings Accumulative and sequential calculations Random values Calculating null values. Combine FieldA and FieldB separated by a colon. Calculate volume of a sphere given a radius field. Calculate the maximum value for each record from a list of fields.
Calculate the sum for each record from a list of fields. Round a field's value to two decimal places. Expression: round! Code Block: def MetersToFeet area : return math. Classify based on field values. Parser: Python Expression: Reclass! Calculate the area of a feature. Parser: Python Expression:! Calculate the maximum X-coordinate of a feature. Calculate the vertex count of a feature.
Parser: Python Expression: MySub! For a point feature class, shift the x coordinate of each point by Parser: Python Expression: shiftXCoordinate! Calculate a feature's length in yards. Calculate a feature's area in acres. Calculate a feature's geodesic length in yards. Calculate a feature's geodesic area in acres.
If you have a project that uses one of your custom functions you will need to also share the. The function editor is not only limited to working with the field calculator, it can be found whenever you work with expressions.
See also Expressions. Outdated version of the documentation. Find the latest one here. Specifies the type of expression that will be used. Instead of performing calculations one feature or row at a time, a single request is set to the server or database, resulting in significantly faster calculations.
A block of code that will be entered for complex expressions. Specifies the field type of the new field. This parameter is only used when the field name does not exist in the input table. If the field is of type text, the new field will have a length of For shapefiles and dBASE files, the field will have a length of The length of the new field can be adjusted using the Alter Field tool. Specifies whether field domain rules will be enforced. The following Python window script demonstrates how to use the CalculateField function in immediate mode.
Use the CalculateField function to assign centroid values to new fields. Use the CalculateField function with a code block to calculate values based on ranges. Use the CalculateField function to assign random values to a new field. When this environment is turned on, any fields that have an associated domain will use the domain description instead of the field's value.
Values from fields that do not have a domain will be unaffected. Feedback on this topic? Back to Top. Summary Calculates the values of a field for a feature class, feature layer, or raster. Legacy: arcgis. Python 3 — The Python expression type will be used. This is the default. Arcade — The Arcade expression type will be used.
Any fields that have been turned off for the layer or table you are working with are not listed in the Field Calculator. Field visibility is set on the Fields tab of the Layer Properties or Table Properties dialog box or from the Table window.
Arc GIS Desktop. Start an edit session. Right-click the layer or table you want to edit and open its table.
0コメント