Re: Need to create a polygon shapefile from a binary mask... any functions that could help? [message #88890 is a reply to message #88885] |
Tue, 01 July 2014 12:00  |
ca11h
Messages: 3 Registered: June 2014
|
Junior Member |
|
|
Hey STSCI!
Unfortunately the masks I'm going to need to do this with vary... some may have just one grouping of 1's, some may have many...
Using contour seems like a good idea...I'm going to give what you wrote a try and I'll also let you know if I find anything.
Good to know I'm in the same boat with someone else!
On Tuesday, July 1, 2014 11:19:51 AM UTC-4, rr...@stsci.edu wrote:
> Hi FSU
>
>
>
> I've been trying to do the same thing. I don't have anything working, but this is what I planned to try...
>
>
>
>
>
> Does the mask have multiple "masks?" Or is it just one monolithic thing? if it's just one grouping of 1s and 0s, then I think this might work... Myabe.... I haven't tried it, but this is where I was going to start.
>
>
>
> Use the contour procedure. Set the parameters to only contour the 1s. Use the XY_PATH variable to have it return the xy values of the contour. We might need to monkey around with the settings on how contour smooths (if it does).
>
>
>
> If you have multiple regions, then I think we to use label_regions in a clever way to go through and contour each region separately and default to the previous.
>
>
>
> I'm going on a trip for the Fourth, but I'll be working on this problem with my laptop. If I get anywhere, I'll drop you a line here.
>
>
>
>
>
> -Russell
>
>
>
>
>
>
>
> On Sunday, June 29, 2014 5:49:07 PM UTC-4, ca...@my.fsu.edu wrote:
>
>> Hey guys, I have a binary mask (just 1s and 0s) and I need to somehow extract the polygons (1s) out of there and convert them to a shapefile. Well all the documentation I've found seems to suggest that I need all the vertex data for each of the polygons I want to add, and I need to add them one by one... is there any other way to go straight from binary mask -> shapefile?
>
>>
>
>>
>
>>
>
>> If not, is there anyway to extract the polygons from the binary mask easily?
>
>>
>
>>
>
>>
>
>> Thank you all for the help, finding help online for IDL is painstakingly frustrating sometimes, as I'm sure you all know...
>
>>
>
>>
>
>>
>
>> Also does anyone have any examples of creating a polygon shapefile? Documentation only has examples for a point shapefile...
|
|
|