## NAME

s.territory - Calculates territory consumption for animal based on distributed positions.
(GRASS Sites Program)

## SYNOPSIS

s.territory
s.territory help
s.territory rast=value sites=name [output=name] [claim=name] [thresh=name] [incr=name]

## DESCRIPTION

s.territory calculates territory consumption for animal based on distributed positions.

## OPTIONS

### Parameters:

rast=value
  Name of incidence or density file
sites=name
  Name of sites file with threshold locations
output=name
  Name of new sites file to contain radius
claim=name
  Simultaneous growth map. (ignored if site output given)
thresh=name
  Field in sites file containing thresholds. Threshold is target amount of resources that site wants to consume
incr=name
  Field in sites file containing radius increment (meters). incr is radius increment for each iteration
  - default incr is min distance between cells
  - not currently implemented for sequential, only simult.

## NOTES

OUTPUT is a sites file containing:

easting|northing|#cat %threshold %radius

where radius is the minimum radius of a circle which surrounds enough cells in the incidence map to sum up to threshold.
If neither a sites output file nor a claim map is named, output is simply the radius followed by a newline for each site (for easier use in scripts).

EXAMPLES:

- Lion's territory

1. you have sites for lion's lairs with food needs as the "threshold"
2. you have an incidence map for frequency of prey or hunting success probability (Kg/week or something)
3. s.territory creates a circular range for each lair which you might use to create vector or raster files and predict areas of conflict in overlapping "territories"

- School children

1. you have sites for schools with school capacity as the "threshold"
2. you have population density maps for school-age children
3. s.territory creates ranges for each school that encompass an area in which enough children live to fill the school

ALGORITHM:
radius increment set to lesser of ns_res and ew_res
( or incr if given )

for each site
{
for (radius = increment; cells remaining; incr+=incr)
{
sum incidence cell centers which fall within radius
if >= threshold, break
}
}

- implementation (fast, high memory):
  read density map into buffer
  use additional buffer to calculate distances(squared)
  to current site (as needed)
  if distance_squared > prev radius, add it in
- implementation for simultaneous growth (much much slower):
  reads density map, then repeatedly traverses
  output map looking for null cells, then checking to
  see if it's in any of the sites current radius, etc.
- alternatives:

1. let max increase until entire map is covered,
using zero for outside incidence
>>> currently implemented

2. use a rectangular(square) territory rather than circle?

3. somehow "weight" expansion toward successful areas

4. save combined nearest distances map

ADDENDUM

Think about:

1. Make already claimed territory uninhabitable - as each site is
processed, zero out resources within territory.
>>> This can be done in scripts, using masks. (slower though)

2. Instead of just going through in order, attack them all at the
same time, zeroing out resources as it goes and assigning a
category value to a "claim" map.

## AUTHOR

Bill Brown, GMSL, 1999

Last changed: $Date: 2002/01/25 05:45:35 $