POST
|
I actually figured this one out, what happened was: on a clip I created of my study area, I believe I let it set the nodata values as 255 (the ArcGIS default). Although for some reason this did not show up under properties when I looked afterwards. When I redid the clip and told it to assign 0 to nodata values, redid the extract by attributes tool creating a new raster for each landcover type (from this new clip), then redid the zonal statistics tool, it came out correctly with no negative values. So, what was happening was, since numbers were assigned for each landcover type (for ex: water =11) the sum was calculated by 11+11+11+11... and so on. However, with nodata pixels set to 255, cells that were not water were calculated as 255. So the tool was doing 11-255+11-255... By redoing all those steps and changing the nodata pixels to 0 in the original clip, the tool calculated sum by doing 11-0+11-0 .... I still don't know why it only did the 11-255+11-255 thing for some zones and not others, but my fix seems to have worked for all zones. Also, to answer your question, I wanted to see if I could make this tool work rather than performing a join with the vector layer because it allows me to show which pixels (that appear split by a county line) were counted in which county zone. Also keeping it in raster rather than vector will become helpful later in my analysis I believe. HOWEVER, now I am running into a different issue. After I fixed the problem above, I started running the zonal statistics tool on each extracted landcover type raster (so one for the water raster, one for the deciduous forest raster and etc). It worked perfectly on the first 4 landcover types. Then, without changing anything, when I was on the 5th landcover type, the zonal statistics tool crashed and gave me the generic 999999 Error. It also gave me an error that said "no current record", and I am not sure what that means exactly. I am particularly confused because I changed nothing between when it worked and when it crashed. I was just sitting next to the computer taking notes on paper, then each time the tool finished I would just set it up and press go for the next landcover type. So, to troubleshoot I tried it on a landcover raster that the tool had previously worked on moments before (exact same input raster, zones and everything) and the tool crashed and gave me the same errors. So I am completely confused why the tool worked one moment and crashed the next, even when I tried to re-run it on an input raster that worked less than an hour before. Do you have any idea why this would happen? Thank you for all your help, I really appreciate it.
... View more
07-23-2017
04:33 PM
|
0
|
0
|
1500
|
POST
|
I have a county shapefile that I am using as the "zones" and a raster dataset of landcover types. I extracted each type of landcover, making it so that each one had an individual raster (so water raster, Deciduous forest raster etc). Then I performed the Zonal Statistic as Table tool and summed up the number of pixels of a certain type in each county. It seems to have worked correctly. Now I am trying to use the Zonal Statistics tool to give me an output raster that represents those same SUM values, but it seems that some of the outputs for certain zones are wrong. There are some zones (counties) that match their SUM values in the original Zonal table, and then some that are negative and do not match their value in the table. For example, when I use the Identify tool and click on the county (zone) #27071 it tells me that the value for the SUM generated by the Zonal Statistics tool was -739109312.0. I checked to see what the Zonal Statistics as TABLE tool assigned as the SUM value for county #27071 and it was 1770032 (completely different). This number should not be negative to begin with, and I checked to make sure the original raster didn't have a value like -999 assigned to it for "No Data" cells, and it did not (it actually had nothing assigned for No Data). In addition, I told the tool to ignore No Data cells. This happened for multiple counties. However, some of the counties did match the original Zonal Table SUM values, so it seems like the tool is doing something weird for only some of the zones? Does anyone have any idea what could be going on? Thank you very much for your help, Kate
... View more
07-20-2017
12:26 PM
|
1
|
12
|
3754
|
POST
|
Oh I see. So, that means that a cell "split" by a county line will only be counted in the sum of one of the counties and not both, because the center can only fall inside one county (zone)?
... View more
07-18-2017
06:23 PM
|
0
|
2
|
2815
|
POST
|
I will do that! I have one more question if you don't mind, I want to tell the Zonal Stat tool to only count cells that are completely inside a county, not ones that are only half inside a county (in other words exclude raster cells in the SUM that are split by the county boundary line). However, I do not see an option for this in the Zonal Stat tool window. Do you have any idea how I could accomplish this?
... View more
07-18-2017
04:40 PM
|
0
|
5
|
2815
|
POST
|
Sorry, I don't think I explained very well. I actually got the tool to work (summing for each individual county) by just associating it with a code in the shapefile that was unique to each county. My issue is that in the raster there are different types of cells (blue cells = water (11), dark green cells = evergreen forests (42) and etc). I basically am using the Zonal Statistics as Table tool to tell me how many water cells there are in each county, how many evergreen forest cells in each county and so on. So far, the only way that I can find to have it sum water cells and evergreen forest individually, rather than just summing all cells in each county, is to first use "Extract by Attributes" to make an individual raster for each landcover type (so a raster showing only water cells, a raster showing only evergreen forest cells, etc..) Then running the Zonal Stat as table tool on each one of these separately. I'm wondering if there is an add-on or other tool that would allow me to tell the Zonal statistic tool to sum by cell type? Unfortunately I'm not trained in Python. My other question is, I want to tell the Zonal Stat tool to only count cells that are completely inside a county, not ones that are only half inside a county (like the cell is split by the county boundary so only half the cell falls in the county). However, I do not see an option for this in the Zonal Stat tool window. Does anyone know a way that I could accomplish this? Thank you!
... View more
07-18-2017
04:34 PM
|
0
|
0
|
639
|
POST
|
Yes I did exactly that, shortening file names and making the join permanent by exporting it to a new feature class, except I kept it on the outside server in the same folder as the main map, and the tool luckily still worked. Thank you!
... View more
07-18-2017
04:23 PM
|
0
|
7
|
2813
|
POST
|
Thank you all for the help! It's working now. It seems the length of the filenames and the joined table were the problems. It appears that I cannot run the Zonal Statistics as table tool and have it sum up each cell type individually (for example number of deciduous cells in each county, number of coniferous cells etc in each county). Instead it just seems to sum all the cells together. The only fix I know for this is to run Extract by Attributes for each cell type (which takes a very long time), then performing the Zonal Statistics tool on each one. Does anyone know of a tool that could allow me to do this in a more efficient way, or to select that I want a sum of each type of cell individually? Thank you!
... View more
07-18-2017
02:45 PM
|
0
|
2
|
639
|
POST
|
- I went back and changed the file names to have "_" instead of spaces, the one you see is just me having edited the name in properties to be more readable. - Yes, I joined tables together to match my Lyme disease case numbers with the county shapefiles, is that a problem for trying to perform a zonal statistic? If so, how should I go about fixing this and getting the Lyme case data and population data matched with the shapefile? - No its not from esri, the input value raster was downloaded from the National Land Cover Database (NLCD). - Yes, the Z folder is a server that I am doing all of this work on because I am working on a university computer, is that a problem for this tool? I can move it to the computer and then move it back to the server before I shut down the computer. Will that cause any issues or just involve restoring the pathnames? - I tried the normal (non-table) Zonal Statistics tool on one county, and it just gave me a black box over the area. I assume that means the tool didn't work. I also tried the Zonal table tool on just one of the cell types, and that also didn't work. Thank you for all your help!
... View more
07-18-2017
08:34 AM
|
0
|
9
|
2813
|
POST
|
I am trying to run the Zonal Statistics as Table tool on my data in order to sum the number of cells of a certain type of landcover in each county. For example, I want it to sum how many Deciduous forest, Pasture/Hay land and etc.. there are in each county individually. I have tried two different ways: 1. By using the Extract by Attributes tool on the raster to extract each individual type of cell (so, one raster is created for deciduous forest cells and one raster for paster/hay and etc...), then running the zonal statistic on each of those one at a time (not sure if this is necessary or not). 2. By just running the Zonal statistics as Table tool on the full raster. I have tried EVERYTHING (saving it in a personal geodatabase, saving it in a file, getting rid of spaces in file names, making sure zone feature name is less than 17 characters etc...) and I still keep getting either "ERROR 999999" or there is no error at all under messages or even an indication that it has stopped, instead the red X circle just appears next to it with no message. I attached a screenshot of what that second occurrence looks like. Does anyone have any idea what I might be able to do to make this tool work? And do I need to be performing the "Extract by Attributes" tool or should the Zonal Statistics tool be able to sum up each type of cell (e.i. deciduous forest, developed land etc..) individually in each county?
... View more
07-17-2017
03:57 PM
|
0
|
16
|
8201
|
POST
|
Yes I did. Now Im just having that issue where the graded colors only show up for the first year.
... View more
05-19-2017
12:03 AM
|
0
|
1
|
862
|
POST
|
Thank you! I can't believe I missed that. Now that I got that to work, the graded colors are only showing up for the first year (2000) in the time slider. It definitely can tell the difference between the year's data because the 2000 map here on the time slider matches my original year 2000 map. I tried to flip through the time slider and set the symbology for each year, but that did not work. Do you have any idea what I could do to solve this problem?
... View more
05-18-2017
07:35 PM
|
0
|
3
|
862
|
POST
|
I cant use classes anymore, because of the new way the data is organized and that there are 15 years worth of data for each county instead of 1 (which was the case when I successfully made the first one for 2015). Now, I have to use "Unique values" under "Categories" instead of "Graded colors" under "Quantities" (under graded colors now the value options just say 'none'). Because of this now, I dont have the option to create classes (shown in the last photo). I am wondering how to either make the values work again under "graded colors" so that I can use the classes option and make them into ranges, or make this all work that way under "categories". The issue is just that now the data has been transposed, so instead of me having individual maps where each one just had a field called Cases2015 or Cases 2014, and etc with each corresponded to a county, now, there is one field called years which contains all the years and then a column for counties, but instead of there being a single county row and then case # values under each year, each county has a row for every year. So, for example, there will be a row for Weston county in 2015 with the number of cases that year, Weston in 2014 with the number for that year and so on, as shown in the first picture.
... View more
05-18-2017
03:53 PM
|
0
|
5
|
862
|
POST
|
They range from 0 to around 1000. The problem is that when I try to create a graded color scale, I instead get something that looks like the photo I just added to my original post, and it does not let me create "ranges" to symbolize certain colors like I did before the data table was transposed. For example 0=lightest, 1-25 =light purple, ..... 700-1000=darkest.
... View more
05-18-2017
02:37 PM
|
0
|
7
|
862
|
POST
|
I am working on a thesis where I have data from 2000-2015 that shows lyme disease cases by county for each year. This data has been joined with a county shapefile and I used graded colors based on number of cases/county. I want to use a Time Slider to show the progression each year, and I had to put all the years in one dbf and "transpose" them to get the years in one column (losing the graded colors). Now I have the time slider set up, but I am trying to figure out how to create graded colors again for each county (separated by year) so that the spread can be shown over time using the slider, but I cannot figure out how to do that. I have attached a photo of what the new time slider (aka transposed) attribute table looks like. If you were to scroll down it would continue on showing each county's data. How can I create graded colors from this? (It is already joined with the county shapefile). My second to last picture shows what the graded colors section looked like before I transposed the data and included all 15 years worth of data, instead of just one (in order to use the timeslider). The graded colors section no longer worked when all 15 years were present and transposed. So, instead I had to use the "unique values" option under Categories and use a color ramp, but then what I got is shown in the last picture. I am wondering how to basically get the same results as I did before transposing and when there was only one year's data present, but I want it to show for every year so I can make the time slider.
... View more
05-16-2017
03:16 PM
|
0
|
10
|
2163
|
Title | Kudos | Posted |
---|---|---|
1 | 07-20-2017 12:26 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|