[Mapserver-users] Select pointObject from an ODBC layer with php-mapscript

ludovic gnemmi l_gnemmi at yahoo.fr
Wed Jul 28 09:38:36 EDT 2004


Hi all,
I've a problem to select pointobjects (with
queryByPoint) from an OGR-ODBC layer with
phpmapscript.
No problem when i use my layer definition in a mapfile
but can't see anything when the definition is set with
mapscript (No matching record(s) found.

When i configure a mapfile like this, no problem:

LAYER
    NAME "mylayer"
    TYPE POINT
    CONNECTIONTYPE OGR
    TOLERANCE 5
    TEMPLATE "ttt_query.html"
    CONNECTION "my.ovf"    
    DATA "mylayer" 
    STATUS ON
    CLASS
      SYMBOL 1
      SIZE 6
      COLOR 0 0 255
    END
END

with my.ovf file:
<OGRVRTDataSource>
	   <OGRVRTLayer name="mylayer">
  	<SrcDataSource>ODBC:root at DSN</SrcDataSource> 
 	<SrcSQL>SELECT Id, X_LambertIII,Y_LambertIII FROM
batiment</SrcSQL> 
	<GeometryType>wkbPoint</GeometryType> 
	<GeometryField encoding='PointFromColumns'
x="X_LambertIII" y="Y_LambertIII"/> 
    	</OGRVRTLayer>
</OGRVRTDataSource>

but with this php-mapscript code, No matching record:
I can display the layer but can't select anything.

	$connexion=
	"<OGRVRTDataSource>
	    <OGRVRTLayer name='mylayer'>
        	<SrcDataSource>ODBC:root at DSN</SrcDataSource> 
 		<SrcSQL>SELECT Id, X_LambertIII,Y_LambertIII FROM
batiment</SrcSQL> 
		<GeometryType>wkbPoint</GeometryType> 
		<GeometryField encoding='PointFromColumns'
x='X_LambertIII' y='Y_LambertIII'/> 
    	</OGRVRTLayer>
	</OGRVRTDataSource>";
	$layer=ms_newLayerObj($gpoMap);
	$layer->set("name","mylayer");
	$layer->set("status",MS_ON);
	$layer->set("connectiontype",MS_OGR);
	$layer->set("connection",$connexion);
	$layer->set("type",MS_LAYER_POINT);
	$layer->set("data","mylayer");
	$layer->set("tolerance","5");
	$layer->set("template","ttt_query.html");
	$class = ms_newClassObj($layer);
	$style = ms_newStyleObj($class);
	$style->set("symbol",1);
	$style->set("size",6);
	$style->color->setRGB(0,0,255);
	
I can't see what's wrong.
Had anybody ever got this sort of problem?

Ludovic Gnemmi


	

	
		
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com



More information about the mapserver-users mailing list