3

I'm trying to update latitude and longitude data per individual station for a lab I'm working for.

Here's some code I have that's supposed to assign any all bay stations of a certain name the appropriate GPS coordinates.

Whenever I try to run it arcMap simply says there was an error processing the data.

Field Calculator

2
  • 3
    Right off the cuff your python structure is malformed. Read up about proper indentation.
    – Thomas
    Commented Oct 6, 2015 at 16:09
  • 2
    Also, include the actual error message as that will usually help determine what the issue is. Commented Oct 6, 2015 at 16:14

1 Answer 1

1

long is a reserved word (a type) in python so I used in_long instead.

code block:

def update_nones(in_long,bay_statio):
    if bay_statio==0:
        return -84.9250031
    else:
        return in_long

expression:

update_nones(!long!,!bay_statio!)
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.