The layer MAXFEATURES parameter was a means of limiting the number of features drawn. The parameter also was used for limiting query results- kind of a mess. Things were refactored in 6.2 I believe (TODO: find ticket number) and the drawing support seems to be gone...Look specifically at the lakes in the following maps.
c.f. #3739 ?
it would seem that int msLayerGetMaxFeaturesToDraw(layerObj *layer, outputFormatObj *format) isn't checking for layer->maxfeatures
int msLayerGetMaxFeaturesToDraw(layerObj *layer, outputFormatObj *format)
restore check for layer->maxfeatures (#4730)
add maxfeatures test for mapserver/mapserver#4730
committed to master in a0ef44a along with a couple of tests
@sdlime I'll let you close this one if you can confirm the fix.
Nope, doesn't fix it, in fact the features go away.
Demonstrates the bug:
6.4/Master (note all the lakes go away):
Maybe I should just update my mapfile to use the metadata (maxfeaturestodraw) and we revert your changes.
is your layer->maxfeatures set to 0 in your mapfile ? As to the check for layer->maxfeatures, the documentation is pretty clear that the check also happens when drawing, not only for WFS requests.
MaxFeatures is set to 100. Metadata doesn't work either. --Steve
Ok, I'll have a look
@sdlime I've traced the code with some debugging statements and it seems to be working as expected for me. The test added in mapserver/msautotest_DEPRECATED@42965a3 also seems to point that features are rendered, and are limited to the maxfeature/maxfeaturestodraw parameters (map->web->metadata->maxfeaturestodraw is not tested).
Ok, this will sound weird but what I'm seeing is the difference the order a shapefile is being processed or appears to be processed. Maxfeatures just surfaces the change. The shapefile I'm using to draw 100 largest lakes is ordered from smallest to largest.
Maxfeatures used to be pretty much a shapefile only thing and if you look at mapshape.c in 6.0 you'll still see that attribute referenced in msSHPLayerWhichShapes(). That's where the change is. There's a block of code in 6.0 that actually modifies the bit arrary leaving at most maxfeatures on, but it leaves the last maxfeatures on. There must have been reason it was done this way and probably had with drawing order when ordering by size, that is, drawing the n largest of something but not wanting to the big stuff to obscure the little stuff. Pretty specific use case I guess. So this is a regression although it seems I'm the only one to notice... ;-)
Your patch is correct, I just need to deal with the change on my side.