2/18/ UT DallasPOEC 6382 Applied GIS Software 1 Data Management: Queries ArcPlot commands for selecting and summarizing data Meet certain conditions: reselect, nselect, aselect, unselect Determine characteristics of a specified feature: identify Perform limited statistical operations on the database: statistics
2/18/ UT DallasPOEC 6382 Applied GIS Software 2 Overview The manipulation of coverages lies at the heart of ArcInfo-based GIS The methods or commands are numerous and can be classified in many ways There is always overlap, but basic groupings are –Coverage Query: techniques for querying existing coverages (see query.ppt) –Coverage Maintenance: creating, maintaining and modifying coverages (see covergages.ppt) –Coverage Conversion: converting from one GIS format or data model to another (see convert.ppt) –Spatial Analysis: manipulation of coverages to answer some research question or achieve some operational purpose (see analysis.ppt) Spatial analysis techniques may be used for coverage query anmd maintenace also We will discuss Query and Maintenance in the context of Workstation ArcInfo. –query.ppt –coverage.ppt ArcToolbox includes these in its Data Management component We will cover the Conversion and Spatial Analysis commands in the context of ArcToolbox, –Conversion.ppt –Analysis.ppt
2/18/ UT DallasPOEC 6382 Applied GIS Software 3 SPATIAL QUERIES ARCPLOT commands which allow the user to display and query spatial data. –Determine available data: items list –Meet certain conditions reselect nselect aselect unselect –Determine characteristics of a specified feature identify –Perform limited statistical operations on the database statistics
2/18/ UT DallasPOEC 6382 Applied GIS Software 4 Spatial Queries: Selecting Records When you select a table, or draw a coverage in ArcPlot, all records are contained in the active set and any commands executed will affect all the records in the table. To modify specific records, you need to place records in a subset: –RESELECT - selects a subset of records from the currently selected data set using a variety of methods -- see usage for reselect in ARCPLOT. Most popular: logical expression, graphical (box, circle, etc), and overlap. –ASELECT – when issued with logical expression, selects additional records to add to selected set -when issued alone, selects all records –UNSELECT - removes features that match a logical expression –NSELECT - switches the set of selected and unselected records. –CLEARSELECT - clear the selected set -- not automatic, must clear the selected set prior to reselecting another set unless only want a record from the currently selected set. –WRITESELECT - write the selected set into a selection file which can be read later or used to create a new coverage in ARC. –READSELECT - will read a set specified with the writeselect command This is critical. Normally issue before every reselect!
2/18/ UT DallasPOEC 6382 Applied GIS Software 5 RESELECT Arcplot: usage reselect RESELECT {logical_expression} RESELECT ONE RESELECT MANY RESELECT BOX {PASSTHRU | WITHIN} RESELECT POLYGON {PASSTHRU | WITHIN} RESELECT CIRCLE {PASSTHRU | WITHIN} RESELECT MAPEXTENT RESELECT PARTIAL RESELECT KEYFILE {KEYITEM } RESELECT OVERLAP {selection_distance} {PASSTHRU | WITHIN}
2/18/ UT DallasPOEC 6382 Applied GIS Software 6 RESELECT, continued RESELECT RANDOM {PERCENT} {seed} RESELECT INFO {logical_expression} RESELECT INFO KEYFILE {KEYITEM } RESELECT INFO RANDOM {PERCENT} {seed} RESELECT IMAGE {logical_expression} RESELECT IMAGE ONE RESELECT IMAGE MANY RESELECT IMAGE BOX {PASSTHRU | WITHIN}
Logical Expressions Item name EQLE NECN GTNC GEIN LTLK Item name Character string* numeric value AND OR operand operator Equals, not equal to, greater than, greater than or equal to, less than, less than or equal to, contains, not contains, in a range of values, like Must have a space on each side of the operator, even when using equal (=) symbol e.g. State = ‘TX’ *Must be in ‘single quotes’ (And must use key next to Enter key)
2/18/ UT DallasPOEC 6382 Applied GIS Software 8 Examples Select from coverage USA polygon features for the State of Texas: –RESELECT {logical_expression} –reselect usa poly state = ‘TX’ ( reminder:Character strings are always in single quotes) –RESELECT POLYGON {PASSTHRU | WITHIN} –reselect usa poly polygon * within (drag cursor box around Texas) –RESELECT OVERLAP {selection_distance} {PASSTHRU | WITHIN} –reselect usa poly OVERLAP texas poly (already have a cover named texas) Find all buildings within 100’ of a stream –RESELECT OVERLAP {selection_distance} {PASSTHRU | WITHIN} –reselect bldg poly overlap stream line 100 (assumes mapunits are in feet) REMEMBER: Once you have selected a set, all future commands act only on the selected set. To clear the selected set use the command CLEARSELECT.
2/18/ UT DallasPOEC 6382 Applied GIS Software 9 Saving Selected Sets: writeselect v. new coverage In ArcPlot (be sure to see big difference between Arc and ArcPlot use of reselect) Select records from coverage: Arcplot: reselect {logical selection} Arcplot: reselect usa poly state eq ‘TX’ Create a selection file for this selected set Arcplot: writeselect { } Arcplot: writeselect texas.sel Arcplot: quit This will create a selection file containing all current selection criteria (but no data records). Use readselect to read this selection file another time to re-establish these criteria. In Arc Use reselect command in Arc to create new coverage Arc: reselect {in_feature class} {selection file} {out_feature class} Arc: reselect usa texas poly texas.sel poly This will create a new coverage containing actual data records. Similar to “Convert to Shapefile” in ArcView. However, rarely need to create a new coverage -- use an AML to reselect your records in ArcPlot, or readselect a writeselected set.
2/18/ UT DallasPOEC 6382 Applied GIS Software 10 READSELCT reads a previously created selection file and re-establishes the selected record set based on the selection file contents. READSELECT For example, the following reads an existing selection file, which is assumed to select only Oklahoma counties, so that the map extent will be limited to Oklahoma rather than all US and only Oklahoma will appear on the map. (uscnty is a coverage) readselect okcnty.sel mape poly uscnty polys uscnty
2/18/ UT DallasPOEC 6382 Applied GIS Software 11 Retrieving Information About your Data The IDENTIFY command allows you to point at a coverage feature and display its attributes. Usage: identify Arcplot: identify site polys * Enter point Record AREA PERIMETER PARCEL# PARCEL-ID PIN If you only want IDENTIFY to list one or more items, specify item names: Arcplot: identify site polys * area pin Enter point Record AREA PIN
2/18/ UT DallasPOEC 6382 Applied GIS Software 12 Statistics STATISTICS generates summary statistics from items in an INFO data file and may save them to a new INFO data file. Usage here is for ArcPlot. –Use STATISTICS to determine SUM, MEAN, MAXIMUM, MINIMUM, or STANDARD DEVIATION for an item or items in a Tables data file. –STATISTICS {case_item} {out_info_file} Case-Item is NOT the variable for which you want statistics. It is a grouping (BY) variable. Separate statistics are produced for each set of records with same value on this variable. Variable(s) for which you want stats are named within the dialog (see next slide) Be sure you have the desired “selection set” of records before requesting statistics –Arcplot: statistics europe polys Since no {case_item} is specified, one set of statistics is calculated using all currently selected records. –Arcplot: statistics streets arcs street-name streets.sta For each unique value of street-name {case_item}, summary statistics are calculated and placed in the streets.sta {output_file}. –Arcplot: statistics aircover points # aircover.sta Since no {case_item} is specified, one set of statistics is calculated using all currently selected records and saved in the file aircover.sta
2/18/ UT DallasPOEC 6382 Applied GIS Software 13 Statistics example In this example, you have a polygon coverage europe containing a variable (item) area for which you want stats. No {case-item} or {output file} is used. Arcplot: statistics europe polys Enter statistical expressions. Type END or blank line to end. Statistics: sum area Statistics: mean area Statistics: max area Statistics: min area Statistics: end 1 FREQUENCY = 87 SUM-AREA = MEAN-AREA = MAX-AREA = MIN_AREA =