Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Recently I have worked with some raster dataset. And I found there are different kind of raster dataset. Till now I have worked with grid type raster dataset and my add-in works fine with this type. But recently I tried to work with a tiff type raster dataset and the tool didn't work properly. I couldn't find any problem with my code and after converting that tiff data to grid format also worked fine. So, I think data is valid and also my code is okay too.

Here is my question now: is there any difference between different type of raster from a programmer perspective? There I found another question like mine. But that answer is not from programmer's perspective and also an old thread.

I am using arcgis 10.0. I use arcpy and arcobjects.net both in my add-in.

EDIT: After investigating a lot, I found some strange things. To describe those, need to describe the process.

Process Description:

  1. I exported a raster in tiff format.
  2. Copy that raster to a different folder.
  3. I did Fill (Spatial Analyst) through arccpy on copy tiff raster.

the Fill (Spatial Analyst) tool gives a wrong output for copy tiff raster. And of course from my arcpy code also. And that was the reason behind posting this question. But suddenly I noticed that, the exported tiff raster gives correct output for Fill (Spatial Analyst) tool.

The value of the copy tiff raster is same as exported tiff raster but the range of highest value and lowest value is changed. And most important thing is, when I clipped from copy tiff raster, then the clipped raster also gave correct answer.

value range of two rasters

What can be the problem with this raster? Why does it behave this way? Does this problem can occur any time?

share|improve this question
    
As in the link, it depends on the API that you are using. Are you using a specific interface that is valid only for a grid? What exactly are you trying to do in the addin? –  Devdatta Tengshe May 30 '13 at 5:25
    
Sorry that I forgot to mention that. I am using arcobjects.net and arcpy –  Emi May 30 '13 at 5:38
1  
With ArcPy/ArcObjects, what you describe will be a relatively rare event. I suspect that it will probably be something specific to this particular Tiff and/or the tools you use. Without more information it is difficult to comment. What error message do you get and in your code, when it fails, what API call are you making? Finally, how did you convert it to a grid? –  MappaGnosis May 30 '13 at 6:54
    
@MappaGnosis: as you said it is a problem with the raster, not with my process. I have edited my question. –  Emi Jun 3 '13 at 3:17
    
@Kirk Kuykendall: you have changed my question. it was not what I asked. –  Emi Jun 4 '13 at 5:44
show 1 more comment

1 Answer

There are a number of issues which could be at play here:

  1. You probably changed your data by using 'Fill' because it is designed to change data by filling hydrological sinks. 'Copy Raster' is the correct tool for copying rasters.
  2. Clipping can change the max/min values because your resultant dataset is not the same as what you put in unless you clipped to the exact same extent as the original data, in which case ArcMap probably is calculating statistics on the output.
  3. To be sure you are seeing the correct data range in ArcMap, you should calculate statistics (if necessary killing any associated .aux file first). If statistics have not been calculated you might just be seeing the possible extents given the bit-depth and signing of the raster rather than the actual max/min. ArcMap will automatically calculate statistics on the output of many operations and that alone might be the explanation for the differences you are seeing.
  4. Careful consideration of the effects of NoData is important with rasters. If your original raster did not have NoData explicitly defined, that could skew the min value. Clipping may have removed this extraneous undefined NoData and thereby apparently "corrected" the issue. Reclassifying may have been a better option depending on your data.
  5. Are you certain that your original file really was a GeoTiff and not just a tiff containing geographic data? A GeoTiff will contain information on projections, origin and NoData values in the header. A plain tiff will not and you must treat it a little differently.

Without seeing your original data I can't how many of the above issues apply but the statistic issue is a very common 'gotcha' along with undefined NoData values.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.