Hi
suppose you have a table of region TableRegion
a table of particules TablePoints
a field in table TableRegion named particulesCount for stock the number of
particules within each region
read this MapBasic code...
dim i as Integer
i = 1
Fetch First From TableRegion
Do until EOT(TableRegion)
Select * From TablePoints
Where obj Entirely Within TableRegion.obj
Update TableRegion
Set particulesCount = SelectionInfo( SEL_INFO_NROWS)
Where RowID = i
i = i + 1
Fetch Next From TableRegion
Loop
___________________________________
|| // Antoine Gilbert
|| // [EMAIL PROTECTED]
|| // #ICQ 9737371
|| \\
|| \\ Le Groupe KOREM Inc.
|| \\ http://www.korem.com
3360, rue de La Perade, bureau 200
Sainte-Foy (Qc) CANADA G1X 2L7
___________________________________
----- Original Message -----
From: Elliot Tinton EG CEFAS (DN=EJT00, RECIPIENTS, LOWESTOFT, CEFAS)
<[EMAIL PROTECTED]>
To: 'MAPINFO-L' <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 1999 11:15 AM
Subject: MI Counting particles contained in regions
>Hello All,
>
>Can anyone tell me whether there is a way to count up the number of point
objects from one table that are contained within certain regions in another
layer and add the count to a table. I have a table of points which are
particle positions from the output of a model. I also have a grid which
makes up many rectangular regions over the area. I want to count the number
of particles contained within each grid section and add the result as a
column in the table so that I can thematically map the result. I could do
this by changing my model so that it does the calculation before outputing
the point positions but this may take a lot of time and I was wondering if
there is an easier way via mapinfo.
>
>Alternatively, I could make up regions from a grid which can have
differing lon and lat increments so that the mapinfo grid can each time
match the grid from my model. I can't find a way to do this either as the
gridmaker always keeps the grid spacing the same in x and y.
>
>Any help would be greatly appreciated
>Thanks very much
>
>Elliot Tinton.
>CEFAS
>Lowestoft
>Email [EMAIL PROTECTED]
>
>
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]