MapWinGIS:Utils PointInPolygon

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

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

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Utils_PointInPolygon"

This page has been accessed 1,956 times. This page was last modified on 9 November 2005, at 17:35.