<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>i have a question with the Filter parameter.</p>
    <p>without a filter, mapserver does a normal SQL query like:<br>
    </p>
    <p>select
"pkid","set","id","lod","type","source","referencepoint","boundingbox",encode(ST_AsBinary(ST_Force_2D("groundsurface"),'NDR'),'hex')
      as geom,"id" from building where groundsurface &&
      ST_GeomFromText('POLYGON((691642.41999 5334989.72599,691642.41999
      5335172.82301,691979.17301 5335172.82301,691979.17301
      5334989.72599,691642.41999 5334989.72599))',-1) limit 101<br>
    </p>
    <p>but if i add an BBox filter, i got a wrong polygon:</p>
    <p>select
"pkid","set","id","lod","type","source","referencepoint","boundingbox",encode(ST_AsBinary(ST_Force_2D("groundsurface"),'NDR'),'hex')
      as geom,"id" from building where groundsurface &&
      ST_GeomFromText('POLYGON((-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133 -0.999999999990785))',-1)
      and (st_intersects(groundsurface,ST_GeomFromText('POLYGON
      ((691813.1405204038600000 5335101.3663145527000000,
      691813.1405204038600000 5335921.3585226759000000,
      692960.5523786536700000 5335921.3585226759000000,
      692960.5523786536700000 5335101.3663145527000000,
      691813.1405204038600000 5335101.3663145527000000))',-1)) = TRUE)<br>
    </p>
    <p>... The polygon:<br>
    </p>
    <p>'POLYGON((-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133
      -0.999999999990785,-0.999888179649133 -0.999999999990785))',-1</p>
    is wrong. A normal SQL query without these values, gets my desired
    result.<br>
    <br>
    My map File:<br>
    --------------------------------------------------------------<br>
    MAP<br>
        NAME "sample"<br>
        <br>
        SIZE 800 400<br>
     DEBUG 5<br>
        OUTPUTFORMAT<br>
          NAME "geojson"<br>
          DRIVER "OGR/GEOJSON"<br>
          MIMETYPE "application/json; subtype=geojson"<br>
          FORMATOPTION "STORAGE=stream"<br>
          FORMATOPTION "FORM=SIMPLE"<br>
        END<br>
            <br>
    CONFIG MS_ERRORFILE "ms_error.log"<br>
      PROJECTION<br>
        "init=epsg:32632"<br>
    <br>
      END<br>
    <br>
      WEB<br>
        METADATA<br>
          ows_enable_request "*"<br>
        END<br>
      END<br>
    <br>
        LAYER<br>
         DEBUG 5<br>
          NAME "poly"<br>
          STATUS DEFAULT<br>
          TYPE POLYGON<br>
         METADATA<br>
         "wfs_srs"         "EPSG:32632"<br>
          "wms_transparent"              "true"<br>
          "wfs_getfeature_formatlist"    "geojson"<br>
        END<br>
            PROJECTION<br>
              'init=epsg:32632'<br>
            END<br>
          CONNECTIONTYPE postgis<br>
          CONNECTION "host=localhost port=5432 user=postgres
    password=xxxxx dbname=map_daniel"<br>
          DATA "groundsurface from building using SRID=-1 using unique
    id"<br>
          CLASS<br>
            STYLE<br>
              COLOR "#88888888"<br>
              ANTIALIAS true<br>
            END<br>
          END<br>
        END<br>
    END<br>
    -------------------------------------------------------------<br>
    And the Request:<br>
    <a class="moz-txt-link-freetext"
href="http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRSNAME=EPSG:32632&TYPENAMES=poly&COUNT=100&outputformat1=geojson&map=C:%5CUsers%5Cd.hardes%5CDocuments%5Cmap.map&Filter=">http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRSNAME=EPSG:32632&TYPENAMES=poly&COUNT=100&outputformat1=geojson&map=C:\Users\d.hardes\Documents\map.map&Filter=</a><Filter><BBOX><PropertyName>poly</PropertyName><Box
    srsName="EPSG:32632">  
    <coordinates>691813.1405204039,5335101.366314553
692960.5523786537,5335921.358522676</coordinates></Box></BBOX></Filter><br>
    <br>
    And result<br>
    <?xml version='1.0' encoding="UTF-8" ?><br>
    <wfs:FeatureCollection<br>
       xmlns:ms=<a class="moz-txt-link-rfc2396E"
      href="http://mapserver.gis.umn.edu/mapserver">"http://mapserver.gis.umn.edu/mapserver"</a><br>
       xmlns:wfs=<a class="moz-txt-link-rfc2396E"
      href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a><br>
       xmlns:gml=<a class="moz-txt-link-rfc2396E"
      href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a><br>
       xmlns:ogc=<a class="moz-txt-link-rfc2396E"
      href="http://www.opengis.net/ogc">"http://www.opengis.net/ogc"</a><br>
       xmlns:xsi=<a class="moz-txt-link-rfc2396E"
      href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
       xsi:schemaLocation="<a class="moz-txt-link-freetext"
      href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a
      class="moz-txt-link-freetext"
      href="http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd</a>
    <br>
                           <a class="moz-txt-link-freetext"
      href="http://mapserver.gis.umn.edu/mapserver">http://mapserver.gis.umn.edu/mapserver</a>
    <a class="moz-txt-link-freetext"
href="http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=poly&amp;OUTPUTFORMAT=XMLSCHEMA">http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=poly&amp;OUTPUTFORMAT=XMLSCHEMA</a>"><br>
        <gml:boundedBy><br>
            <gml:null>missing</gml:null><br>
        </gml:boundedBy><br>
    </wfs:FeatureCollection><br>
    <br>
    <br>
    where is the Error in my settings?<br>
    <div class="moz-signature">-- <br>
      <table style="table-layout:fixed" border="0" cellpadding="0"
        width="450">
        <tbody>
          <tr>
            <td class="logo-td" align="left" valign="middle" width="136">
              <p style="margin-right: 10px; font-family: Helvetica,
                Arial, sans-serif; font-size: 10px; line-height: 12px;
                margin-bottom: 10px;"> <a style="text-decoration:none"
                  href="http://www.3dis.de" class="clink logo-container">
                  <img src="cid:part11.6A716C59.3324A342@3dis.de"
                    alt="3DIS GmbH" class="sig-logo" border="0"> </a> </p>
            </td>
            <td class="content-td" align="left" nowrap="nowrap"
              width="NaN">
              <p style="font-family: Helvetica, Arial, sans-serif;
                font-size: 10px; line-height: 12px; color: rgb(33, 33,
                33); margin-bottom: 10px;"><span style="font-weight:
                  bold; color: rgb(33, 33, 33); display: inline;"
                  class="txt signature_name-target sig-hide">Daniel
                  Hardes</span> <span class="email-sep break"
                  style="display: inline;"><br>
                </span> Mail: <a class="link email
                  signature_email-target sig-hide"
                  href="mailto:kalkofen@3dis.de" style="color: rgb(71,
                  124, 204); text-decoration: none; display: inline;">hardes@3dis.de</a><span
                  class="signature_email-sep sep" style="display:
                  inline;"> | </span><span style="color: rgb(33, 33,
                  33); display: inline;" class="txt
                  signature_mobilephone-target sig-hide">Tel.: +49
                  (0)2861 8919 84</span></p>
              <p style="font-family: Helvetica, Arial, sans-serif;
                font-size: 10px; line-height: 12px; margin-bottom:
                10px;"> <span style="font-weight: bold; color: rgb(33,
                  33, 33); display: inline;" class="txt
                  signature_companyname-target sig-hide">3DIS GmbH</span>
                <span class="company-sep break" style="display: inline;"><br>
                </span> <span class="address-sep break"></span> <span
                  style="color: rgb(33, 33, 33); display: inline;"
                  class="txt signature_address-target sig-hide">Konrad-Zuse-Straße
                  6</span> <span class="address2-sep break"
                  style="display: block;"></span> <span style="color:
                  rgb(33, 33, 33); display: inline;" class="txt
                  signature_address2-target sig-hide">D - 46397 Bocholt</span>
                <span class="website-sep break" style="display: inline;"><br>
                </span> <a class="link signature_website-target
                  sig-hide" href="http://www.3dis.de" style="color:
                  rgb(71, 124, 204); text-decoration: none; display:
                  inline;">www.3dis.de</a> </p>
            </td>
          </tr>
          <tr>
            <td colspan="2">
              <p style="font-family: Helvetica, Arial, sans-serif;
                color: #212121; font-size: 9px; line-height: 12px;"
                class="txt signature_disclaimer-target">3DIS GmbH |
                Geschäftsführung: Gerrit Hoven, Andreas Steffens |
                Amtsgericht Coesfeld | HRB 12986</p>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>