Raster to Vector [message #43371] |
Thu, 07 April 2005 11:20  |
julio
Messages: 31 Registered: December 2003
|
Member |
|
|
Hello there,
A have a TIF image and I want to make a raster to vector conversion of
some DN values.
I'm using rtf_doit:
values = [4096] ; the DN I want to convert
l_name = [values]
out_names = dir+'testimg_' + $
strcompress(string(values),/remove_all) + '.evf'
in_memory = lonarr(n_elements(values))
envi_toggle_catch
envi_doit, 'rtv_doit', $
fid=fid, pos=pos, dims=dims, $
values=values, l_name=l_name, $
in_memory=in_memory, $
out_names=out_names
But I have no success... I have the message:
% Subscript range values of the form low:high must be >= 0, < size,
with low <= high: <BYTE ( 179)>.
% Execution halted at: EVF_INIT_FILE
What could be the problem???
Any comments welcome.
Cheers,
Julio
|
|
|
|
|
|
Re: Raster to Vector [message #43443 is a reply to message #43371] |
Fri, 08 April 2005 09:54   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Julio writes:
>
>> This code was copied from ENVI help. I just changed the 'values'
>> field. I don't know what 'rtv_doit' does, so I have bo idea what is
>> the problem with this code. I only want to convert some DN values
>> inside my raster image to vector...
>
> Well, then, you made a mistake when you put "values" inside
> of square brackets. It is not doing what you think it is doing,
> as you would discover if you follow through on my previous
> suggestions. :-)
Sorry, I'm testy this morning. I'm trying to get something done
and I am plagued with e-mails from people not following through
on earlier suggestions. I'm implementing a "Don't Ask If You
Don't Want to Read the Answer" policy from now on. :-)
If you got this code from the ENVI manual, then I am going
to suggest (Heaven forbid!) the manual is wrong, cause that
code don't do what it is suppose to do!
A couple of judicious PRINT statements in or about the location
I suggestion yesterday should prove me right. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: Raster to Vector [message #43459 is a reply to message #43431] |
Thu, 14 April 2005 01:20  |
jnettle1
Messages: 27 Registered: January 2001
|
Junior Member |
|
|
For what it's worth, I don't think the help file is wrong, I think
you've copied it wrong. I think the real problem is that you're
setting l_names wrong. In the example you're giving, values is 4096,
and then you set l_names to the same thing, so l_names is also 4096.
But l_names is supposed to be a string array (l_names stands for level
names). This is how they set it in the example code:
envi_file_query, fid, ns=ns, nl=nl, $
class_names=class_names
pos = [0]
values = [1, 2, 3]
dims = [-1, 0, ns-1, 0, nl-1]
l_name = class_names[values]
where class_names are the names of the classes in the input image.
Yours looks like this:
values = [4096] ; the DN I want to convert
l_name = [values]
Try setting l_name to 'level4096' or something and see what you get.
Jeff
Julio wrote:
> Forget it, David...
> I don't remember how many times you help me with your codes...
> Actually, this IDL group helps a lot of people due to people like you
:-)
>
> regards,
> Julio
|
|
|