Need a vector generalization procedure in ENVI [message #39163] |
Mon, 19 April 2004 00:54 |
wl2776
Messages: 13 Registered: February 2004
|
Junior Member |
|
|
Hi all.
I have a file with vector polygons.
The vertice coordinates are in map projection (stereographic in my
case).
I convert this file to the format of ESRI Shapefile. Vectors in this
format can have a set of attributes.
I need to write to the attribute a mean value of image pixels
surrounded by the polygon.
I create a ROI, transfer map coordinates to the image pixel
coordinates using envi_convert_file_coordinates, assign these image
pixel coordinates to the ROI, then use envi_get_roi_data to get array
of pixel values.
But envi_get_roi_data returns the error: "Not enough valid and unique
points specified".
The reason is: the sample polygon has 4 vertices and surrounds 2
pixels.
After transferring map coordinates to image coordinates I get the
arrays looking like following: xpts=[3155, 3156, 3156, 3155, 3155],
ypts=[24, 24, 26, 26, 24]
As far as I can understand, Envi_get_roi_data needs the arrays like
xpts=[3155,3155], ypts=[24, 25]
Could anyone advise me some algorithm to transform a polygon from map
coordinates to image coordinates?
The polygons can be of various form, not only rectangular, but small
in size.
I tried search in help systems of both IDL and EnVI, but didn't find
anything.
Thanks in advance.
|
|
|