2

enter image description hereI have converted raster files(tif) to polygons. Each of them has 3 fields in its attribute table: id=0, fid=0, shape=polygon zm. How can I add the name of each polygon to the attribute table? As you can see in the picture I added a field (txt)and then used the field calculator but I received this error :

Executing (Iterate Rasters): IterateRasters C:\Users\???\Desktop\n # # NOT_RECURSIVE
Start Time: Tue Apr 26 02:18:57 2022
Succeeded at Tue Apr 26 02:18:58 2022 (Elapsed Time: 0.07 seconds)
Executing (Raster Domain): RasterDomain C:\Users\???\Desktop\n\mnm.tif C:\Users\???\Desktop\n2円\mnm.tif.shp POLYGON
Start Time: Tue Apr 26 02:18:58 2022
Succeeded at Tue Apr 26 02:18:58 2022 (Elapsed Time: 0.14 seconds)
Executing (Add Field): AddField C:\Users\???\Desktop\n2円\mnm.tif.shp fm TEXT # # 25 # NULLABLE NON_REQUIRED #
Start Time: Tue Apr 26 02:18:58 2022
ERROR 000229: Cannot open C:\Users\???\Desktop\n2円\mnm.tif.shp
Failed to execute (Add Field).
Failed at Tue Apr 26 02:18:58 2022 (Elapsed Time: 0.01 seconds)

enter image description here

asked Apr 25, 2022 at 21:53

1 Answer 1

2

Your shapefile needs to be named differently. Since your model is failing on Add Field, I tested Add Field on a shapefile named test.tif.shp and it returned an error. I suggest trying to rename it without the other period. ex) test.shp

answered Apr 25, 2022 at 22:33
9
  • 1
    You can use Parse path for this Commented Apr 26, 2022 at 5:20
  • 1
    @BERA is correct, feed the iterator output (mnm.tif) into the parse path tool to return just the name (mnm) and then use its output as inline variable substitution. Also make its output a precondition to the Ratster Domain tool to ensure correct order of operations. Commented Apr 26, 2022 at 9:26
  • hi again i did what you said and use parse path it is useful .now i faced with an error but i think maybe it is about names of my files(raster) because some of my raster names have space .the error is like what i attached . Commented May 1, 2022 at 8:52
  • Start by not naming a folder 10.2.1401 Commented May 1, 2022 at 9:57
  • hi again both of you are awesome i think finally i will finish it thank you so much at the end of process-final step- i faced with an error in "calculate field" :the calculated value is invalid for the row with object id=0 ....... as you know i put name1 for field name and expression= value and expression type= vb but :General error executing calculator. ERROR 999999: Error executing function. Expected end of statement Failed to execute (Calculate Field). Commented May 4, 2022 at 16:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.