Thanks for your help I debugged The script and it gives an area for the veg object and Index object but for the resultant overlap object the area is Zero. Has anyone got any ideas why?
Thanks in advance Sam -----Original Message----- From: Martin Higham [mailto:[EMAIL PROTECTED] Sent: Friday, 2 April 2004 11:43 AM To: Sam Shelley Subject: RE: MI-L Clipping problems Add some debugging messages so you can see whats going on. For example: Print Area(VegObj, "sq km") + " " + Area(IndexObj, "sq km") ClipArea = Overlap(VegObj, IndexObj) Print Area(ClipArea, "sq km") If ClipArea doesn't exist then the second print might crash, otherwise it will show you the area of the resulting object. Hope this helps. Best Regards, Martin Higham Avantra Geosystems ph (61 3) 8504 0428 0425-730-428 fx (61 3) 9596 7997 www.avantra.com.au > -----Original Message----- > From: Sam Shelley [mailto:[EMAIL PROTECTED] > Sent: Friday, 2 April 2004 11:21 > To: [EMAIL PROTECTED] > Subject: MI-L Clipping problems > > > Hi All, > > > > I'm am having a lot of trouble with clipping one layer based on objects > in another layer using MapBasic here is the code I'm using. I keep > getting the error message "Cannot insert empty object into Table or > Layout. Out of diskspace when editing table ClipAreaTable." I know > that there should be an object as a result of the overlap. Any > suggestions would be greatly a[ppreciated as I am getting desperate. > > > > Thanks Greatly > > > > Here's the code: > > > > Include "mapbasic.def" > > Include "menu.def" > > > > Declare Sub vegetationManager > > Dim IndexObj As Object > > Dim VegObj As Object > > Dim ClipArea As Object > > Dim VegTable As String > > Dim IndexTable As String > > > > > > Global s_filename_newarr As String > > > > Sub VegetationManager > > close all > > s_filename_newarr = ReadControlValue(101) > > Open Table s_filename_newarr > > Open Table "M:\Map\Data\Data-25K\Index25k.TAB" > > > > VegTable = TableInfo(1, TAB_INFO_NAME) > > IndexTable = TableInfo(2, TAB_INFO_NAME) > > > > Select * > > From VegTable > > Into VegSel > > > > Set Target On > > > > Map From VegSel, ClipRegion > > Set Map > > Layer 1 Editable On > > > > Select * From VegSel > > > > Select * > > From IndexTable > > Where RowID = 50 > > Into ClipRegion > > > > IndexObj = ClipRegion.obj > > VegObj = VegSel.obj > > > > ClipArea = Overlap(VegObj, IndexObj) > > > > Create Table ClipAreaTable > > (Name Char(30)) > > File "C:\Documents and Settings\sams\Desktop\ClipAreaTable" > > Create Map > > For ClipAreaTable > > Insert into ClipAreaTable (Obj) > > Values (ClipArea) > > > > Map From ClipAreaTable > > > > End Sub > > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11236
