PointPoly              from Spatial Development
available through www.spatial-online.com
...determine the containing polygon for each point in your shape file

Table of Contents Overview

PointPoly determines the containing polygon for each point in a shape file. This information is stored in the point database by copying attributes from the polygon shape file across to the point shape file. In case a point falls in more than one polygon, the attributes of the containing polygons can be joined.

Return to Table of Contents

Installation Instructions

PointPoly, amongst other ArcView extensions, can be downloaded and installed for a free trial from www.spatial-online.com. The file that is downloaded is called PointPoly.exe. Double click on the file, and an Install Wizard will guide you through the installation.

After installation, the extension will be available through the usual ArcView extension directory. To load the extension,

After the extension is loaded, when the View Menu is visible, there will be a Polygon option. Beneath this button will be items The latter will bring up this help screen. It utilizes EvokeBrowser to evoke the standard browser with PointPoly.htm which will reside under the Help subdirectory of your ArcView installation.

When the required point and polygon files are visible, select PointPoly to run PointPoly.

Instructions on running PointPoly directly from your Avenue script or calling it from C++ code are provided below.

Return to Table of Contents

Run from ArcView

To run PointPoly from ArcView, make all point and polygon shape files that you are interested in visible in a view. Then choose Polygon > PointPoly.

If the product is still being evaluated, the registration screen below will appear next. Clicking the Purchase PointPoly button will evoke your browser with www.spatial-online.com to enable you to purchase the product on-line, through the Fax or via Purchase Order. When you purchase the product, you will be required to supply your site code (just below the Purchase button). In return, you will get a product key. Insert that key into the Edit Box next to Product Key and click OK to register the product. Once you have done this, this registration box will no longer appear.

To run the product in trial mode, click the Run in Demo Mode button. Below the button, the remaining trial period is shown.

Clicking the Cancel button will stop the process.

The PointPoly process will be evoked. It will provide the dialog below. The point files in your current view will be listed in the top combo box beside Point File with the first selected. The polygon files in your current view will be listed in the next combo box beside Polygon File with the first selected. The first two combo boxes on the subsequent line will be loaded with the attributes of the currently selected point file and polygon file. The third will provide join attributes.

Note: The text at the bottom of the box, "Click OK when parameters selected" in the diagram below, supplies instructions and error messages. If the process does not seem to be proceeding as expected, check the text and it will explain why.

Before clicking OK to run the process, the following must be specified:

Of the three remaining buttons, Help will evoke the browser with this help, Cancel will cancel the process, and OK will start the process.

After clicking the OK button, the process will begin and progress will be reported on the bottom of the dialog box. Please check the line of text at the bottom of the screen. If there is a problem, it will be reported there.

When the process is complete, the dialog will disappear and the point table will be brought up in ArcView. The points will have their attributes modified as specified by the rules.

Return to Table of Contents

Run from Avenue Script

Included with the PointPoly installation are two additional scripts. PointPoly.Run takes three or four parameters and calls the DLL. PointPoly.Sample provides a sample script that will evoke PointPoly.Run.

To call PointPoly directly from your Avenue script, open a script and choose Script > Load System Script. From the dialogue, scroll down to PointPoly.Sample, choose it and click OK. The sample code will be loaded into the open script. The meaning and format of the parameters is described in the script.

Alternately, choose PointPoly.Run to get details on running the required DLL's directly.

Note there is an additional boolean parameter. If it is set true, the program will run without user interaction. In this mode, the dialog will be presented to monitor progress, but the user will not be able to modify anything unless the parameters will not work, such as a file not being available.

Return to Table of Contents

Run from C++

To run PointPoly directly from C++, ensure that ssi06.dll is within your path and include the following code:

HINSTANCE hDllEvokeBrowser = NULL;
hDllEvokeBrowser = LoadLibrary("c:\\Esri\\Av_gis30\\Arcview\\Bin32\\EvokeBrowser.DLL");
if (!hDllEvokeBrowser) {
    AfxMessageBox("Could not Load EvokeBrowser");
    return 0;
}
typedef DWORD (CALLBACK *DWLPSSD)(LPSTR, LPSTR, LPSTR, LPSTR, BOOL);
HINSTANCE hDll = NULL;
DWLPSSD lpProc = NULL;
hDll = LoadLibrary("c:\\Esri\\Av_gis30\\Arcview\\Bin32\\PointPoly.DLL");
if (hDll) {
    lpProc = (DWLPSSD)GetProcAddress(hDll, "PointPoly");
} else {
    AfxMessageBox("Could not Load Library");
    return 0;
}
if (!lpProc) {
    AfxMessageBox("GetProcAddress Failed");
    FreeLibrary (hDll);
    return 0;
}
char * pzPointFile[_MAX_PATH];
CString osPolygonFile;
CString osAttributes;
// Set point file, polygon file and attributes if required
int nReturn = (*lpProc)("c:\Esri\gis_30\ArcView\Help\PointPoly.htm",
                                pzPointFile,
                                osPolygonFile.GetBuffer(),
                                osAttributes.GetBuffer(),
                                false);
FreeLibrary (hDll);
if (nReturn) AfxMessageBox("Run successful");
else AfxMessageBox("Run failed");
return nReturn;

The second parameter is used to return the name of the line file actually chosen by the user. It should thus be allocated sufficient room to hold the longest path length.

The format for the shape files, that is pzPointFile and osPolygonFile, is

    (path\\file1.shp)[(path\\file2.shp)...]
Zero or any number can be specified. All specified will be in the combo box and the first will be the default selection. The format for an attribute rule is
    (PointAttribute|PolygonAttributeJoin|Type)
Join type is the first three characters, not case snesitive, of the name of the join type, that is Min, Max, Sum, Con. The default is Fir(st). Zero or any number of rules can be specified. Combine more than one rule by concatenation.

The first parameter specifies the placement of the help file, and there is an additional final boolean parameter. If it is set true, the program will run without user interaction. In this mode, the dialog will be presented to monitor progress, but the user will not be able to modify anything unless the parameters will not work, such as a file not being found.

Return to Table of Contents

Frequently Asked Questions

  • I pressed Ok or chose a file and it did not continue or accept the file.
    • Look at the message along the bottom of the screen and it will tell you why.
  • I get the message back that it cannot open the file to write, but the table is open in ArcView.
    • That may be the problem. Pointpoly is run from a DLL, and sometimes ArcView grabs hold of the file and will not let other excutables write to it. Please make sure that you are not editing the point file with edits not yet saved. If that does not work, please close the table editing screen, and make sure in a shared environment that other people are not editing the table.
  • I recieved a message "Please connect to www.spatial-online.com for free software that will enable the jet database engine on this computer". What is the problem?
    • Many computers running ArcView have the Microsoft Jet Database already installed. For this reason, we do not include it in the product installation as it significantly increases the size of the download file. Click here to download and install Jet Database, after which you will not see this message again.

Return to Table of Contents

Other Spatial Development Products

Spatial Development offers other products for determining overlap with polygons.

  • LinePoly determines the overlap of lines with polygons. Attributes of any polygon that contains part of the line can be transferred to the lines database. Click here for more information about LinePoly or here to download a free evaluation of this product.
  • OverlapPoly determines the overlap of features with a polygon file. The end result is a table that links the features to all the polygons that contain them along with the type (totally contained or on the boundary) and the length of the overlap for lines. Click here for more information about OverlapPoly or here to download a free evaluation of this product.
This help is provided from within ArcView by the assistance of a free utility called EvokeBrowser. This product enables one to evoke the default browser from within Avenue code. Click here to download a free copy EvokeBrowser.

Click here for a complete listing of Spatial Development products.

Return to Table of Contents

About PointPoly

PointPoly Copyright ©1999 is a product of Spatial Development. All rights reserved.

Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction of it, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.

The software comes "as is". Neither Spatial Development nor www.spatial-online.com make any warranty, representation, promise or guarantee of any kind, either expressed or implied, statutory or otherwise, including, but not limited to the implied warranties of quality, performance, non-infringement, merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the software is with the user. We do not warrant that the functions contained in the software will meet your requirements or that the operation of the software will be uninterrupted or error free.

Return to Table of Contents