Converting slope tif file to vector

10582
10
02-29-2012 06:36 PM
NitishaShrestha
New Contributor
Hi all,

I am trying to convert a slope tif file into vector. The problem is it says invalid field type in the field(optional) box. The original tif file did not have an attribute table when I downloaded it. I am not sure if that is the problem?I am trying to convert this into vector so that I could overlay it with vector land use data. The land use data sets were originally in  raster format. I converted it into vector so that it was easier to calculate and would also decrease error.
The steps that I have done so far are

1)I changed the projection of the downloaded elevation tif file and then merged the required elevation data sets to create a mosaic tool. This created a new raster. Then, I used a raster calculator from the spatial analyst tool bar and then typed the code snippet: [seamless] = con(isNull([mosaic]),focalmean*([mosaic],rectangle,2,2),[mosaic]). This created a new data without seems.
2)Then I used the surface tool from the spatial analyst to calculate the slope.
3)I am having problems with converting raster slope data to polygon. I tried using raster to polygon toolset from the conversion tool but the field for the slope is unidentified. I am not sure how to solve this problem.

Are there any ways I could overlay raster with vector? Please help...

Best Regards,
Nitisha
Tags (2)
0 Kudos
10 Replies
MichaelStead
Occasional Contributor III
In the Raster to Polygon tool the field you want is just "Value" I think. Do you have this field as an option?
0 Kudos
EricRice
Esri Regular Contributor
Greetings,

You can only convert integer rasters into polygons.  Slope is typically 32 bit floating point data unless its already been reclassified.  The first bullet in the Raster to Polygon documentation indicates the input must be a valid integer raster dataset.

Regards,
Eric
0 Kudos
MichaelStead
Occasional Contributor III
....... so run an INT on the grid first.  If you use a percent slope grid instead of degrees slope grid there is less rounding error as you would have 100 integer values from in 45 degrees. You could also multiply the slope values by 10 or 100 or something before you INT it if you really wanted to minimize this.
0 Kudos
EricRice
Esri Regular Contributor
Multiplying the data by 10 or 1000 is legitimate to do, but it's easier to just add 0.5 to your raster prior to running the INT tool. This ensures you get proper rounding (regardless of percent slope/degree slope). The INT tool doesn't do any rounding. It simply truncates the values to the right of the decimal.
0 Kudos
NitishaShrestha
New Contributor
Thank you so much for your help!!!

I have generated a percent slope grid but I am not sure how to multiply by 10 or 100 and then run an INT. I haven't done any of these steps before so any help in achieving these two steps would be helpful. Thank you so much for your time.

Best Regards,
Nitisha
0 Kudos
PatrickTaurman
Occasional Contributor III
To Multiply by 10 or 100, you can use the Times tool in Spatial Analyst Tools > Math, or you can use the Raster Calculator for in Spatial Analyst Tools > Map Algebra.  The INT tool is also found in Spatial Analyst Tools > Math.

Patrick
0 Kudos
BruceNielsen
Occasional Contributor III
You can do the elevation to integer slope conversion in one step using the Single Output Map Algebra tool. The equation to use is:
int(slope(elevation, PERCENTRISE) + 0.5)
0 Kudos
NitishaShrestha
New Contributor
Thank you so much!!! I followed the steps and finally the raster DEM changed to polygon. But it takes a while to load. My watershed is not that big so I was wondering if I ended up doing something wrong.

Here are the steps I used
1. Since I had already generated the percent slope grid, I added 0.5 to my raster before running the INT tool. I used Spatial Analyst Tools>Map Algebra>Raster Calculator. Then I added 0.5 to my slope percent ("slopepercopy" + 0.5) and clicked OK.
2. Similarly,  I used Spatial Analyst Tools>Map Algebra>Raster Calculator. Then with the new dataset I typed Int("slope_add1") and clicked OK.
3. I used Conversion Tool> From Raster>Raster to Polygon. It works but is takes forever to load and I was not sure if I was doing every step correctly. I have attached an image of my watershed (I tried changing the value field from ID to gridcode but it takes a while to load).

One more question- If this step works, how would I reclassify the new ploygon ? I have used this tool before but I was wondering how would I know what grid code belongs to a particular percent slop.

Once again thank you so muchhh.
Best Regards,
Nitisha
0 Kudos
MichaelStead
Occasional Contributor III
You should just reclassify your original percent slope raster and then run the raster to polygon. Raster and vector formats have different strengths and in this case I would expect that this would be much more efficient than running a dissolve on thousands of polygonal records. I spent half my day today struggling with a few hundred thousand vectorized slope class polygons....lazy mans load bit me in the ass:)
0 Kudos