MapWinGIS:Utils PointInPolygon
From MapWindow GIS
PointInPolygon
Gets whether or not a point lies within the specified polygon shape. Note: There is a faster option available when working with shapefiles: PointInShape.
See also PointInShape and Shapefile Shape and Point
VB.NET Usage
Function PointInPolygon(Shp As MapWinGIS.Shape, TestPoint As MapWinGIS.Point) As Boolean
Parameters
|
Shp | The polygon shape to perform the test on. |
| TestPoint | The point to test whether or not it lies within the specified polygon shape. |
| ReturnValue | A boolean value representing whether or not the point lies within the shape. |
Sample Code
Private Sub UtilPointInPolygon()
Dim utils As New MapWinGIS.Utils()
Dim point As New MapWinGIS.Point()
Dim shape As New MapWinGIS.Shape()
Dim success As Boolean
'Set the x and y values of the point to be tested
point.x = 3000
point.y = 2500
'Check if the point lies within the polygon shape
success = utils.PointInPolygon(shape, point)
End Sub
VB 6 Usage
Function PointInPolygon(Shp As Shape, TestPoint As Point) As Boolean
Parameters
|
Shp | The polygon shape to perform the test on. |
| TestPoint | The point to test whether or not it lies within the specified polygon shape. |
| ReturnValue | A boolean value representing whether or not the point lies within the shape. |
Sample Code
Private Sub UtilPointInPolygon()
Dim utils As New MapWinGIS.utils
Dim point As New MapWinGIS.point
Dim shape As New MapWinGIS.shape
Dim success As Boolean
'Set the x and y values of the point to be tested
point.x = 3000
point.y = 2500
'Check if the point lies within the polygon shape
success = utils.PointInPolygon(shape, point)
End Sub
















