Hi,
I am trying to create a mask from a shapefile containing vectors (not polygons) using IDLanROIGroup->ComputeMask. I get as far as creating the ROI group containing all my vector data from the shapefile, then I apply ComputeMask but the result is an empty mask... why is this? could you spot if I am missing anything? - Thanks!
Here is my code:
function Rasterize_vector_data, path_vector_data
myShape = OBJ_NEW('IDLffShape', path_vector_data)
myShape->GetProperty, N_ENTITIES=num_vectors
size_mask = [1071, 1390]
;init the object where all vectors are going to be stored as ROI
roi_group = OBJ_NEW('IDLanROIGroup')
;for each vector in the file, get the vertices and create a mask
vect = 0
for vect = 0L, num_vectors-1 do begin
entity = myshape->GetEntity(vect, /ATTRIBUTES)
vertices = *entity.VERTICES
roi_vector = OBJ_NEW('IDLanROI', vertices)
;Add the vector to the group
roi_group->Add, roi_vector
endfor
;create mask from group
mask = roi_group->ComputeMask(DIMENSIONS=size_mask, MASK_RULE=0, INITIALIZE=0)
RETURN, mask
end
|