GeoMed ArcView FAQ
Adding coordinates to a Shapefile.
We'll start with Help! Click the Help button, and follow the links to
-> contents
-> sample scripts and extensions
-> sample scripts
-> views
-> data conversion/alteration
-> Adds X and Y coordinates of features to Attribute Table
- Click on the ``Source Code'' link.
- Copy it all with your mouse.
- Back to the project window, click on
``Scripts'' (same level as Views, Tables, Charts, Layouts; but you may never
have noticed it before!). An empty script is presented. Paste the copied
code into the script, creating what will be called Script1.
- There is a new menu at the top. The ``check'' button is for
compile. Click on it.
- Make sure that the point theme view is active (highlighted among themes);
return directly to your script (i.e. don't go to the project or any other
window before going to your script), and hit the ``Run'' button (the icon is
a running person)
- check your table to make sure that the coordinates are in there.
If you will need to use this a lot, you might want to add a button for doing
so to the View menu. Here's how:
- Make your View active (as this is something that you're going to want
to do from the View menu, i.e. from an active theme).
- Double click on the view menu bar (the grey area) next
to the buttons.
- You'll get a customize dialog. Choose the category Buttons
- You'll see all the existing buttons in a scroll window; click on where
you want to place your new button, and hit new.
- Double click on the word Click, which you'll find in the table below. It
will give you a list of things to link to Click, including (listed
alphabetically) your script, Script1. Select Script1.
- You might also click on Icon, and assign an icon to the Button.
- When you return to the View Window as active, it will include your new
button.
If you save your project, this button will also be saved, with its existing
functionality.
Dumping coordinates (or vectors) to an ascii file
Sometimes you need the actual coordinates of a point data set to use them
for a statistical analysis, say.
Follow the instructions for Adding coordinates,
except that you'll choose a different script: rather than
-> Adds X and Y coordinates of features to Attribute Table
choose
-> Exports active theme to ARC/INFO export format
This is an ascii format, which lets you see what your coordinates are; it
can be read into the GIS GRASS (say) easily.
Importing an ascii or dbf file into ArcView
Read the ESRI pdf documentation.
Editting the legend in a layout
- Create your layout (if your View is active, choose Layout from the View
menu item).
- Click on the legend in the layout to make it active.
- Go to the Graphics menu item and select Simplify. Your legend will be
broken up into editable elements.
- If you end up with alignment problems, you'll want to check out the
alignment features under the Graphics menu item.
This should be the last thing you do in a layout before printing it, as if
you edit your legend it may no longer be automagically updated when you make
changes in your view (the default legend IS automagically updated...).
Are Zip Codes polygons?
No!
How can I load ASCII polygons?
Use my ASCII2shp Avenue Script.
Your data need to be in the following format:
id_1,x,y
id_1,x,y
...
id_1,x,y
id_2,x,y
....
comma separated. The first data location will be used to wrap (and close)
the polygon.
How can I create a new field in an attribute table based on other fields?
- Open the attribute table, and from the Table menu choose "Start Editing".
- From the Edit menu, "Add Field" - it will ask you for some "Field
Definitions". Give your field a meaningful name, choose the type, assign a
width, and, if your field is numeric, choose the number of decimal places
you want to keep. OK!
- From the Field menu, choose "Calculate". Select the variables and
mathematical operations necessary.
I created a variable bw which was the ratio of two variables, for example, as
[Deaths]/[Population].
When I wanted to create an indicator variable (as to whether bw was greater
than or less than 5.5) I did it another way:
- Query those values of bw > 5.5; these values will be selected.
- Calculate the new variable bw-indicator as 1;
- Switch the selection;
- Calculate the new variable bw-indicator as 0.
Thanks to Lee Muller for this tip!
How do I create a hotlink field, so as to include a URL (website
address) with a site (for example)?
- If you already have a column of URLs, then you're ready to go. Otherwise,
open the attribute table, and from the Table menu choose "Start Editing".
- From the Edit menu, "Add Field" - it will ask you for some "Field
Definitions". Give your field a meaningful name (e.g. URL), choose the type
(string), and assign a width (long enough for any URL). OK!
- Choose the edit button, and add in your URLs (of course you could do this
directly in the dBase file, or join in a text file of URLs). When you're
finished, choose "Stop Editing".
- Create a script to carry out the function of loading the page. I used this
one for my setup (notice that you need the path to the program you want to
execute - Netscape in this case):
theVal = SELF
' see if the value of the field is not null
if (not (theVal.IsNull)) then
System.Execute("C:\Program Files\Netscape\Communicator\Program\NETSCAPE.EXE -browser"++theVal)
end
Once you've created your script, you should compile it (using the Check Mark
button).
- Make sure that your theme is active, then choose the Properties menu item
from the Theme menu. In the scrollbar on the left you'll see an icon for "Hot
Link". When you click on it, you've got to choose a Field, a Predefined Action
(choose "Link to User Script"), and then the script name.
Once you've done all this, if you click on the view, you'll see that the icon
for hot links (the lightening bolt) is now active, and can be selected. Select
it, and see if your links work!
Note: It's the bottom of the bolt that selects, rather than the middle
or the top of the bolt.
How do I create a spatial join, rather than a
standard join on a common field in tables?
Check out this pdf file.
How do I create an adjacency matrix of distances between two point files?
- First of all, you'll need this script (here it is with prompts in English, if you
prefer!).
- Load it and compile it. Then you'll need associate a button with the
script, which we've done before.
- Network analyst has to be available as an extension as well. Make sure
that it's included.
- I've only calculated distances between point themes. They'll need a "road
network" (or whatever) included too, so get your two point themes and the roads
into a view.
- Click on your icon. It will ask you for an origin them (one of the two),
and then a destination theme (the other). It will ask for the name of the
resultant network theme, and generate a potentially huge theme.
- I use a lisp file to split the files up, like this one.
How do I compute distances from a point theme to a vector feature?
Visit this site, and use nearfeat.avx
How do I determine contiguity between files?
Check out the details at this webpage. In particular, you need to download and install
this ArcView extension.
Website maintained by Andy
Long. Comments appreciated.
aelon@sph.umich.edu