Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Got an easy one, that's got me stuck. I'm moving some models that were created in 9.3.1 to work in 10.

Part of the model is calculating the X coordinate of a polygon to a specified field.

The code that works (in 9.3.1) is

Dim Output As Double
Dim pArea As IArea
Set pArea = [Shape]
Output = pArea.Centroid.X

Expression = output

It doesnt work in 10 as i get the following error.

General error executing calculator.
ERROR 999999: Error executing function.
Expected end of statement
Failed to execute (Calculate Field X_COORD).

I've tried the following using the python parser

def calc(shape,x):
    x = "shape.CENTROID!.split()[0]
    return x

calc(!SHAPE!, !X_COORD! )

But that gives an error - invalid syntax on line 2.

Any pointers? Thanks

share|improve this question

closed as too localized by whuber May 15 '13 at 17:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

you are missing an end quote on your second line – Hotpepper May 15 '13 at 17:19