| PointPoly |
from Spatial Development
available through www.spatial-online.com | |
| ...determine the containing polygon for each point in your shape file | ||
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
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,
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
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:
To establish a transfer rule, choose a Point Attribute
from its combo box and a Polygon Attribute from its combo box.
The choice of Join will determine what will happen in case there is more
than one polygon containing this point, either internally (if the polygons overlap)
or as a boundary point. The default case is that the first encountered is chosen
(First). Alternately, the field values for the various polygons can be chosen to
be the maximum (Max) or minimum (Min) if those operations are applicable to field types.
Additionally, if the field is character, the values can also be concatenated (Concatenate) and
if the attribute is numeric, the values can also be summed (Sum).
Once the above are specified, click the Add button.
The rule will appear in the list box as "Set attribute PointAttribute to PolygonAttribute (JoinType)".
To remove a previously established rule, select it and click the Remove
button.
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
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
To run PointPoly directly from C++, ensure that ssi06.dll is within your path and include the following code:
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
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
Return to Table of Contents
Spatial Development offers other products for determining overlap with
polygons.
Click here for a complete
listing of Spatial Development products.
Return to Table of Contents
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.
Installation Instructions
After the extension is loaded, when the View Menu is visible, there will be
a Polygon option. Beneath this button will be items
PointPoly, and
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.
PointPoly Help.
Run from ArcView
Run from Avenue Script
Run from C++
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;
(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.
Frequently Asked Questions
Look at the message along the bottom of the screen and it will
tell you why.
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.
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.
Other Spatial Development Products
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.
About PointPoly