Export Listview to SHP

Mar 24, 2015 at 5:17 PM
Hi

I am using VB.NET is it possible to export Listview to SHP point

I have list with house number and X Y and need to export it to SHP file

do anyone have sample or can help me with this

regards
sigster
Mar 25, 2015 at 2:07 PM
Hi

I do it this way in my application.
Private Const SaveShapeFileDialogFilterText As String = "Shape Files (*.shp)|*.shp"

_myPoints = New FeatureSet(FeatureType.Point)
_myPoints.Name = "Houses"
_myPoints.Projection = KnownCoordinateSystems.Geographic.World.WGS1984

For i = 0 To listView1.Items.Count - 1
                    Dim c As New Coordinate("Your Lon coordinate", Your Lat coordinate) ' read coordinate from listview
                    Dim p As New DotSpatial.Topology.Point(c)

                    Dim currentFeature As IFeature = _myPoints.AddFeature(p)
                    
                    currentFeature.DataRow("ID") = "Your house number"

 Next


If listView1.Items.Count  > 0 Then

                    Dim dlg = New SaveFileDialog() With {.Filter = SaveShapeFileDialogFilterText, .SupportMultiDottedExtensions = True, .FileName = _myPoints.Name}
                    If dlg.ShowDialog(Me) = DialogResult.OK Then
                        _myPoints.SaveAs(dlg.FileName, True)
                    Else
                        Exit Sub
                    End If

  End If

Dim pointLayer As IMapPointLayer = CType(Map1.Layers.Add(dlg.FileName), IMapPointLayer)
                    
                    pointLayer.Symbology.ClearCategories()
                    pointLayer.DataSet.FillAttributes()
        pointLayer.AssignFastDrawnStates()
                    Map1.Refresh()
Apr 20, 2015 at 1:27 PM
Thanks ambiente :)

have you use this to import SHP to Autocad map then you can get X.Y and the text into Mtext or Quick leader

Regards
Sigster