This project is read-only.

Noob question: how to retrieve X Y from pointshape

Mar 5, 2013 at 12:31 AM
Hello reader

sofar i have a pretty complex programm but somehow i still cant retrieve the X Y from a layer/shapefile

for now i make extra fields in the shape to add the X and Y and later i retrieve those, but stupidly i can not find a way to retrieve the X and Y from a datatable directly from the originated shape..... any idea on this?
            Dim fs As New FeatureSet
            fs = FeatureSet.Open(Form1.AdressenPADNAAMtext.Text)
            fs.Projection = Form1.myVenster.Projection
            Dim dt As DataTable = fs.DataTable
            Dim coor As Coordinate() = New Coordinate(dt.Rows.Count) {}
            For AdresRij = 0 To dt.Rows.Count - 1
                AdresX = dt.Rows(AdresRij)(Form1.ComboBoxXadres.Text)
                AdresY = dt.Rows(AdresRij)(Form1.ComboBoxYadres.Text)

and so on
Mar 5, 2013 at 1:45 AM
check this...
shapeActual=CType(FeatureSet.Open(path & nameShape & ".SHP"),FeatureSet)
For i As Integer=0 To shapeActual.Features.Count-1
    MsgBox(CStr(shapeActual.Features.Item(i).Coordinates.Item(0).X) & ";" & CStr(shapeActual.Features.Item(i).Coordinates.Item(0).Y))
Mar 5, 2013 at 2:03 AM
Edited Mar 5, 2013 at 2:09 AM
is the same for the other geometries....
Mar 5, 2013 at 10:54 AM
Edited Mar 5, 2013 at 10:54 AM
tx Camiza..... :o) strangely I have found that nowhere.... so big thanx from the Netherlands!
Mar 5, 2013 at 11:34 AM
yup this worked.... thx
 Dim fs As New FeatureSet
            fs = CType(FeatureSet.Open(Form1.AdressenPADNAAMtext.Text), FeatureSet)
            fs.Projection = Form1.myVenster.Projection
            Dim dt As DataTable = fs.DataTable

            For AdresRij = 0 To fs.Features.Count - 1
                AdresX = CStr(fs.Features.Item(AdresRij).Coordinates.Item(0).X)
                AdresY = CStr(fs.Features.Item(AdresRij).Coordinates.Item(0).Y)
May 27, 2013 at 9:38 PM
Edited May 27, 2013 at 11:16 PM
oops wrong