[mapserver-users] msQueryByFilter(): Search returned no results.

Steve Lime sdlime at gmail.com
Fri Aug 26 13:53:46 PDT 2011


Ok, definitely a bug here... Will take a look. Steve

2011/8/26 Michal Šrédl <michal.sredl at gmail.com>:
> Hi Steve,
>
> for epsg:4326 and url
>
> http://localhost//cgi-bin/ows?mode=itemnquery&qlayer=typ&qitem=zver&qstring=2
>
> it says
>
> msQueryByAttributes(): Search returned no results. No matching
> record(s) found, layer and area of interest do not overlap.
>
> Cheers,
>
> Mike
>
> 2011/8/26 Steve Lime <sdlime at gmail.com>:
>> You must have a default mapfile set in apache, that's cool. Use the second URL.
>>
>> Change qstring_validation to qstring_validation_pattern from my first
>> message, my mistake.
>>
>> Steve
>>
>> 2011/8/26 Michal Šrédl <michal.sredl at gmail.com>:
>>> Hi Steve,
>>>
>>> regardless of the projection settings, I get the following result:
>>>
>>> For
>>>
>>>  http://localhost//cgi-bin/ows?map=mapfile&mode=itemnquery&qlayer=typ&qitem=zver&qstring=2
>>>
>>> I see
>>>
>>>  msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN
>>> validation failed. msEvalRegex(): Regular expression error. String
>>> failed expression test.
>>>
>>> And for
>>>
>>>  http://localhost//cgi-bin/ows?mode=itemnquery&qlayer=typ&qitem=zver&qstring=2
>>>
>>> I see
>>>
>>>  mapserv(): Web application error. Parameter 'qstring' value fails to
>>> validate. msValidateParameter(): Regular expression error. Parameter
>>> pattern validation failed.
>>>
>>> Cheers,
>>>
>>> Michal
>>>
>>>
>>> 2011/8/26 Steve Lime <sdlime at gmail.com>:
>>>> I would agree this sounds like a bug. The map extent *should* be
>>>> projected to the layer extent and that's what's used to identify
>>>> candidate features. Can you check what happens with a native mapserver
>>>> attribute query in this case? If possible try this:
>>>>
>>>> 1) set your MAP projection back to geographic, and restore your
>>>> geographic map extent.
>>>> 2) add this line to the layer metadata 'qstring_validation' '^[0-9]$'
>>>> 3) go to the following URL:
>>>>
>>>>  http://localhost//cgi-bin/ows?map=[yourmapfile]&mode=itemnquery&qlayer=typ&qitem=zver&qstring=2
>>>>
>>>> and see what happens.
>>>>
>>>> This will run a different query function msQueryByAttributes() that's
>>>> not new to 6.0.x.
>>>>
>>>> Steve
>>>>
>>>> 2011/8/26 Michal Šrédl <michal.sredl at gmail.com>:
>>>>> Hi Jukka,
>>>>>
>>>>> the current settings returns expected result with &srsName=EPSG:4326
>>>>> as well. The original settings doesn't work neither with
>>>>> &srsName=EPSG:4326 nor &srsName=EPSG::102067.
>>>>>
>>>>> Yes, it looks like there would be a problem in case of several WFS
>>>>> layers with different projections of the source data.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Mike
>>>>>
>>>>> 2011/8/26 Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>:
>>>>>> Hi,
>>>>>>
>>>>>> Good that you could make it to work. However, this feels maybe like a bug if it means that using ogc:PropertyIsEqualTo filter without any other filter works only if projection of the source data is the same than the default output projection from WFS.
>>>>>>
>>>>>> Could you have one more trial with the original settings and see if adding &srsName=EPSG:4326 or &srsName=EPSG::102067 is changing anything? And also if your current setting gives correct result with &srsName=EPSG:4326.
>>>>>>
>>>>>> -Jukka Rahkonen.
>>>>>>
>>>>>> Michal Šrédl wrote:
>>>>>>
>>>>>>
>>>>>>> Hi all,
>>>>>>
>>>>>>> problem solved. I needed to set:
>>>>>>
>>>>>>> EXTENT -905000 -1230000 -400000 -900000
>>>>>>
>>>>>> and
>>>>>>
>>>>>> PROJECTION
>>>>>> ##  "init=epsg:4326"
>>>>>>  "init=epsg:102067"
>>>>>> END
>>>>>>
>>>>>> (Epsg 102067 is the projection of the layer being filtered.)
>>>>>>
>>>>>> Thank you very much again,
>>>>>>
>>>>>> Michal
>>>>>>
>>>>>>
>>>>>> 2011/8/25 Michal Šrédl <michal.sredl at gmail.com>:
>>>>>>> Hi Steve,
>>>>>>>
>>>>>>> Thanks a lot. The extent should be large enough to encompass all the
>>>>>>> features. Here comes the whole mapfile:
>>>>>>>
>>>>>>> MAP
>>>>>>> NAME "MIS WFS Server"
>>>>>>> STATUS ON
>>>>>>> SIZE 500 500
>>>>>>> EXTENT -180 -90 180 90
>>>>>>> SHAPEPATH "data/"
>>>>>>> IMAGECOLOR 255 255 255
>>>>>>> CONFIG MS_ERRORFILE "log/mapserv.log"
>>>>>>> DEBUG 5
>>>>>>>
>>>>>>> WEB
>>>>>>>  IMAGEPATH "/var/www/tmp/"
>>>>>>>  IMAGEURL "/tmp/"
>>>>>>>  METADATA
>>>>>>>    "wfs_title"            "MIS WFS Server"  ## REQUIRED
>>>>>>>    "wfs_onlineresource"   "http://127.0.0.1/cgi-bin/ows?"
>>>>>>>    "wfs_srs"               "EPSG:4326 EPSG:102067"
>>>>>>>    "wms_srs"               "EPSG:4326 EPSG:102067"  ## Recommended
>>>>>>>    "wcs_srs"               "EPSG:4326 EPSG:102067"  ## Recommended
>>>>>>>    "ows_enable_request" "*"
>>>>>>>    "ows_updatesequence" "2011-29-05T00:24:00"
>>>>>>>  END
>>>>>>> END
>>>>>>>
>>>>>>> PROJECTION
>>>>>>>  "init=epsg:4326"
>>>>>>> END
>>>>>>>
>>>>>>> LAYER
>>>>>>>  NAME "typ"
>>>>>>>  METADATA
>>>>>>>    "wfs_title"    "Typologie" ## REQUIRED
>>>>>>>    "wfs_include_items" "all"
>>>>>>>    "gml_featureid" "CISLO" ## REQUIRED
>>>>>>>    "gml_include_items" "all"  ## Optional (serves all attributes for layer)
>>>>>>>    "gml_types" "auto"
>>>>>>>    "gml_geometries" "msGeometry"
>>>>>>>    "gml_msGeometry_type" "polygon"
>>>>>>>  END
>>>>>>>  DATA typ.shp
>>>>>>>  TYPE POLYGON
>>>>>>>  STATUS ON
>>>>>>>  PROJECTION
>>>>>>>    "init=epsg:102067"
>>>>>>>  END
>>>>>>>  DUMP TRUE           ## REQUIRED
>>>>>>>  CLASS
>>>>>>>    NAME "Typ"
>>>>>>>    STYLE
>>>>>>>      COLOR 0 0 155
>>>>>>>      OUTLINECOLOR 120 120 120
>>>>>>>    END
>>>>>>>    TEMPLATE "templates/typ_zver.html"
>>>>>>>  END
>>>>>>>  DEBUG 5
>>>>>>> END # Layer
>>>>>>>
>>>>>>> LAYER
>>>>>>>    NAME "hsrs"
>>>>>>>    TYPE RASTER
>>>>>>>    STATUS ON
>>>>>>>    CONNECTION "http://www.bnhelp.cz/cgi-bin/crtopo?"
>>>>>>>    DEBUG ON
>>>>>>>    CONNECTIONTYPE WMS
>>>>>>>    METADATA
>>>>>>>        "wms_srs"             "EPSG:4326"
>>>>>>>        "wms_name"            "obce,kraje,hr_cr,sidla,doprava"
>>>>>>>        "wms_title"            "CR Topo"
>>>>>>>        "wms_server_version"  "1.1.1"
>>>>>>>        "wms_format"          "image/png"
>>>>>>>        "wms_latlonboundingbox" "11.9384 48.2337 18.957 51.3549"
>>>>>>>    END
>>>>>>> END
>>>>>>>
>>>>>>> END # Map File
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Michal
>>>>>>>
>>>>>>> 2011/8/25 Steve Lime <sdlime at gmail.com>:
>>>>>>>> What is your default EXTENT set to in your mapfile? It should be large enough to encompass all features. - Steve
>>>>>>>>
>>>>>>>> Sent from my iPad
>>>>>>>>
>>>>>>>> On Aug 24, 2011, at 7:58 AM, Michal Šrédl <michal.sredl at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I am trying to use FES filter for WFS layer and get no result, even
>>>>>>>>> thought I should get one.
>>>>>>>>>
>>>>>>>>> In my browser, I request
>>>>>>>>>
>>>>>>>>> http://localhost//cgi-bin/ows?&REQUEST=GetFeature&VERSION=1.1.0&SERVICE=WFS&TYPENAME=typ&FILTER=<ogc:Filter
>>>>>>>>> xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>ZVER</ogc:PropertyName><ogc:Literal>2</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
>>>>>>>>>
>>>>>>>>> and get
>>>>>>>>>
>>>>>>>>> <wfs:FeatureCollection
>>>>>>>>> xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
>>>>>>>>> xmlns:gml="http://www.opengis.net/gml"
>>>>>>>>> xmlns:wfs="http://www.opengis.net/wfs"
>>>>>>>>> xmlns:ogc="http://www.opengis.net/ogc"
>>>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>> xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver
>>>>>>>>> http://127.0.0.1/cgi-bin/ows?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=typ&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1
>>>>>>>>> http://www.opengis.net/wfs
>>>>>>>>> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
>>>>>>>>> <gml:boundedBy>
>>>>>>>>> <gml:Null>missing</gml:Null>
>>>>>>>>> </gml:boundedBy>
>>>>>>>>> </wfs:FeatureCollection>
>>>>>>>>>
>>>>>>>>> even though I do know, that features with ZVER=2 do exist.
>>>>>>>>>
>>>>>>>>> In the mapserver log file, I get
>>>>>>>>>
>>>>>>>>> [Wed Aug 24 14:48:52 2011].296607 msQueryByFilter(): Search returned
>>>>>>>>> no results. No matching record(s) found.
>>>>>>>>> [Wed Aug 24 14:48:52 2011].296747 mapserv request processing time
>>>>>>>>> (msLoadMap not incl.): 0.002s
>>>>>>>>> [Wed Aug 24 14:48:52 2011].296764 msFreeMap(): freeing map at 0x2783120.
>>>>>>>>> [Wed Aug 24 14:48:52 2011].296773 freeLayer(): freeing layer at 0x278b570.
>>>>>>>>>
>>>>>>>>> I have checked http://mapserver.org/errors.html#id2 with similar error
>>>>>>>>> "msQueryByPoint: search returned no results" and tried to create a
>>>>>>>>> simple template:
>>>>>>>>>
>>>>>>>>> <!-- MapServer Template -->
>>>>>>>>> <tr>
>>>>>>>>>  <td>[lrn]</td>
>>>>>>>>>  <td>[ZVER]</td>
>>>>>>>>> </tr>
>>>>>>>>>
>>>>>>>>> but with no effect.
>>>>>>>>>
>>>>>>>>> In the mapfile, there is
>>>>>>>>>
>>>>>>>>> LAYER
>>>>>>>>>  NAME "typ"
>>>>>>>>>  METADATA
>>>>>>>>>    "wfs_title"    "Typologie" ## REQUIRED
>>>>>>>>>    "gml_featureid" "CISLO" ## REQUIRED
>>>>>>>>>    "gml_include_items" "all"  ## Optional (serves all attributes for layer)
>>>>>>>>>    "gml_types" "auto"
>>>>>>>>>    "gml_geometries" "msGeometry"
>>>>>>>>>    "gml_msGeometry_type" "polygon"
>>>>>>>>>  END
>>>>>>>>>  DATA typ.shp
>>>>>>>>>  TYPE POLYGON
>>>>>>>>>  STATUS ON
>>>>>>>>>  PROJECTION
>>>>>>>>>    "init=epsg:102067"
>>>>>>>>>  END
>>>>>>>>>  DUMP TRUE           ## REQUIRED
>>>>>>>>>  CLASS
>>>>>>>>>    NAME "Typ"
>>>>>>>>>    STYLE
>>>>>>>>>      COLOR 0 0 155
>>>>>>>>>      OUTLINECOLOR 120 120 120
>>>>>>>>>    END
>>>>>>>>>    TEMPLATE "templates/typ_zver.html"
>>>>>>>>>  END
>>>>>>>>>  DEBUG 5
>>>>>>>>> END # Layer
>>>>>>>>>
>>>>>>>>> What is wrong with my FES filter? How can I make it to run?
>>>>>>>>>
>>>>>>>>> Thanks a lot,
>>>>>>>>>
>>>>>>>>> Michal
>>>>>>>>> _______________________________________________
>>>>>>>>> mapserver-users mailing list
>>>>>>>>> mapserver-users at lists.osgeo.org
>>>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> mapserver-users mailing list
>>>>>> mapserver-users at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>
>>>>>
>>>>
>>>
>>
>



More information about the MapServer-users mailing list