|
geomap_census_gaz − package to access NWS/AWIPS map data with Tcl/Tkgeomap |
|
2 |
package require geomap_census_gaz ?2? geomap::us_census::gaz::read inFile ?verbose? geomap::us_census::gaz::read_sorted inFile geomap::us_census::gaz::popcmp p1 p2 geomap::us_census::gaz::regexp exp ?nocase? geomap::us_census::gaz::smallest minPop |
|
The geomap_census_gaz package accesses data obtained from the U.S. Census gazetteer, availabe at http://www.census.gov/geo/www/gazetteer/places2k.html. 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::us_census::gaz::read inFile ?verbose? |
|
Reads U.S. Census gazetteer data. inFile should be a copy of http://www.census.gov/tiger/tms/gazetteer/places2k.txt. If the verbose option is present and has a Boolean value of true, the procedure prints progress and status information to the terminal. |
|
Each place loaded will be identified by its FIPS code. The following information will be recorded: |
|
geomap::us_census::gaz::type(fips) |
|
Array element giving the type of place, e.g. "city", "town", "CDP". |
|
geomap::us_census::gaz::name(fips) |
|
Array element giving the place name. |
|
geomap::us_census::gaz::state(fips) |
|
Array element giving the two-letter abbreviation for the state the place is in. |
|
geomap::us_census::gaz::pop(fips) |
|
Array element giving the place population. |
|
geomap::us_census::gaz::places |
|
List of place identifiers, sorted from most populous to least. |
|
geomap::us_census::gaz::n_places |
|
Same as the places list, except that the identifiers are fully qualified. |
|
geomap::us_census::gaz::types |
|
List of place types. |
|
Result is the number of places loaded. |
|
geomap::us_census::gaz::read_sorted inFile |
|
Reads place data from an optimized file. inFile should contain place data from http://www.census.gov/tiger/tms/gazetteer/places2k.txt, but with the places sorted from most populous to least. There should be one line for each place. Each line should be a list of form: fips name state {lat lon} type population
The data will go into the same arrays and lists used by the read procedure. |
|
geomap::us_census::gaz::popcmp p1 p2 |
|
Compares two places by population. p1 and p2 should be identifiers for places loaded with the read or read_sorted procedure. Return value will be -1 if the population of p1 is less than the population of p2, 0 if p1 and p2 have the same population, or 1 if the population of p1 is greater than the population of p2. |
|
geomap::us_census::gaz::regexp exp ?nocase? |
|
Searches the geomap::us_census::gaz namespace for places whose names match regular expression pattern exp. Result is a list of unqualified place identifiers. If nocase is present and has a Boolean value of true, the search is case insensitive. |
|
geomap::us_census::gaz::smallest minPop |
|
Returns the index of the place in geomap::us_census::gaz::places with the smallest population that is still greater than minPop, or -1 if no place has a population greater than minPop. |
|
census_gaz.tcl |
|
Gordon Carrie user0 at address tkgeomap.org |