Hello-
I'm a fairly inexperienced IDL user, but I'm working with someone who has considerably more experience and we're both stumped. Here's what we're trying to do. It's a bit complicated (at least to me!), so I hope this makes sense:
We have an ENVI file classified into 5 classes. Our hope is to randomly generate 30 lat/long points within EACH class (30 points/class), so that the random points can be identified in ArcGIS and compared to a high-resolution image to validate the classification. Good so far?
Here's what we did in IDL, an example for one of the 5 pixel values... let's say a value of 3:
opened file info, extracted dimensions, etc
found locations of all the pixels with a value of 3 in a 1-D matrix
converted these to a 2-D matrix of locations (X and Y values)
generate a random sample of 30 of these pixel locations
Extracted the locations as UTM coordinates
converted the UTM coordinates into actual lat/long values (decimal degrees)
export these coordinates as a text file
That all went off without a hitch. Then when I opened the classified image in arc (I tried both a .tif and an ENVI format file) and searched the output coordinates, they were inaccurate. Not far off (they were in the correct geographical area), but the coordinates did not represent the correct pixel type, or indeed, any single consistent pixel type.
Does anyone know where we went wrong? Is it just an issue of accuracy, or switching from ENVI to Arc? I'd be happy to supply the code, there's just sort of a lot of it. I'm new to IDL and these forums, so my apologies if I was too general. Thanks!
Cheers,
Emma
|