[Mapserver-users] Creating dynamic shapefiles with Python Mapscript
Bjoern Platzen
bplatzen@sosnetz.de
Tue, 18 Nov 2003 15:01:09 +0100
Hi Michael.
Thanks a lot! Now it works...
... but the Error was caused by this:
myShape=mapscript.shapefileObj(shpName, mapscript.MS_SHAPE_POINT)
^^^^^
It took me a minute to recognize the difference between your suggestion
on how to create the shapefileObj and my function... 8~)
> if you only want to create a point data shapefile, you don't need to
> create a shapeObj/lineObj.
> You could just do:
>
> newshpfile =
> mapscript.shapefileObj(shpName,mapscript.MS_SHAPEFILE_POINT) #
> iterate over your result set
> for l in r[1]:
> p = mapscript.pointObj()
> p.x = l[0]
> p.y = l[1]
> newshpfile.addPoint(p)
> ...
But I think, I've got to build the lineObj and the shapeObj as well, to
add them to the layer. If I only build the shapefile, my Features won't
be visible on the map. Or is there a way to add the shapefileObject to
the layer? (myLayer.data = myShapefileName didn't work).
Bye,
Bjoern.
--
small office solutions
info@sosnetz.de - http://www.sosnetz.de
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users