4.19.
ResultCacheMemberObj
Up one level
Constructor and members.
- Constant names and class member variable names are case-sensitive in PHP.
- Several MapScript functions (all those that access files in the back end such as ms_newMapObj(), drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP environment. This will be fixed eventually but in the meantime you should be careful about these side-effects.
Constructor: Instances of ResultCacheMemberObj are always obtained through layerObj's getResult() method. Members: int shapeindex (read-only) int tileindex (read-only) int classindex (read-only)
retrieving shapes
Posted by
Yahya Mohammad
at
2007-06-14 07:12
you need to use the layer's getShape method:
for ($i = 0; $i < $layer->getNumResults(); $i++) {
$result = $layer->getResult($i);
$shape = $layer->getShape($result->tileindex, $result->shapeindex);
print_r($shape->values);
}
for ($i = 0; $i < $layer->getNumResults(); $i++) {
$result = $layer->getResult($i);
$shape = $layer->getShape($result->tileindex, $result->shapeindex);
print_r($shape->values);
}
how would I use this ?
and can loop through the result
from ...
(
[shapeindex] => 0
[tileindex] => -1
[classindex] => 0
)
... to [shapeindex] => 222 (the number of records in the shapefile)
Is there any way to extract the value of a field from this or am i stuck ? What is the missing method that I'm not seeing in the API ?