tclshp is an extension of Tcl/Tk that provides the Tcl script writer some ability to read shapefiles. Its core is a set of C wrappers that read the files using Frank Warmerdam's shapelib and make the results available to Tcl procedures.
tclshp-1.0.2.zip | [an error occurred while processing this directive] ZIP file |
tclshp-1.0.2.tgz | [an error occurred while processing this directive] gzipped tar file |
Frank Warmerdam: | http://pobox.com/~warmerdam |
Shapelib: | http://shapelib.maptools.org/ |
shp s -open input_file
$s info
{shape_type record_count}
$s bounds rowid
{Xmin Ymin Zmin Mmin Xmax Ymax Zmax Mmax}
for the whole shapefile or, if rowid is specified, the bounds of that specific shape.
$s coords rowid
Since shapes can be composed of multiple parts, this function always returns a list of lists; one sublist for each part in the shape. It is the sublists that contain the coordinate values. So the coordinates of a simple shape will be returned as a list containing the list of coordinates. For shapes that are known to be two-dimensional, only the X and Y coordinates are included; if the shape might have Z coordinates or measures, all four coordinate values are given.
$s forget
setup.tcl
included with tclshp.Peter N. Schweitzer Mail Stop 954, National Center U.S. Geological Survey Reston, VA 20192 Tel: (703) 648-6533 FAX: (703) 648-6252 Email: pschweitzer@usgs.gov