swig mapscript: your opinion on changin g layerObj::getShape() for version 4.4

Ryan, Adam ARyan at CO.LINN.OR.US
Mon Sep 20 19:33:51 EDT 2004


YES and still YES.

Adam

PS  I've been moving from PHP to Python and have had nothing but success.

-----Original Message-----
From: Sean Gillies [mailto:sgillies at FRII.COM]
Sent: Monday, September 20, 2004 10:02 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] swig mapscript: your opinion on changing
layerObj::getShape() for version 4.4


Hello mapscripters,

For some time, an alternative API has been available to to those who build
their own SWIG mapscript modules.  I think it is time to make one feature of
the experimental API permanent.

In the experimental API getShape returns a shapeObj and takes shapeindex and
tileindex as arguments.

     shapeObj getShape( int shapeindex [, int tileindex=-1 ] )

The usage for the case of tileindexed shapefiles is like this

     tileindexed_layer.open()
     shape = tileindexed_layer.getShape(shapeindex, tileindex)
     tileindexed_layer.close()

In the case of layers without tileindexing, the second argument can be
omitted because it defaults to -1

     layer.open()
     shape = layer.getShape(shapeindex)
     layer.close()

I'd like to get feedback on 2 facets of this proposal.  The way I see it

1) return value change from int to shapeObj

    requires update of scripts:    -1
    more like php mapscript:       +1
    prevents shape type conflicts: +1
    reduces need to create shapes: +1
    just plain better:             +1

2) reorder arguments

    less like php mapscript:                       -1
    for postgis layers avoids a useless argument:  +1
    for regular shapefiles avoids useless arg:     +1

Please see this bug for more details:

   http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=878.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the mapserver-users mailing list