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

Reply via email to