[mapserver-dev] Call for discussion on MS RFC 114: Faster retrieval of shape count
Rahkonen Jukka (MML)
jukka.rahkonen at maanmittauslaitos.fi
Wed Feb 10 03:52:54 PST 2016
Hi,
I am thinking about the metadata setting “wfs_ignore_maxfeatures_for_hits”. While it is certainly useful for the users sometimes I believe that ignoring maxfeatures is still not WFS standard compliant. Quotation from WFS 1.1.0 standard:
"In this way [by using resultType=hits] a client may obtain a count of the number of features that a query would return without having to incur the cost of transmitting the entire result set."
If ignore maxfeatures is set in the metadata it makes that WFS service permanently non-compliant. I wonder if we could have a vendor parameter like "&feature_count=total" for controlling which count &resultType=hits will return. For end user both counts can be valuable: total count for knowing the size of the layer and the count that takes maxFeatures into account the maximum size that can be used for paging.
-Jukka Rahkonen-
Even Rouault wrote:
> Hi Steve,
>> Hi Even: I take it that "the_normal_sql_query" could also include the
>> translated filter described by a layers FILTER/FILTERITEM combo or the
>> NATIVE_FILTER processing option, correct?
> Hum, I was convinced that my implementation in the PostGIS driver already did that, but it didn't ! And by further checking, I also saw I missed that
msQueryByFilter() could be called indirectly by the WFS code through FLTxxxxx().
> Those 2 issues are now fixed with :
https://github.com/rouault/mapserver/commit/4557afed33f92d22c969282d22dacf027e5e7387
https://github.com/rouault/mapserver/commit/28354fe4bd5f5c3058a87ebc31d55ca7905388f3
> I've also added new test cases in msautotest:
https://github.com/mapserver/msautotest/commit/05e8264ce737a795d81f1a87614fa5c87399de91
>
>> The only other gotcha is how (or if) to deal with class-level templates.
>> The presence of a template is used to decide if a feature is to be
>>processed as part of query operation and, in theory, if it should be
>> counted. Typically one would configure a template at the LAYER-level
>> but it's also possible to define CLASS-level templates. For example:
>>
> CLASSITEM 'column'
>> CLASS
>> EXRESSION 'foo'
>> TEMPLATE 'void'
>> ...
>> END
>> CLASS
>> EXRESSION 'bar'
>> # no template
>> ...
>> END
>>
>> In this case you wouldn't know if you should count a feature until you
>> know what CLASS it is. Granted this is an older configuration option
>> that probably isn't widely used but it does exist. Perhaps it's
>> currently broken anyway, I haven't tested. Just not sure how to deal with it.
>> Perhaps it just needs to be noted as a configuration exception folks
>> need to avoid when setting up WFS. I'd be happy to see that option
>> removed in the next version - it adds unnecessary complexity to the
>> query code. You can see the affect in msIsLayerQueryable() in
>> mapquery.c among other places in that source file.
> I indeed see such stuff in msQueryByRect() and didn't know what it was supposed to do. In fact, the WFS code has always forced a dummy "ttt.html" layer template (if no layer template is defined), so class templates are de-facto unused in WFS (since the msQueryXXXX() functions do no test class templates if a layer template is defined). And the msLayerGetShapeCount() optimization path is only taken if a layer template is defined. So for non-WFS case, map-
>query.only_cache_result_count == 1 and class templates will still work
>as
before.
> I've modified the RFC with the above changes and precisions :
https://github.com/mapserver/docs/commit/76dfe8cb73c9c3de2f2e878e7c856dedc7a10c28
> Thanks a lot for your very much appreciated input !
> Unrelated note: my latest commit fails in renderers/wmsclient.map because
http://demo.mapserver.org/cgi-
bin/mapserv?map=/osgeo/mapserver/msautotest/world/world.map&service=WMS&request=GetCapabilities
doesn't respond.
> Even
>>
>> Steve
>
> -----Original Message-----
> From: mapserver-dev [mailto:mapserver-dev-bounces at lists.osgeo.org] On
> Behalf Of Even Rouault Sent: Monday, February 08, 2016 4:58 AM
> To: MapServer Dev Mailing List <mapserver-dev at lists.osgeo.org>
> Subject: [mapserver-dev] Call for discussion on MS RFC 114: Faster
> retrieval of shape count
>
> Hi,
>
> Your comments on the following RFC are welcome :
> http://mapserver.org/development/rfc/ms-rfc-114.html
>
> Even
--
Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
More information about the mapserver-dev
mailing list