problem with processQueryTemplate and projections

Bart van den Eijnden (OSGIS) bartvde at OSGIS.NL
Mon Dec 11 08:15:28 EST 2006


Hi list,

my MAP file contains a CONNECTIONTYPE WFS layer, which is in EPSG:28992, but
my map is in EPSG:4326. Using Mapserver's query templating (queryByRect),
the number of results found is correct (34), but the processQueryTemplate
function comes back with an empty string. The same situation works fine when
my map is in EPSG:28992.

Any ideas of what could be wrong? Thanks in advance.

This is the test script:

<?php
$oMap = ms_newmapobj('/data/home/bart/testbart2.map');
$oLayer = $oMap->getLayerByName('wfs_deelstroomgebieden');
$oLayer->queryByRect( $oMap->extent );
echo "num results = ".$oLayer->getNumResults()."<BR>";
$szCoords = $oMap->processQueryTemplate( array(), false );
echo $szCoords
?>

This is the relevant portion of the MAP file:

MAP
  EXTENT 4.5574652173913 50.241 7.4975347826087 52.109
  UNITS DD
  PROJECTION
    "init=epsg:4326"
  END

..

  LAYER
    CONNECTION "......"
    CONNECTIONTYPE WFS
      METADATA
        "wfs_srs"       "EPSG:28992"
        "wfs_typename"  "deelstroomgebieden"
      END
    NAME "wfs_deelstroomgebieden"
    PROJECTION
      "init=epsg:28992"
    END
    SIZEUNITS PIXELS
    STATUS ON
    TEMPLATE
"/data/geoservices/tmp/sess_457d4b6294293/maptips_template.html"
    TOLERANCE 5
    TOLERANCEUNITS PIXELS
    TYPE POLYGON
    UNITS METERS
    CLASS
      METADATA
      END
      TEMPLATE
"/data/geoservices/tmp/sess_457d4b6294293/maptips_template.html"
    END
  END

The template used contains (but works fine if the map projection equals the
layer projection):
<area shape="polygon" coords="[shpxy xf="," pf=" " proj="image"]"
href="javascript:void(0);" onmouseover='MapTipsOver(arguments[0], new
Array("[NAAM]"), new Array("NAAM"))' onmouseout='MapTipsOut(arguments[0],new
Array("[NAAM]"), new Array("NAAM"))'
onmousemove="CWC2OnMouseMoveFunction(arguments[0])">

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl



More information about the mapserver-users mailing list