Quantcast
Viewing all articles
Browse latest Browse all 2341

New Post: Clip two Shape with Mapwingis : Resulting shapefile has no shapes?

I just wanna to Clip two shapefile. There is an API function format :
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 Nothingand

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?

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>