Hello,
using the shape.get_XY function which is to prefer over the shape.Point property as described in the documentation does not change the values of x and y with no error (result=True)?
See the following Code:
Dim sh As Shape
Dim handle as Integer = mymap.AddLayerFromDatabase(OGRCONNSTRING,
$"SELECT hek_koordinate{postfix}, km_num FROM hektometer WHERE hek_vo_nummer IN ({voString})",
False)
Dim sf As Shapefile = mymap.get_Shapefile(handle)
sf.FastMode = True
For i = 0 To sf.NumShapes - 1
If sf.Shape(i).numPoints > 0 Then
sh = sf.Shape(i)
' Works not !!! -> x and y always keep their initlal value, result is always true
result = sh.XY(0, x, y)
' Works ->
x = sf.Shape(i).Point(0).x
y = sf.Shape(i).Point(0).y
sf.Labels.AddLabel(Format(sf.Table.CellValue(0, i), "###0.0"), x, y)
End If
Next
Has anyone an idea?
Regards,
Frank