anoved/Shapetcl

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

Opened this issue · 0 comments

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
}