MapScript Shapefile Object

Daniel Morissette danmo at videotron.ca
Tue May 9 12:01:33 EDT 2000


Chris Fuhrman wrote:
> 
> Howdy,
> 
> I'm presently using Perl/Mapscript to connect to a remote database,
> retrieve coordinate data, generate a shapefile, and then, from the
> shapefile, generate an image.
> 
> What I'm having problems with is that I'm generating the shapefiles okay,
> but when I look in the shapefile object, the numshapes attribute is set to
> zero which means I can't iterate through it to draw all it's shapes.
> 
> According to the documentation, numshapes is a read-only attribute so I
> assumed it would be updated automatically.
> 

Have you tried closing the shapefile after it's been created and then
repoening it in read access?

I ran into a similar problem (on Windows)... I was creating shapefiles
using the PHP/MapScript which is based on the same functions as the Perl
MapScript, and I realized that the last changes to the shape file do not
appear to be flushed to disk until the file is closed.  Closing the file
and repoening it solved the problem... I have to admit that I didn't
look into the MapServer code to try to understand what was really
happening.

-- 
------------------------------------------------------------
 Daniel Morissette                       danmo at videotron.ca
              http://pages.infinit.net/danmo/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list