MapWinGIS:Shapefile QuickPoints
From MapWindow GIS
QuickPoints
Gets all of the points in the specified shape in the shapefile. Note: Use this method to get all of the specified points from a shape in the shapefile when speed is essential.
VB.NET Usage
Function QuickPoints(ShapeIndex As Integer, ByRef numPoints As Integer) As Double
Parameters
|
ShapeIndex | The index of the shape for which all points are required. |
| numPoints | Reference parameter. The number of points in the shape will be returned through this parameter. |
| ReturnValue | An array of all the points in the specified shape will be returned. The points are ordered as follows: (x1, y1, x2, y2, ... , xn-1, yn-1, xn, yn) n = numPoints. |
Sample Code
Private Sub QuickPoints()
Dim sf As New MapWinGIS.Shapefile()
Dim point As New MapWinGIS.Point()
Dim x() As Double, y() As Double, points() As Double
Dim i As Integer, numpoints As Integer
'Get the x and y coordinates of all points in shape 0 using the fastest method available
points = sf.QuickPoints(0, numpoints)
'Get the x and y coordinates of all points in shape 0 using the slowest method available
For i = 1 To sf.Shape(0).numPoints
'Get the current point in shape 0
point = sf.Shape(0).Point(i)
'Get the x and y coordinates of the current point
x(i) = point.x
y(i) = point.y
Next
End Sub
VB 6 Usage
Function QuickPoints(ShapeIndex As Long, ByRef numPoints As Long) As Double
Parameters
|
ShapeIndex | The index of the shape for which all points are required. |
| numPoints | Reference parameter. The number of points in the shape will be returned through this parameter. |
| ReturnValue | An array of all the points in the specified shape will be returned. The points are ordered as follows: (x1, y1, x2, y2, ... , xn-1, yn-1, xn, yn) n = numPoints. |
Sample Code
Private Sub QuickPoints()
Dim sf As New MapWinGIS.Shapefile
Dim point As New MapWinGIS.point
Dim x() As Double, y() As Double, points() As Double
Dim i As Long, numpoints As Long
'Get the x and y coordinates of all points in shape 0 using the fastest method available
points = sf.QuickPoints(0, numpoints)
'Get the x and y coordinates of all points in shape 0 using the slowest method available
For i = 1 To sf.shape(0).numpoints
'Get the current point in shape 0
Set point = sf.shape(0).point(i)
'Get the x and y coordinates of the current point
x(i) = point.x
y(i) = point.y
Next
End Sub
















