I just wanna to Clip two shapefile. There is an API function format :
sfInput give Resulting shapefile has no shapes
sfOverlay give No Error
sfClip give Null Reference set to an instance of an object
how I can fix this? Is there any mistake?
Shapefile.Clip (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
I start to write this. Dim sfOverlay As New MapWinGIS.Shapefile
Dim sfinput As New MapWinGIS.Shapefile
Dim sfClip As New MapWinGIS.Shapefile
Dim index1 As Integer
Dim index2 As Integer
index1 = CbBInputLayer.SelectedIndex
index2 = CbBOverlayClipLayer.SelectedIndex
sfinput = FormMain.AxMapMain.get_Shapefile(index1)
sfOverlay = FormMain.AxMapMain.get_Shapefile(index2)
sfClip = sfinput.Clip(False, sfOverlay, False)
If sfClip Is Nothing Then
MessageBox.Show("Failed to calculate Clip :" + sfinput.ErrorMsg(sfinput.LastErrorCode))
MessageBox.Show("Failed to calculate Clip :" + sfOverlay.ErrorMsg(sfOverlay.LastErrorCode))
MessageBox.Show("Failed to calculate Clip :" + sfClip.ErrorMsg(sfClip.LastErrorCode))
Else
shape2.Add(sfClip)
End If
the results is NothingandsfInput give Resulting shapefile has no shapes
sfOverlay give No Error
sfClip give Null Reference set to an instance of an object
how I can fix this? Is there any mistake?