anoved / Shapetcl

Simple shapefile access for Tcl.
MIT License
3 stars 0 forks source link

Add a [read] cmd for parity with [write] #63

Open anoved opened 11 years ago

anoved commented 11 years ago

Could be used as a compact alternative to the following compound foreach construct:

foreach feature [$shp coord read] record [$shp attr read] {
    # process feature and record
}

The [read] method would return a two-element list containing the coordinate list and the attribute record. With no index argument, these lists would include all entities; with an index argument, they would be the coordinate and attribute data of the specified index.

foreach {feature record} [$shp read] {
    # process feature and record
}