[mapserver-users] PHP Mapscript Layer object´s Open method
morissette at dmsolutions.ca
Sun Jun 23 13:30:22 EDT 2002
How is this layer defined in your mapfile? Did you set the "DATA" value
in the layer? The open() method opens the layer as defined in the
mapfile and you cannot pass it a different shapefile filename. The
argument you pass to $lyr->open() should be the value of
So assuming your mapfile says:
Then you should be able to access the ../geo/brest.shp file using the
Note that if all you want is to open a shapefile independent of a
mapfile layer then you can use the shapefileObj class... see the
I hope that helps,
Nicolau Werneck wrote:
> Hello, people
> Some time ago I sent a message here because of this
> piece of code:
> $shp=$lyr->getShape(-1, 1);
> echo $shp->values["UF"]."<BR>";
> Well, I finally started to work on that part of the
> project again, and I must open this layer and find the
> limits of specific shapes, so i can render maps
> "closed" on them.
> I´m trying to use the getShape function, and it needs
> that the open() function be called before it.
> I´m not shure I understand the process, and worse:
> I´m not able to execute the Open function! Mapscript
> Fatal error: MapServer Error in msOpenSHPFile(): No
> (NULL) filename provided.
> I´ve tried total and relative paths, with slash and
> backslash, but it just can´t find it!
> The documentation didn´t help me... I hope I can
> receive some light from the PHP Mapscript gurus out
> there! :) How would be a "paragraph" of code that
> opens a layer, finds a shape from it and reads it´s
> PS: One workaround it to have the extents on the
> database I use... Thinking about it make me shiver!...
> Copa 2002
> Yahoo! - Patrocinador oficial da Copa do Mundo da FIFA 2002
More information about the mapserver-users