<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <DEFANGED_meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I don't have GRASS working on my computer to check this out, however,
here is a procedure to calculating the center of a shape:<br>
<br>
Assume you have a raster map "shape" where the value of 0 is at all
places w/out the shape and a positive value where the shape is located
at.<br>
<br>
1) Find the total volume of the shape w/:<br>
<br>
1a) r.mapcalc command function:<br>
one = "1"<br>
<br>
1b) r.volume d=shape clump=one<br>
<br>
(There should be a better way of doing this.)<br>
<br>
2) Calculate volumeOnAxis of shape in North-South dimension with the
r.mapcalc command:<br>
<br>
NSvolumeOn = shape * y()<br>
<br>
3) Calculate massOnAxis of shape in East-West dimension with the
r.mapcalc command:<br>
<br>
EWvolumeOn = shape * x()<br>
<br>
4) Find the total volume of NSvolumeOn with:<br>
<br>
r.volume d=
NSvolumeOn clump=one<br>
<br>
5) Find the total volume of EWvolumeOn with:<br>
<br>
r.volume d=
NSvolumeOn clump=one<br>
<br>
6) The coordinates of the center will be <br>
east = total volume of EWvolumeOn / volume of shape<br>
north = total volume of NSvolumeOn / volume of shape<br>
<br>
A little csh and awk programming could replicate Idrisi's center
program.<br>
<br>
&lt;INSERT DISCLAIMERS ABOUT USING AT OWN RISK...&gt;<br>
<br>
sincerely, chuck<br>
<br>
Markus Neteler wrote:<br>
<blockquote cite="mid20050603142536.GI18457@thuille.itc.it" type="cite">
  <pre wrap="">On Thu, Jun 02, 2005 at 03:42:36PM -0400, Jason Horn wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Does anyone know of a way to calculate the center of a shape in a  
raster file based on shape and pixel values?  For example, imagine a  
NEXRAD RADAR image showing a storm cloud.  Could GRASS be used to  
calculate the center of the cloud?  I'm not having any luck finding a  
grass raster function to do this.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I did a quick google search for
 nexrad storm cell identification 
or
 nexrad  SCIT
which a couple of hits. Some programming might
be needed. I don't know if these algorithms are freely
available.

Markus

  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Chuck Ehlschlaeger, Associate Professor &amp; GIS Center Director
Department  of  Geography,      Western  Illinois  University
306C Tillman Hall,  1 University Circle,  Macomb,  IL   61455
<a class="moz-txt-link-abbreviated" href="mailto:cre111@wiu.edu">cre111@wiu.edu</a>,    phone: 309-298-1841,     fax: 309-298-3003</pre>
</body>
</html>