Select to view content in your preferred language

Sample Raster Using Points - Issues with Field Names

1316
7
04-27-2010 09:34 AM
PaulKnaga
Emerging Contributor
Hello

I have a point dataset that I need to sample rasters with. I'd like to sample to a shapefile, as I need to to do it stepwise as I need to add columns for statistical queries, etc (as far as I know, ESRI has yet to develop a mechanism for renaming and reordering fields in attribute tables... right?).

All the tools that I can find either make you do it one at a time (Extract Raster to Points) that result in a field name of RASTERVALU, or you can do all the rasters, but it gets spit out into a text file (Sample) which gives you field names of g_g_1, etc.

I have hawths tools, but I find the results are meaningless (upon double checking, the points are not picking up the attributes of the raster pixel they fall in). As wel, it chokes on the large volume of data being processed.

Every dataset is projected in WGS84 UTM Z12N.

Work arounds? Suggestions?
0 Kudos
7 Replies
HarryGibson
Emerging Contributor
Hi,

Just wondering if you ever got anywhere with solving this? I am having exactly the same problem with the Sample tool, in that it results in columns with meaningless names like g_g_g99. I have hundreds of rasters to sample so using any one-at-a-time tools isn't feasible.

From what I can tell it is completely reproducible. I've done all the usual things like making sure the rasters have names < 10 characters, no spaces in the path, etc (although none of these should matter in my original case which was working inside a file GDB). 

As far as I can tell, this tool simply doesn't work, at all, in any situation, which I find hard to believe given the lack of similar complaints that I've found.

Cheers,
Harry
0 Kudos
EricRice
Esri Regular Contributor
Hi there gentlemen.

I have some information regarding ArcGIS 10 and an explanation for you regarding the problem described in this post.  If you are trying to run Sample on raster datasets in GRID format, the resulting fields will have the names you expect. i.e.  the name of the raster.  However, if you use non-ESRI GRID, then you get the weird names like G_G_G7 or similar.  Prior to ArcGIS 10, all input rasters are converted to GRID for Spatial Analyst functions.  So, for example, one of your inputs was "my_really_long_name_dataset.img"; we will convert that to a GRID, but GRID's have a name length limitation.  While in the background it is named G_G_G7 and that becomes the resulting field name in my example. 

Now, in ArcGIS 10, we natively process that IMG (and all other formats) limiting the conversions and scratch files that would normally be created.  A byproduct of this, and in fact an influence on the design was that Sample now returns the field names users are expecting.  There are some caveats, such as output to .dbf which has field name length limitations (not created by ESRI).  If you're migrating to ArcGIS 10, I would also like to inform you about a new tool.  It is called Extract Multi Values to Points.  This new tool is further enhanced by giving the user the option to specifically name the output field.  So if you have "my_really_long_name_dataset.img" and don't want that to be the output field name (in a geodatabase of course), you can name it something more meaningful to you.

ArcGIS 10 will be available this week.  I hope this information is helpful!

Best Regards,
0 Kudos
HarryGibson
Emerging Contributor
Eric,

Many thanks for your feedback. Actually i'd just tried exporting all the datasets to ESRI grid format, which was laborious as I had to reallocate suitable short names for them all, but did indeed work as intended. (One more "undocumented feature" that it would have saved some time if ESRI had documented!!).

However in my detective process of working that out I had wondered if something like that was the case and had tried with some raster that had short names in non-ESRI format: e.g. "test.tif". These didn't work either, but according to your explanation they should?

The new extract multi values tool sounds great. How will it differ from the Sample tool?

Thanks again,
Harry
0 Kudos
HarryGibson
Emerging Contributor
Just digging this old thread back up, as I was re-running the workflow of this project and had cause to use the Sample tool again.

I now have ArcGIS 10 (SP3) installed and from what Eric described hoped that running the tool on non-GRID rasters would now work correctly.

I bet you'll never guess what? That's right! It didn't! Exactly the same behaviour as before.

However, the new Extract Multi Values To Points tool worked just fine (with the default field names being set as the raster names). The only real difference that I can see is that it appends the extracted data to new fields in the input point FC, rather than creating a new table. Still, it's not an enormous hassle to then export the attribute table of the FC and delete the irrelevant fields.
0 Kudos
EricRice
Esri Regular Contributor
Hi Harry,

Very interesting.  I did some testing this morning with Tiff and FGDB rasters along with FGDB points in the Sample tool.  I output my table back to FGDB and to DBF.  I even put rasters of different resolutions into the tool to force resampling behind the scenes (GRID creation) and in all cases I got the correct field names.  The only exception was going to DBF which truncated my longer raster name since DBF has field name length limits.  I continued testing in ArcGIS 10.1 (internal still) and got the same results as 10.0 sp3.  Perhaps you could submit a incident to Esri Support, supply your data and workflow, and we can try to reproduce.  I consider your result a defect.

Best Regards,
Eric
0 Kudos
SeanHandley
Emerging Contributor
Hi, I'm getting spurious results from the "Extract Multi Values to Points" tool for 2 layers that were created from "Make NetCDF Raster Layer". The data are sea surface temperatures with range ~13-10C, but the output data from the "Extract Multi Values to Points" tool are:
"Winter_SST","Summer_SST"
-3.40282001837566e+38,-3.40282001837566e+38
-3.40282001837566e+38,-3.40282001837566e+38
-3.40282001837566e+38,-3.40282001837566e+38
-3.40282001837566e+38,-3.40282001837566e+38....

Any ideas on how to fix? I have exported the layer as .tiff, and attempted extraction with the same result.

Regards... Sean
0 Kudos
SeanHandley
Emerging Contributor
Found my own solution. It turns out there was no Spatial reference created in the Make NetCDF file process... but Define Projection tool didn't work for my files?! I had to edit Spatial reference in ArcCatalog to fix, see:
http://forums.arcgis.com/threads/74063-netCDF-to-feature-raster-problems?p=264007&posted=1#post26400...

Any zero values still extracted as negative values as above, but I can live with that and edit those out manually.
0 Kudos