You can use this code in the MapBasic window, or use the SQL Query:

Select * from Points_Table, Region_Table where Points_table.Obj
intersects Region_Table.Obj into Selection

You may want to use "Contains" rather than "Intersects" depending on
what data you want to obtain.

Good Luck.


Eliz.

-----Original Message-----
From: Robert DeRubeis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 19, 2004 1:39 PM
To: MapInfo Listers
Subject: MI-L mapbasic code to select pts within regions

Hi all,

I'm trying to create an mb to do the following- 1)select all points from
one table that fall in a certain region in another table, then 2) save
them to a new table with the name of the region it fell in.  

For example, if I had a point table (cities) and a region table (usa),
select all cities that fall within each seperate state boundary.  The
end
result would be 50 seperate tables saved as citiesAL, citiesAZ,
citiesCA,
etc.  Each new table created would contain only city points that fell
within that state boundary.

I can do this in MIPro with the boundary select tool, but would have to
manually select inside each state, then do a save copy as, give it a
name,
etc 50 times.

Any help is very appreciated.
Thanks,
Bob


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10531


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10534

Reply via email to