How to Buffer a point

Dec 11, 2013 at 11:04 AM
I need assist how to create buffer shapefile point.i just can open the shape file here is my source code with VB.6

Private Sub cmdopenbuffer_Click()
Dim sf As New MapWinGIS.Shapefile
sf.Open ("")
Map1.AddLayer sf, True
End Sub
Dec 12, 2013 at 10:06 AM
Here's some code. Not tested!
And I'm a C# developer and not a VB.NET developer ;)
-- Open input shapefile:
Dim sf As New MapWinGIS.Shapefile
sf.Open ("") -- input shapefile

-- Create output shapefile
Dim sfBuffer As New MapWinGIS.Shapefile
sfBuffer.CreateNewWithShapeID("", ShpfileType.SHP_POLYGON)
-- Optional add additional fields
Dim i As Integer = 0
While i > sf.numShapes
    -- Create output shape:
       Dim shpBuffer As New MapWinGIS.Shape
       -- Buffer
       shpBuffer = sf.Shape[i].Buffer(distance, 16)
      -- Add buffered shape to output shapefile:
      Dim index As Integer = sfBuffer.NumShapes;
      If Not sfBuffer.EditInsertShape(shpBuffer, index) Then
          MessageBox.Show("Failed to insert shape: " + sfBuffer.ErrorMsg(sfBuffer.LastErrorCode))
      End If
      -- Optional: fill additional fields
End While

-- Optional save output to disk:

-- Add shapefiles to map:
Map1.AddLayer sf, True 
Map1.AddLayer sfBuffer, True 
Marked as answer by mohammad_ardha on 12/13/2013 at 7:03 PM
Dec 14, 2013 at 3:03 AM
Thannks Your assist because I am a beginner for programming especially for basic education is geography so this script is helpful me.