Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [error-000539]

Use this tag for Questions which are related to the "000539" error returned by ArcGIS Desktop and ArcGIS Pro.

13
votes
8answers
32k views

Removing return/newline (\n) character from Field using Python and Field Calculator?

I have a geodatabase table with a field that I'm trying to remove return characters (new line). I found this post (How can I remove (chomp) a newline in Python?) of how to do it, however it is not ...
11
votes
1answer
2k views

Using ArcPy with ArcGIS Pro and ArcGIS Desktop on same machine?

I'm just trying out ArcGIS Pro for the first time and I had to change my PYTHONPATH to python34 ArcGIS Pro is now working without crashing every time I open the Analysis tab... However now when I try ...
8
votes
3answers
2k views

python script error- with GetParameterAsText [duplicate]

I have a seemingly simple code which iterates through a list of feature classes and calculates an ID field in the attribute table that is equal to the first 5 characters of feature class name. The ...
5
votes
1answer
199 views

Calculating Polsby-Popper Score Using ArcGIS Pro Field Calculator gives ERROR 000539?

This operation is using the Field Calculator in ArcGIS Pro 2.1. I am trying to calculate the Polsby-Popper Score for Congressional Districts. I have calculated the Geodesic Area and Geodesic ...
5
votes
1answer
2k views

Map Algebra expression in a model fails on open workspace

I have model which runs 2 processes that create rasters and a third process that (attempts to) add the two of them using Map Algebra. The expression is very simple, just "%Raster_A%" + "%Raster_B%". ...
4
votes
2answers
897 views

Assign field values (double) based on values of other field (string) using field calculator

I want to assign numbers to a field, WScore (double), based on field values of Soils (string). They are in the same table of a raster. I'm not trying to add text to a double. What I want to do is this:...
4
votes
2answers
548 views

ERROR 000539: Error running expression

I am trying to calculate my End_Streets field within two joined tables. I want to remove the redundant SECONDARYN value from the STREETS field. " & ".join(!IntersectAndEnds2.Streets!.split(" &...
4
votes
1answer
2k views

Why is arcpy.CalculateField_management() writing 1899-12-30 00:00:00 instead of expected date?

I'm using ArcGIS 10.3.1 for Desktop to test before writing an answer to Entering date with arcpy.GetParameterAsText()? I have written the test code below that I am running against a test feature class ...
4
votes
1answer
254 views

arcpy.CalculateField_management doesn't recognize variable in code block

I found a useful field calculator code block that I'm trying to add to a custom python tool. It works great in the manual field calculator; however, when inserted into the code block text to be used ...
4
votes
1answer
1k views

Scale raster in ArcGIS using raster calculator

I have a raster with values ranging from 0 to 8991130624. This raster is actually the result of a cost distance analysis. I want to scale the raster to range from 0 to 1 and take the inverse? so ...
4
votes
1answer
86 views

Python parser of ArcGIS Field calculator returns ERROR 000539: Error running expression?

I like field calculator and use it often, however found something very disturbing today when attempted to do this on a table of 3D feature class. def abc(shp,id): return shp.length -----------------...
3
votes
1answer
5k views

Receiving error 000539 from CalculateField_management?

I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I ...
3
votes
3answers
2k views

Calculate field using variables as fields gives ERROR 000539?

When I calculate a field like this: field_0="field_name0" arcpy.CalculateField_management("Layer", field_0, '!field_name1! / !field_name2!', "PYTHON_9.3") It works! The field "field_name0" in the ...
3
votes
1answer
5k views

Why does Raster Calculator (RasterCalculator_sa) give ERROR 000539 in ArcPy?

I am getting a not executed error for a raster calculator. Here is part of the output: File "C:\projectTemp\FloodAnalysis\floodxsectionanalysis.py", line 107, in makeSeemless arcpy....
3
votes
2answers
295 views

Python script in ArcMap Field Calculator giving Error 000539: SyntaxError: Invalid Syntax?

I've been trying to calculate this expression for a field in an attribute table in ArcMap 10.4.1, and keep getting the following error: Error 000539: SyntaxError: invalid syntax (expression, line ...
3
votes
3answers
5k views

Use 'if' statement in ModelBuilder to stop model

I would like to use an if-else statement in my model (along the lines of this Esri blog). My model works fine (several intersects, dissolves, calculating fields, joins). However, I would like to add a ...
3
votes
3answers
818 views

Replace occasional Space with Underscore using Python parser of ArcGIS Field Calculator?

I am creating a model which will give me two string values, one which reads exactly what is in a field and another which automatically replaces any Space with an "_". I have used Calculate Value tool, ...
3
votes
1answer
9k views

ArcGIS Raster Calculator fails with Error 000539

I have been using Raster Calculator in ArcMap 10.2, today it started returning error 000539 for all actions. Previously it had worked fine. I have not made any change ot my ArcGIS, Python, or Windows ...
3
votes
1answer
84 views

ArcGIS Field Editor if/else syntax with python

I am just starting with Python and ArcGIs so here is my question: I have the column "DB_Low" (Type "Long") and want to fill a new column by changing values. The new column will be a Float-Type field. ...
3
votes
1answer
194 views

Concatenate fields value excluding empty values

I need to concatenate the value of two fields excluding empty values, using Field calculator. The fields are: AREA_HI and AREA_LO I have tried using a Python script but ArcGIS returns an error "...
3
votes
1answer
332 views

Get multiple values from summary tables in Model builder

I working with ModelBuilder and I have two summary statistics tools, with 'case fields' that have multiple sum values, I want to use these sum values from one table and divide the sum values from ...
3
votes
1answer
535 views

Replacing multiple characters at once

I have a problem with replacing in field calculator. For some reason my Python parser is not working. So I'm going to use VB and having tonns of this Replace([field],"x","y") Replace([field],"z","a")...
3
votes
2answers
1k views

Can anyone tell me why my field calculator is returning this error?

All I am trying to do is pull into a text field, a section of another text field via: fieldB = !fieldA![some_index:other_index] However I keep receiving the error below and I can't figure out why. ...
2
votes
2answers
4k views

Debugging ERROR 000539 from CalculateField in ArcPy?

I previously successfully used the sample code here: How to calculate Field using part of filename in ModelBuilder? # Import standard library modules import arcpy, os, sys from arcpy import env # ...
2
votes
2answers
2k views

Concatenating strings from two fields using Python in ArcMap Field Calculator?

I'm new to Python scripting and I don't understand what is wrong with this code. I want to concatenate the string values from GRID1MIL and GRID100K. I've created a text column MGRS to begin with. I ...
2
votes
1answer
380 views

if/then with VBScript in ArcGIS Field Calculator giving Error 000539: SyntaxError: invalid syntax?

What is wrong with this VBscript in the field calculator? ColumnC= if [ColumnB] > 0 then [ColumnC] = [ColumnA] / [ColumnB] endif Each time I receive this syntax error message: Error ...
2
votes
1answer
623 views

Debugging error 000539 from ArcGIS Field Calculator?

What am I doing wrong in this field calculator logic? Pre-logic def re_score(elev_t,f2, contour): f2=contour if elev_t.endswith('.5'): f2 = "Midi" return f2 Expression for field "Contourtyp" ...
2
votes
1answer
1k views

Putting multiple lines of Python into ArcGIS 10's Field Calculator

Entering these lines of Python one at a time works like a charm... Just need one more seemingly simply issue solved... How do we place multiple lines of Python code into ArcGIS's Field Calculator ...
2
votes
1answer
557 views

ERROR 000539: Invalid Field !FULLNAME!

I am very new to Python and my first attempt hasn't gone too well. I'm trying to overwrite a field that is a spatial join of a couple of features in order to, in the end, generate a beginning and ...
2
votes
1answer
8k views

Converting values in datetime field to strings in text field using Python parser of ArcGIS for Desktop?

In the attribute table of my file geodatabase feature class I have a populated field called DateField of type date, and a text field called TextField. I have not yet hit on a way to convert the dates ...
2
votes
2answers
248 views

How to calculate multiple variables with precondition

I want to do multiple "calculate values" in ModelBuilder. To make it simple let´s take only 2 simple calculations: 1) calculate sine from angle to variable "MySinus" 2) use this value in a second ...
2
votes
2answers
334 views

Using Feature Class name to populate new field

I am trying to get the Feature Class name (from Iterate Feature Classes) into a new field. I have been following the models described in the following two threads. Using Value from Iterate Feature ...
2
votes
4answers
907 views

Field Calculator Python Expression Issues

I'm pretty new to Python and this is my first post on this forum so I could use some help. I am currently attempting to run some code in the Field Calculator in a model in order to replace string ...
2
votes
1answer
229 views

Using Function in Field Calculator gives error 000539?

I'm trying to populate a field using a function. When I run this in Pyscripter, it works fine: d = {} # Function # def find_dups(val): d[val] = d.setdefault(val, -1) + 1 return d[val] # ...
2
votes
2answers
3k views

Error msg “Name is not defined” when trying to populate a field with the shape file name

I am trying to populate a field with corresponding file name. For example, if the file name is Route1.shp then the field value will be Route1 as well. However my code is not working. Can you please ...
2
votes
1answer
2k views

Cause of ERROR 000539: Error running expression?

The following errors in ArcMap are preventing me from moving forward: 1) In Raster Calculator using "Aspect": "%DEM_Aspect%" <= 90 or "%DEM_Aspect%" >= 270 ERROR 000539: Error running ...
2
votes
2answers
129 views

Call field from zip() into Field Calculator expression ArcGIS

I've been trying to find a way to call in field names from a zip(). Basically I have 12 fields called "Flw_days1", "Flw_days2" etc and corresponding "Depth" fields that need to be calculated using the ...
2
votes
1answer
91 views

Exporting attachments from FGDB and populating field with picture path

I am trying to export attachments from fGDB and populate fields with the picture link path. I created a script following these instructions http://support.esri.com/en/technical-article/000014520 ...
2
votes
1answer
1k views

Calculating centroids of polygon using ArcPy?

I am trying to calculate the centroids of a polygon and add the x- and y-coordinate to their respective fields: arcpy.env.workspace = r"C:/..." input_fc = "shapefiles/precincts_v.shp" arcpy....
2
votes
1answer
541 views

ArcGIS raster calculator: ERROR 000539: Error running expression: rcexec() <type 'exceptions.ImportError'>: No module named collections

My raster is in the GRID format, source type is continuous and pixel type is floating point (32bit). If i use the raster calculator ("dem" *1000 or "dem >= 2m" (to highlight certain heights) it ...
2
votes
1answer
2k views

ArcMap raster calculator error 000539

Using ArcMap 10.3, I am trying to perform map algebra on a raster with 2013 annual PRISM precipitation for the U.S. (http://prism.oregonstate.edu/recent/). The raster has 1 band an is floating point. ...
2
votes
1answer
338 views

Select Data won't work… Parameters are not valid in ArcGIS ModelBuilder?

I'm creating a model in the ArcGIS 10.3 ModelBuilder and have problems to get the select data tool to work. At first the complete model: IHS-Klassifizierung With the Select Data tool (Input Data ...
2
votes
0answers
156 views

ERROR 000539 from ModelBuilder with Raster Calculator? [closed]

I'm trying to do a math operation in raster calculator using the rasters from other two raster calculators. My calculation is a simple NDVI formula: (rastcalc4 - rastcalc3)/(rastcalc4 + rastcalc3) ...
2
votes
0answers
919 views

Cause of Field Calculator UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)? [closed]

def Befahrung(value1,value2): if value1 is ' ': return ' ' else: return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf" I try to create a field with a hyperlink. It works ...
1
vote
1answer
121 views

If/Then python script in Field Calculator not working

I'm working in Modelbuilder. I have a polygon in which I calculate the shape centroid in decimal coordinates (field called LONG_CENTR). Then I add a field (called FAJA) and I want to use a Field ...
1
vote
2answers
678 views

Avoiding error 000539 from code block in Calculate Value tool?

I do not have a very good understanding of python and have attempted to write a code block so that my model will skip rasters that do not contain any information and continue the process with rasters ...
1
vote
1answer
119 views

Changing all entries in field to be entirely lower case using ArcGIS Field Calculator?

I have a field with a bunch of species names, but for a single species there a bunch of case combinations (e.g. Cat, CAT,cat). I want to make a new field which has all the entries in all lower case. I ...
1
vote
1answer
274 views

ArcPy Raster Calculator error “ 'str' object has no attribute 'save' ”

I converted a model into python script and tried to run it. It gave me an error when it gets to the raster calculator process.The message says "str" object has no attribute "save". See picture below. ...
1
vote
1answer
185 views

Correct expression syntax for filling field with string in calculate field in ArcPy?

I am attempting to populate fields on two different feature classes with different strings that I have stored in a list. I would like to just put the strings and feature classes into a for loop, but ...
1
vote
1answer
49 views

CalculateField_management, python Toolbox

I am trying to fill a field and I am using arcpy's CalculateField_management function. I want to fill the new field with the name of the shapefile, so I am using arcpy.Describe. But when I run the ...