[Mapserver-users] Creating dynamic shapefiles with Python Mapscript

Björn Platzen bplatzen at sosnetz.de
Tue Nov 18 11:59:16 EST 2003


Hi Michael,

now I decided to walk the way, Eric suggested. 
Nevertheless, thanks for helping! I saw that I need that way in another 
project, where the Features change maybe once a year. There, I think, 
it will have a greater performance to write a new shapefile if 
something changes and then use the shapefile as layer data.

> > Or is there a way to add the shapefileObject to
> >the layer? (myLayer.data = myShapefileName didn't work).
>
> Well, actually that should work, but not with the shapefileobj, the
> filename of you newly created shapefile is enough (you probably have
> to "close" the new shapefile with shapefileObj=None before).
> Otherwise if you only want to add some features to the layerobj, you
> can use layerobj.addFeature, that only takes a shapeobj, so you don't
> need a shapefileobj.

You're right! that should work... The problem was, that myShapefileName 
contained the shapepath, the shapename and the appendix '.shp'... 

Bye,

Bjoern.

-- 
small office solutions
info at sosnetz.de  -  http://www.sosnetz.de




More information about the mapserver-users mailing list