| LinePoly |
from Spatial Development
available through www.spatial-online.com | |
| ...determine the containing polygon for each line in your shape file | ||
LinePoly determines the containing polygon(s) for each line in a shape file. This information is stored in the line database by copying attributes from the polygon shape file across to the line shape file. The percentage of the line that is in the polygon can also be transferred.
As a line may be in several polygons, the length of the line is calculated for each polygon it overlaps. The polygons are then ordered according to the percentage of the length of the line in each. Polygon attributes are then transferred to the line in accordance to the parameters set in the user interface.
If a line lies on the boundary of two polygons, half its length is considered to be in each polygon.
A table can be produced with a record for each line/polygon overlap by Spatial Development product OverlapPoly.
Return to Table of Contents
LinePoly, 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 LinePoly.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 line and polygon files are visible, select LinePoly
to run LinePoly.
Instructions on running LinePoly directly from your
Avenue script
or calling it from C++ code are provided below.
Return to Table of Contents
To run LinePoly from ArcView, make all line and polygon shape files that you
are interested in visible in a view.
Then choose Polygon > LinePoly.
If the product is still being evaluated, the registration screen below will
appear next.
Clicking the Purchase LinePoly 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 LinePoly process will be evoked. It will provide the dialog below.
The line files in your current view will be listed in the top combo box beside Line 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 two combo boxes on the fourth line will be loaded with the attributes of the currently selected line file and polygon file.
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, specify which polygon's attributes to transfer by specifying
it's position in the text box surrounded by the text For polygon containing the
n th largest length of the line. The line attribute is chosen from the
Line Attribute box.
The polygon attribute is specified in the Polygon Attribute box either by choosing
one from the combo box, or if the length of the line in this polygon is wanted, leave
the box blank. When you click on the Add button, a new rule will be shown
in the list box below as "Set attribute LineAttribute to nth most relevant polygon attribute
PolygonAttribute" or "Set attribute LineAttribute to nth most relevant polygon length".
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, check the line of text at the bottom of
the screen. If there is a problem, it will be identified there.
When the process is complete, the line table will be brought up in ArcView.
The lines will have their attributes modified as specified in the rules.
Return to Table of Contents
Included with the LinePoly installation are two additional scripts.
LinePoly.Run takes three or four parameters and calls the DLL.
LinePoly.Sample
provides a sample script that will evoke LinePoly.Run.
To call LinePoly
directly from your Avenue script, open a script and choose Script > Load System Script.
From the dialogue, scroll down to LinePoly.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
LinePoly.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 LinePoly directly from C++, ensure that ssi07.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 pzLineFile 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.
Return to Table of Contents
LinePoly 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
LinePoly, and
The latter will bring up this help screen. It utilizes
EvokeBrowser to evoke the standard browser with
LinePoly.htm which will reside under the Help subdirectory of your ArcView
installation.
LinePoly 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\\LinePoly.DLL");
if (hDll) {
lpProc = (DWLPSSD)GetProcAddress(hDll, "LinePoly");
} else {
AfxMessageBox("Could not Load Library");
return 0;
}
if (!lpProc) {
AfxMessageBox("GetProcAddress Failed");
FreeLibrary (hDll);
return 0;
}
char * pzLineFile[_MAX_PATH];
CString osPolygonFile;
CString osAttributes;
// Set line file, polygon file and attributes if required
int nReturn = (*lpProc)("c:\Esri\gis_30\ArcView\Help\LinePoly.htm",
pzLineFile,
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
(PolygonPrevelance|LineAttribute|PolygonAttribute)
Please see How to define a rule for
the meaning of PolygonPrevelance. If the PolygonAttribute is blank, the
percentage of the length of overlap will be used.
Zero or any number 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. Line poly 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 LinePoly