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)
1 Answer 1
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
-
1You can use Parse path for thisBera– Bera2022年04月26日 05:20:15 +00:00Commented 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.Hornbydd– Hornbydd2022年04月26日 09:26:41 +00:00Commented 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 .coral– coral2022年05月01日 08:52:59 +00:00Commented May 1, 2022 at 8:52
-
Start by not naming a folder 10.2.1401Bera– Bera2022年05月01日 09:57:53 +00:00Commented 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).coral– coral2022年05月04日 16:59:52 +00:00Commented May 4, 2022 at 16:59
Explore related questions
See similar questions with these tags.