Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: Model w/ 1st Calculate Field Expression

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: Model w/ 1st Calculate Field Expression

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: Model w/ 1st Calculate Field Expression

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

deleted 67 characters in body
Source Link
JonR
  • 311
  • 1
  • 9

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: In Process ModelModel w/ 1st Calculate Field Expression

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: In Process Model

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: Model w/ 1st Calculate Field Expression

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

added 105 characters in body; added 5 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: In Process Model

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through this questionUsing Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, but adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: In Process Model

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through this question, but adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.

To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.

Here is an image of the model below: In Process Model

At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.

I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.

Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.

Removed unnecessary thanks
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
JonR
  • 311
  • 1
  • 9
Loading