To clarify, are the points and the regiopns part of the same TAB. That is,
does the Access_Routes.TAB contain both the points you want to count and the
regions you want to the points to be counted in?
The method I mention works if they are in 2 separate TAB's.
You could try: Select column: Count(*)
From Table: Access_Routes, Selection
Where condition: Access_Routes Within Selection
Group by column:
Ordered by column:
Into table name: NoOfPoints
This assumes that "Selection" is a TAB that has the regions that contain the
points you want a count of. If you have selected the region, Mi might refer
to this as Query1 (or Query2, or..... depending on how many times you have
selected something).
If the regions and points are in the same TAB, I'd recommend selecting them
into a separate TAB first. It is just good practise, in my opinion, to
always keep different object types (point, line, region, text) in separate
TABS. It may LOOK fine when used on a map, but can make queries or analysis
more of a pain than need be.
Hope this helps.
Don Mitchell
-----Original Message-----
From: Alireza [mailto:[EMAIL PROTECTED]
Sent: September 15, 2004 10:17 AM
To: 'Hughes, Colleen / Don Mitchell'
Subject: RE: MI-L How can I count number of points in a region?
Hi
Thanks for your email, but sorry I could not do it, although it is easy, but
something should be missing.
I have a table named Access_Routes.TAB, there are two region each on
contains some points, I selected one region, then I went to Sql, there are
some parts need to be filled and this is the way I filled out, which does
not work!
Each point has a value in a column named Ms in the browser table.
Select column: *
>From Table: Selection
Where condition: Count(*)
Group by column:
Ordered by column:
Into table name: NoOfPoints
This one does not work. Would you help me out?
Thanks
-----Original Message-----
From: Hughes, Colleen / Don Mitchell [mailto:[EMAIL PROTECTED]
Sent: 15 September 2004 15:11
To: 'Alireza'; [EMAIL PROTECTED]
Subject: RE: MI-L How can I count number of points in a region?
Hi Ali,
If you open the MapBasic window in MI Pro and run an SQL query for a count,
you get:
Select Count(*) from Points_tab, Polygon_tab where Points_tab.Obj Within
Polygon_tab.Obj into Selection
This will give you the number of points within a polygon. I hope this helps
get you started.
Don Mitchell
-----Original Message-----
From: Alireza [mailto:[EMAIL PROTECTED]
Sent: September 15, 2004 9:46 AM
To: [EMAIL PROTECTED]
Subject: MI-L How can I count number of points in a region?
Hi
Does any one know how I can count number of points in a region using
Mapbasic in Mapinfo??
Thanks
Ali
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13350