Select to view content in your preferred language

convert raster to polygon (model builder - iterate)

6219
11
12-20-2017 10:08 AM
rokcedilnik
Emerging Contributor

I'm trying to convert multiple rasters to polygon and then vertices of those polygons convert to point and finally add XY coordinates. So my main tools for this process are:
- raster calculator (multiply raster with 0 to get just one band)
- raster to polygon
- feature vertices to points
- add xy coordinates

I'm trying to do this in model builder. If I use raster to polygon directly (without raster calculator), I get error that shp is bigger than 2GB. So far I manage to apply raster calculator which stores result in folder "raster_calculator". When I add raster to polygon I get error "ERROR 010157: Unable to open feature class..." (see picture "error.png").
I tried to use Calculate Value and Parse Path but I didn't succeed. Most likely because I don't know how to used them properly.

Can anyone please help me or give me an advice how to solve this in model builder.

P.S.: I know that in python this could be easier but I would like to do this in model builder because i don't understand python.

0 Kudos
11 Replies
rokcedilnik
Emerging Contributor

My original files are DOF (digital ortofoto image) in "tiff" format but my original files also have "tif" in the name (look the first picture). When I run "raster to polygon" tool I create shapefile from raster file. I that process I use parse path, so that I take just the name but I also get "tif" in that name. So my shapefile looks like "DOF_KRANJ_A3.tif.shp". So now I need to delete somehow my extension or (better) define how many characters should my next output have (I would like to take just "DOF_KRANJ_A1") but I just can't do it correctly. If I set parameter to the output of "raster to polygon" tool will it be any diferent?

0 Kudos
DanPatterson_Retired
MVP Emeritus

I already provided many suggestions, none of which seemed to be of any help apparently.

You could slice of the last 4 characters and append .shp as an alternative if you can't get 'replace' to work

new name => oldname.tif[:-4] + ".shp"  

0 Kudos