PROBLEM QUERYING ONE POINT LAYER
Eric Belenfant
eric.belenfant at AC-ORLEANS-TOURS.FR
Thu May 18 07:27:13 PDT 2006
Hi,
i have a layer in a map file i want to show dynamicly from FORM
parameters choosed by user. This is a POINT layer.
When i do a queryByAttributes on that layer mapserver returns several
shapes but points doesn't appear, nor labels defined in layer.
What do i miss ? Points should be drawn with draw() method ? Is there
any particularity when querying POINT LAYERS ?
I tested the same thing on POLYGON layers and it works fine !
When i turn this POINT LAYER ON points are drawn fine.
Here is my POINT LAYER :
LAYER
NAME "colPU"
TYPE POINT
STATUS OFF
CONNECTIONTYPE OGR
CONNECTION "data/etablissements/E-clgpu05.TAB"
CLASSITEM "ETAB"
METADATA
"DESCRIPTION" "|||Etablissements"
"RESULT_FIELDS" "ETAB,NOM,DEPT,SECT"
"RESULT_HEADERS" "|||Numero d'établissement,Nom
établissement,Département,Secteur"
"RESULT_HYPERLINK" "ETAB"
END
LABELITEM "NOM"
CLASS
NAME "Collège public"
TEMPLATE void
COLOR 139 0 139
SYMBOL 'circle'
SIZE 5
LABEL
COLOR 139 0 139
POSITION AUTO
TYPE bitmap
SIZE tiny
WRAP " "
FORCE TRUE
END
END
END
Here piece of PHP code :
$db =& DB::connect($dsn, $options);
# récupération de la liste des établissements
$modele = & new carteModel($db);
$modele->listeEtabSect($secteur);
$Lcommunes=$map->getLayerByName("colPU");
$Lcommunes->set("status", MS_ON);
while ($item = $modele->getItem()) {
if (!$item["numetab"]) continue;
@$Lcommunes->queryByAttributes("ETAB",$item["numetab"],MS_MULTIPLE);
if (!$nb = $Lcommunes->getNumResults()) continue;
$resultat=$Lcommunes->getResult(0);
$Lcommunes->open();
$nb = $Lcommunes->getNumResults();
echo "{$item["numetab"]} Nombre de résulats $nb\n<br>";
$Lcommunes->close();
$shape->free();
$Lcommunes->close();
}
$db->disconnect();
--
Eric BELENFANT
Tel : 02.38.79.45.97
INGENIEUR D'ETUDES INFORMATIQUE
DEP - Division Etudes et Prospectives <http://dep.ac-orleans-tours.fr>
Rectorat d'Orléans-Tours <http://www.ac-orleans-tours.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060518/d80fa130/attachment.htm>
More information about the MapServer-users
mailing list