X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 May 2008 03:34 PM by  anon
failed to get dims.....
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
26 May 2008 03:34 PM
    I create a polygon ROI from the shapefile vertices and want to do 'raster to vector' with spatial subseting by 'envi_get_roi_dims_ptr' routine.I have get the DIMS,but it is failed to do 'rtv_doit' ,why? program as follows: envi_open_file,'i:\test.tif',r_fid=ofid envi_file_query, ofid, ns=ns, nl=nl,dims=dims myshape=OBJ_NEW('IDLffShape', 'I:\basin\basin.shp') myshape->GetProperty, N_ENTITIES=num_ent FOR i=0,0 DO BEGIN ent = myshape->GetEntity(i) xmap=(*ent.vertices)[0, *] ymap =(*ent.vertices)[1, *] envi_convert_file_coordinates, ofid, xf, yf, xmap, ymap myshape->DestroyEntity, ent ENDFOR OBJ_DESTROY, myshape filled_poly = polyfillv(xf, yf, ns, nl) ind = array_indices([ns, nl], filled_poly, /dimensions) roi_id = envi_create_roi(color=4, name = 'test roi', ns=ns, nl=nl) envi_define_roi, roi_id, /point, xpts=ind[0, *], ypts=ind[1, *] envi_save_rois, 'i:\test.roi', roi_id envi_doit,'rtv_doit',dims=dims,fid=ofid,values=1,pos=0,l_name='water',out_name='i:\test.evf',in_memory=0

    Deleted User



    New Member


    Posts:
    New Member


    --
    26 May 2008 03:34 PM
    Well, you didn't give us the error message you are getting, but it looks to me like you forgot to actually call envi_get_roi_dims_ptr :) The value of the variable dims is set by the call to envi_file_query in the second line of your code. It doesn't look like it's ever touched again, even after you define the ROI, so when you use that variable when you call rtv_doit, the dims variable does not actually contain the dims pointer that it needs to have in it's first element.
    You are not authorized to post a reply.