<!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>
EXTENT -7.62370822331571 43.5483013153076 -0.202127302673821
48.9686855316162
<br>
FONTSET "fonts.list"
<br>
IMAGECOLOR 255 255 255
<br>
IMAGETYPE PNG
<br>
SYMBOLSET "examples.sym"
<br>
SIZE 650 475
<br>
STATUS ON
<br>
UNITS METERS
<br>
NAME "MS"
<br>
<br>
PROJECTION
<br>
"init=epsg:4326"
<br>
END
<br>
<br>
<br>
WEB
<br>
IMAGEPATH "/var/www/html/reglementation_fr/tmp/"
<br>
IMAGEURL "/reglementation_fr2/tmp/"
<br>
QUERYFORMAT text/html
<br>
LEGENDFORMAT text/html
<br>
BROWSEFORMAT text/html
<br>
TEMPLATE "TOTO"
<br>
METADATA
<br>
"queryable" "true"
<br>
wms_title "Demo serveur WMS"
<br>
wms_onlineressource "<a
href="http://xxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&"
target="_top" rel="nofollow" link="external">http://xxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&</a>"
<br>
wms_srs "EPSG:4326"
<br>
END
<br>
END
<br>
<br>
<br>
LAYER
<br>
CONNECTION "user=xxx dbname=reglementations_france host=localhost
password=xxx"
<br>
CONNECTIONTYPE POSTGIS
<br>
DATA "geom from (select distinct idcouche as oid,idcouche as
gid,idcouche,geom,nom from couches where groupe like 'traitcote') as
foo"
<br>
LABELITEM "nom"
<br>
METADATA
<br>
"queryable" "true"
<br>
"wms_title" "layer_fond"
<br>
END
<br>
NAME "layer_fond"
<br>
TEMPLATE 'TOTO'
<br>
PROJECTION
<br>
"init=epsg:4326"
<br>
END
<br>
STATUS ON
<br>
TYPE POLYGON
<br>
UNITS METERS
<br>
CLASS
<br>
STYLE
<br>
ANGLE 360
<br>
COLOR 200 200 200
<br>
OUTLINECOLOR 0 0 0
<br>
SYMBOL 0
<br>
WIDTH 1
<br>
END
<br>
END
<br>
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>
NAME monde
<br>
# Map image size
<br>
SIZE 700 700
<br>
EXTENT -6.844027 45.180141 -0.937777 50.224335
<br>
PROJECTION
<br>
"init=epsg:4326"
<br>
END
<br>
<br>
# Background color for the map canvas -- change as desired
<br>
<br>
IMAGEQUALITY 95
<br>
IMAGETYPE gif
<br>
OUTPUTFORMAT
<br>
NAME gif
<br>
DRIVER 'GD/GIF'
<br>
MIMETYPE 'image/gif'
<br>
#IMAGEMODE PC256
<br>
EXTENSION 'gif'
<br>
END
<br>
# Legend
<br>
<br>
<br>
# Web interface definition. Only the template parameter
<br>
# is required to display a map. See MapServer documentation
<br>
WEB
<br>
# Set IMAGEPATH to the path where MapServer should
<br>
# write its output.
<br>
IMAGEPATH '/tmp/'
<br>
<br>
# Set IMAGEURL to the url that points to IMAGEPATH
<br>
# as defined in your web server configuration
<br>
IMAGEURL '/tmp/'
<br>
<br>
# WMS server settings
<br>
METADATA
<br>
'wms_title' 'monde'
<br>
'wms_srs' 'EPSG:4326'
<br>
END
<br>
<br>
#Scale range at which web interface will operate
<br>
# Template and header/footer settings
<br>
# Only the template parameter is required to display a map. See
MapServer documentation
<br>
END
<br>
<br>
LAYER
<br>
NAME 'world_borders'
<br>
TYPE POLYGON
<br>
TEMPLATE '../../tmp/test.html'
<br>
DATA '/var/www/html/testmapscript/data/world_borders.shp'
<br>
<br>
STATUS DEFAULT
<br>
TRANSPARENCY 100
<br>
<br>
<br>
<br>
END
<br>
<br>
LAYER
<br>
CONNECTION "<a
href="http://xxxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&"
target="_top" rel="nofollow" link="external">http://xxxx/cgi-bin/mapserv?map=/var/www/html/reglementation_fr/data/mapfile/reglementations_wms.map&</a>"
<br>
CONNECTIONTYPE WMS
<br>
METADATA
<br>
"wms_srs" "EPSG:4326"
<br>
"queryable" "true"
<br>
"wms_name" "layer_fond"
<br>
"wms_format" "image/gif"
<br>
"wms_server_version" "1.1.1"
<br>
"wms_title" "layer_fond"
<br>
ENDa
<br>
NAME "layer_fond"
<br>
TEMPLATE '../../tmp/test.html'
<br>
STATUS ON
<br>
TYPE RASTER
<br>
UNITS METERS
<br>
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>
<?php
<br>
$map_path="/var/www/html/testmapscript/mapfile/";
<br>
<br>
$map = ms_newMapObj($map_path."toto3.map") or die("on a mal charge le
.map");
<br>
<br>
echo "Nombre de couches".($map->numlayers)."<HR>";
<br>
<br>
$mpoint = ms_newPointObj();
<br>
$mpoint->SetXY(0,48.20);
<br>
// find into layer the most closed point
<br>
//------- LOOP ON LAYERS and get identify results.
<br>
<br>
<br>
$tot = $map->numlayers;
<br>
for ($i =0; $i < $tot; $i++) {
<br>
//------- get map layer.
<br>
echo "on teste $i ";
<br>
$oLayer = $map->getLayer($i);
<br>
//------- Verify Layer type
<br>
//------- Validate if query succeeds.
<br>
$check_query = $oLayer->queryByPoint($mpoint, MS_SINGLE,0);
<br>
<br>
echo "---$check_query----".($oLayer->getNumResults())." ";
<br>
if ($check_query != MS_SUCCESS) {echo "Rien
".$oLayer->name."<BR> ";}
<br>
else {echo "on trouve une intersection avec
".$oLayer->name."<BR>";}
<br>
//------- Open layer for data input.
<br>
$oLayer->open();
<br>
<br>
} // for i
<br>
<br>
?>
<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>