translate to tcl
Karl Lehenbauer
karl-umn at SC.COM
Wed Mar 15 15:42:39 PST 2006
On Mar 10, 2006, at 5:58 PM, salah jubeh wrote:
CAN ANY BODY HELP ME IN TRANSLATE THIS TO TCL
map = mapscript.Map('rquery.map')
set map [mapscript::mapObj -args "rquery.map"]
layer = map.getLayer(0)
set layer [$map getLayer 0]
pnt = mapscript.Point()
pnt.x = 440780 pnt.y = 3751260
set pnt [::mapscript::new_pointObj 440780 3751260]
layer.queryByPoint( map, pnt, mapscript.MS_MULTIPLE, 180.0 )
$layer queryByPoint $map $pnt $::mapscript::MS_MULTIPLE 180.0
layer.open() for i in range(1000):
result = layer.getResult( i )
if result is None:
break
$layer open
for {set i 0} {$i < [$layer getNumResults]} {incr i} {
set result [$layer getResult]
if {$result == "NULL"} break
print '(%d,%d)' % (result.shapeindex, result.tileindex)
puts [format "%d,%d" [$result shapeindex] [$result tileindex]]
s = layer.getShape( result.shapeindex, result.tileindex )
set s [$layer getShape [$result shapeindex] [$result tileindex]
etc etc etc
for i in range(layer.numitems):
print '%s: %s' % (layer.getItem(i), s.getValue(i))
layer.close()
Don't listen to people who tell you Tcl mapscript is all broken.
Take a look at flightaware.com -- it's Tcl all the way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060315/e75307b0/attachment.htm>
More information about the MapServer-users
mailing list