<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<span class="ul-threaded" style="margin: 0.5em 0pt 0pt -20px;"><span
 class="text-cell">I need to make a querybypoint on a layers that are
wms layers.
<br>
<br>
the mapfile for the wms is
<br>
<br>
MAP
<br>
&nbsp; EXTENT -7.62370822331571 43.5483013153076 -0.202127302673821
48.9686855316162
<br>
&nbsp; FONTSET "fonts.list"
<br>
&nbsp; IMAGECOLOR 255 255 255
<br>
&nbsp; IMAGETYPE PNG
<br>
&nbsp; SYMBOLSET "examples.sym"
<br>
&nbsp; SIZE 650 475
<br>
&nbsp; STATUS ON
<br>
&nbsp; UNITS METERS
<br>
&nbsp; NAME "MS"
<br>
<br>
&nbsp;PROJECTION
<br>
&nbsp; "init=epsg:4326"
<br>
END
<br>
<br>
<br>
&nbsp; WEB
<br>
&nbsp; &nbsp; IMAGEPATH "/var/www/html/reglementation_fr/tmp/"
<br>
&nbsp; &nbsp; IMAGEURL "/reglementation_fr2/tmp/"
<br>
&nbsp; &nbsp; QUERYFORMAT text/html
<br>
&nbsp; &nbsp; LEGENDFORMAT text/html
<br>
&nbsp; &nbsp; BROWSEFORMAT text/html
<br>
TEMPLATE "TOTO"
<br>
&nbsp; &nbsp;METADATA
<br>
&nbsp;"queryable" "true"
<br>
&nbsp; &nbsp;wms_title "Demo serveur WMS"
<br>
&nbsp; &nbsp;wms_onlineressource "<a
 href="http://xxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&amp;"
 target="_top" rel="nofollow" link="external">http://xxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&amp;</a>"
<br>
&nbsp; &nbsp;wms_srs "EPSG:4326"
<br>
&nbsp; &nbsp;END
<br>
&nbsp; END
<br>
<br>
<br>
&nbsp;LAYER
<br>
&nbsp; &nbsp; CONNECTION "user=xxx dbname=reglementations_france host=localhost
password=xxx"
<br>
&nbsp; &nbsp; CONNECTIONTYPE POSTGIS
<br>
&nbsp; &nbsp; DATA "geom from (select distinct idcouche as oid,idcouche as
gid,idcouche,geom,nom from couches where groupe like 'traitcote') as
foo"
<br>
&nbsp; &nbsp; LABELITEM "nom"
<br>
&nbsp; &nbsp; METADATA
<br>
&nbsp;"queryable" "true"
<br>
&nbsp; &nbsp; &nbsp; "wms_title" &nbsp; &nbsp;"layer_fond"
<br>
&nbsp; &nbsp; END
<br>
&nbsp; &nbsp; NAME "layer_fond"
<br>
&nbsp; &nbsp; TEMPLATE 'TOTO'
<br>
&nbsp;PROJECTION
<br>
&nbsp; &nbsp; &nbsp; "init=epsg:4326"
<br>
&nbsp; &nbsp; END
<br>
&nbsp; &nbsp; STATUS ON
<br>
&nbsp; &nbsp; TYPE POLYGON
<br>
&nbsp; &nbsp; UNITS METERS
<br>
&nbsp; &nbsp; CLASS
<br>
&nbsp; &nbsp; &nbsp; STYLE
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ANGLE 360
<br>
&nbsp; &nbsp; &nbsp; &nbsp; COLOR 200 200 200
<br>
&nbsp; &nbsp; &nbsp; &nbsp; OUTLINECOLOR 0 0 0
<br>
&nbsp; &nbsp; &nbsp; &nbsp; SYMBOL 0
<br>
&nbsp; &nbsp; &nbsp; &nbsp; WIDTH 1
<br>
&nbsp; &nbsp; &nbsp; END
<br>
&nbsp; &nbsp; END
<br>
&nbsp; END
<br>
<br>
<br>
END
<br>
<br>
<br>
And i want to make a query by point on a mapfile that use these wms
layers
<br>
<br>
MAP
<br>
&nbsp; NAME monde
<br>
&nbsp; # Map image size
<br>
&nbsp; SIZE 700 700
<br>
&nbsp; EXTENT -6.844027 45.180141 -0.937777 50.224335
<br>
&nbsp; PROJECTION
<br>
&nbsp; &nbsp; &nbsp; "init=epsg:4326"
<br>
&nbsp; &nbsp; END
<br>
<br>
&nbsp; # Background color for the map canvas -- change as desired
<br>
<br>
&nbsp; IMAGEQUALITY 95
<br>
&nbsp; IMAGETYPE gif
<br>
&nbsp; OUTPUTFORMAT
<br>
&nbsp; &nbsp; NAME gif
<br>
&nbsp; &nbsp; DRIVER 'GD/GIF'
<br>
&nbsp; &nbsp; MIMETYPE 'image/gif'
<br>
&nbsp; &nbsp; #IMAGEMODE PC256
<br>
&nbsp; &nbsp; EXTENSION 'gif'
<br>
&nbsp; END
<br>
&nbsp; # Legend
<br>
<br>
<br>
&nbsp; # Web interface definition. Only the template parameter
<br>
&nbsp; # is required to display a map. See MapServer documentation
<br>
&nbsp; WEB
<br>
&nbsp; &nbsp; # Set IMAGEPATH to the path where MapServer should
<br>
&nbsp; &nbsp; # write its output.
<br>
&nbsp; &nbsp; IMAGEPATH '/tmp/'
<br>
<br>
&nbsp; &nbsp; # Set IMAGEURL to the url that points to IMAGEPATH
<br>
&nbsp; &nbsp; # as defined in your web server configuration
<br>
&nbsp; &nbsp; IMAGEURL '/tmp/'
<br>
<br>
&nbsp; &nbsp; # WMS server settings
<br>
&nbsp; &nbsp; METADATA
<br>
&nbsp; &nbsp; &nbsp; 'wms_title' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'monde'
<br>
&nbsp; &nbsp; &nbsp; 'wms_srs' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'EPSG:4326'
<br>
&nbsp; &nbsp; END
<br>
<br>
&nbsp; &nbsp; #Scale range at which web interface will operate
<br>
&nbsp; &nbsp; # Template and header/footer settings
<br>
&nbsp; &nbsp; # Only the template parameter is required to display a map. See
MapServer documentation
<br>
&nbsp; END
<br>
<br>
&nbsp; LAYER
<br>
&nbsp; &nbsp; NAME 'world_borders'
<br>
&nbsp; &nbsp; TYPE POLYGON
<br>
TEMPLATE '../../tmp/test.html'
<br>
&nbsp; &nbsp; DATA '/var/www/html/testmapscript/data/world_borders.shp'
<br>
&nbsp;
<br>
&nbsp; &nbsp; STATUS DEFAULT
<br>
&nbsp; &nbsp; TRANSPARENCY 100
<br>
&nbsp;
<br>
&nbsp;
<br>
<br>
&nbsp; &nbsp; &nbsp; END
<br>
<br>
&nbsp; &nbsp;LAYER
<br>
&nbsp; &nbsp; CONNECTION "<a
 href="http://xxxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&amp;"
 target="_top" rel="nofollow" link="external">http://xxxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&amp;</a>"
<br>
&nbsp; &nbsp; CONNECTIONTYPE WMS
<br>
&nbsp; &nbsp; METADATA
<br>
&nbsp; &nbsp; &nbsp; "wms_srs" &nbsp; &nbsp;"EPSG:4326"
<br>
"queryable" &nbsp; &nbsp;"true"
<br>
&nbsp; &nbsp; &nbsp; "wms_name" &nbsp; &nbsp;"layer_fond"
<br>
&nbsp; &nbsp; &nbsp; "wms_format" &nbsp; &nbsp;"image/gif"
<br>
&nbsp; &nbsp; &nbsp; "wms_server_version" &nbsp; &nbsp;"1.1.1"
<br>
&nbsp; &nbsp; &nbsp; "wms_title" &nbsp; &nbsp;"layer_fond"
<br>
&nbsp; &nbsp; ENDa
<br>
&nbsp; &nbsp; NAME "layer_fond"
<br>
TEMPLATE '../../tmp/test.html'
<br>
&nbsp; &nbsp; STATUS ON
<br>
&nbsp; &nbsp; TYPE RASTER
<br>
&nbsp; &nbsp; UNITS METERS
<br>
&nbsp; END
<br>
END
<br>
<br>
With mapscript the map appear no problem. But then i want to know if
i've got a layer that is on the point (0,48.20)
<br>
<br>
so here is my php file
<br>
<br>
&lt;?php
<br>
$map_path="/var/www/html/testmapscript/mapfile/";
<br>
&nbsp; &nbsp; &nbsp; &nbsp; <br>
$map = ms_newMapObj($map_path."toto3.map") or die("on a mal charge le
.map");
<br>
<br>
echo "Nombre de couches".($map-&gt;numlayers)."&lt;HR&gt;";
<br>
<br>
&nbsp;$mpoint = ms_newPointObj();
<br>
&nbsp; &nbsp; $mpoint-&gt;SetXY(0,48.20);
<br>
&nbsp; &nbsp; // find into layer the most closed point
<br>
//------- LOOP ON LAYERS and get identify results.
<br>
<br>
<br>
$tot = $map-&gt;numlayers;
<br>
for ($i =0; $i &lt; $tot; $i++) {
<br>
&nbsp; &nbsp;//------- get map layer.
<br>
echo "on teste $i ";
<br>
&nbsp; &nbsp;$oLayer = $map-&gt;getLayer($i);
<br>
&nbsp; &nbsp;//------- Verify Layer type
<br>
&nbsp; &nbsp;//------- Validate if query succeeds.
<br>
&nbsp; &nbsp;$check_query = $oLayer-&gt;queryByPoint($mpoint, MS_SINGLE,0);
<br>
<br>
echo "---$check_query----".($oLayer-&gt;getNumResults())." ";
<br>
&nbsp; &nbsp;if ($check_query != MS_SUCCESS) {echo "Rien
".$oLayer-&gt;name."&lt;BR&gt; ";}
<br>
&nbsp; &nbsp; &nbsp; &nbsp; else {echo "on trouve une intersection avec
".$oLayer-&gt;name."&lt;BR&gt;";}
<br>
&nbsp; &nbsp;//------- Open layer for data input.
<br>
&nbsp; &nbsp; $oLayer-&gt;open();
<br>
<br>
} // for i
<br>
&nbsp;
<br>
?&gt;
<br>
<br>
<br>
He find that my layer world_borders (from the shapefile) in on the
point but not the second one. But both should be find.
<br>
<br>
Please why can't i querybypoint on a wms layer ?
<br>
<br>
Jerome guitton</span></span>
</body>
</html>