|
geomap_usgs_gaz − package to access USGS gazetteeer data with Tcl/Tkgeomap |
|
2 |
package require geomap_usgs_gaz ?2? geomap::usgs::gaz::read inFile type geomap::usgs::gaz::type::regexp exp ?nocase? |
|
The geomap_usgs_gaz package accesses data obtained from the USGS gazetteer, availabe at http://mapping.usgs.gov/www/gnis The package requires tcl/tk from http://dev.scriptics.com, version 8.3 or later, and tkgeomap, a Tcl/Tk extension to Tcl/TK, from http://www.tkgeomap.org. |
|
geomap::usgs::gaz::read inFile ?type? |
|
Reads USGS gazetteer data. inFile should be a gazetteer columnar file. It can start with | to indicate data from a process. type should be a place type. To get a list of USGS place types, run cut -b 55-63 file1 ?file2 ...? | sort -u on the Unix command line, where file1 ?file2 ...? identifies one or more columnar format gazetteer files. |
|
The read procedure will create a namespace for the type called geomap::usgs::gaz::type. It will create a unique identifier for each place in inFile of the given type, of form pXXX, where XXX is an integer. The namespace will have the following information: |
|
geomap::usgs::gaz::type::name(pXXX) |
|
Array element with place name. |
|
geomap::usgs::gaz::type::county(pXXX) |
|
Array element with county that contains the place. |
|
geomap::usgs::gaz::type::state(pXXX) |
|
Array element with state that contains the place. |
|
geomap::usgs::gaz::type::elev(pXXX) |
|
Array element with place elevation. Check the USGS web site for units. |
|
geomap::usgs::gaz::type::pXXX |
|
A place created with the geomap::place command (see the tclgeomap (n) man page) giving coordinates of a place. |
|
geomap::usgs::gaz::type::places |
|
List of place identifiers. |
|
geomap::usgs::gaz::type::n_places |
|
Same as places, except that identifiers are fully qualified. |
|
Result is number of places in the type namespace. |
|
geomap::usgs::gaz::type::regexp exp ?nocase? |
|
This procedure searchs namespace geomap::usgs::gaz::type for places whose names match regular expression exp. If nocase option is present and has Boolean value true, the search is case insensitive. Result is a list of one or more place identifiers whose names match exp. |
|
usgs_gaz.tcl |