habitat mask from shapefile

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

habitat mask from shapefile

Postby howeer » Tue Jul 06, 2010 10:16 am

Hi,
In the past, I've imported ArcInfo shapefiles into DENSITY to generate habitat masks (as text files) that exclude open water from the grid, and read them into secr.
Is it possible to generate masks from trap files/objects and shapefiles from within secr?
Is it possible to adjust the spacing of points in masks generated in DENSITY from within secr?
Thanks,
Eric
howeer
 
Posts: 39
Joined: Wed Jun 21, 2006 10:49 am

Re: habitat mask from shapefile

Postby murray.efford » Tue Jul 06, 2010 2:21 pm

Eric
You've put your finger on one area where Density is more flexible than secr. You are really on your own when it comes to constructing masks from shapefiles in secr. There are packages that support input of shapefiles, but I haven't attempted to interface to them. The make.mask() function includes a rudimentary ability to clip a new mask to a polygon, but I know you need something more powerful. Nor is there a packaged way to thin an existing mask. I'll have to think whether there is a meaningful way to combine cells for a future version, but this is not going to help you now, I'm sorry. Maybe just export from Density as long as it works for you?
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: habitat mask from shapefile

Postby Antie66 » Fri Oct 26, 2018 11:08 am

I realise this is a very old post, but I am having a similar problem. I am after a density estimation for a squirrel population whereby the forest we trapped in was surrounded by open fields (i.e. non-habitat). I have an ESRI shapefile, that I read into DENSITY and exported as a txt file (clippedmask.txt). It has two "segments" (these must be because of open areas within the shapefile) and the text file looks somethign like this (obv with coordinates instead of xy and many more of them):
[Segment1]
x y
x y
x y
....
END
[Segment2]
x y
x y
....
END
END

My question is how am I able to use this txt file into secr. I'm not very familiar with R, so a step-by-step explanation or script would be very helpful. How do I read the text file in (presumably as an object?) and secondly how do I then use it in the secr.fit function instead of the buffer distance?

Many Thanks Louise
Antie66
 
Posts: 1
Joined: Tue Nov 21, 2017 12:03 pm

Re: habitat mask from shapefile

Postby murray.efford » Fri Oct 26, 2018 3:25 pm

Ah... That file is in ESRI vector export format, which is no use to 'secr'. I think you need to select the other option on the Tools | Export menu (Coordinates of mesh). Then import those coordinates in 'secr'
Code: Select all
msk <- read.mask('mesh.txt')
secr.fit(ch, mask = msk)
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 8 guests