MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:Utils PointInPolygon

From MapWindow GIS

Jump to: navigation, search

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://www.mapwindow.org/wiki/index.php/MapWinGIS:Utils_PointInPolygon"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: November 12 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links