Spatial Hydrology Class:
During our last meeting and in the time since, questions
have arisen about how to make dynamic queries or selections on
Themes. Two types of queries that can be made in ArcView are spatial
queries and tabular queries. Here are some notes on making these
types of queries (certainly not a full exploration of the query
capabilities in ArcView).
SPATIAL QUERIES
SelectByPoint
SelectByLine
SelectByPolygon
SelectByRect
SelectByShapes
and SelectByPolyLine
all may be sent to a Feature Theme object and when
this is done two arguments are required: a point, line, polygon,
rectangle, etc. object is the first argument and the second argument
is a key word indicating how the Features identified by the given
spatial criterion will be merged with the current Selection Bitmap.
For example:
theTheme.SelectByPolygon(mypoly,#VTAB_SELTYPE_NEW)
Replaces the currently selected features in theTheme
with all features within mypoly.
anFTheme.SelectByTheme(anotherFtheme,arelType,aDistance,aSelType)
In the script shdevap.ave (see class handout), I used this request to select all reservoirs (resTheme) within a selected watershed (of basTheme) so that I could determine the total evaporation attributable to reservoirs in this watershed. SelectByTheme requires four arguments: another Theme, a relation type, a distance criteria (number), and a selection type. Here is the syntax I used:
resTheme.SelectByTheme(basTheme,#ftab_reltype_iscompletelywithin,10,#vtab_seltype_new)
where 10 represents 10 map units and is an arbitrary
choice.
TABULAR QUERIES
A tabular query can be made in Avenue by sending
the Query request to a Vtab as illustrated in the lines below:
theBitmap=theVtab.GetSelection
theVtab.Query( "[area] > 1000", theBitmap,#vtab_seltype_new)
theVtab.UpdateSelection
If you know the record number and wish to add that
specific record to a selected set, you can use the following lines:
theBitmap=theVtab.GetSelection
theBitmap.Set(rec)
theVtab.UpdateSelection