-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Mapfile Validation Rules #6463
Comments
|
For 3... means that if layer->mingeowidth == -1 then don't write that property so that default value should never be output. We do that to avoid bloated output filled with useless settings. Are you seeing something different? |
|
For 4... There is always a default symbol 0 so the first symbol in a symbol set is 1, then 2 and so on. I think we're ok but the docs could probably be clarified. I'm wondering if all the "new in version x.x" is really necessary unless it pertains to the newest version - otherwise it just clutters the text. |
|
This reminds me that I have never understood why we do not have default symbol for points. Or if there is it does not render anything. |
There is a default but it but it's a single pixel so it would be easy to miss. |
|
(bringing my points here from the closed pull request)
|
|
@geographika, is 2 kinda the same issue as 3? |
Yes, the only difference is that issue 2 would only be caused by user Mapfiles, whereas issue 3 could be caused by MapServer writing out a Mapfile. |
But we document it in https://mapserver.org/mapfile/style.html#mapfile-style-symbol "If SYMBOL is not specified, the behaviour depends on the type of feature. |
Except I don't the issue 3 can happen via writing - unless I'm missing something... We avoid writing defaults. @geographika, I would argue we shouldn't advertise defaults that just turn something off. For example, for something like layer MIBSCALEDENOM, the default is something nebulous like "not set" and the valid values are doubles greater than 1. There's no reason to let folks know what we're using internally for initialization. We should probably switch to a standard MS_VALUE_NOT_SET constant at some point to make this more clear. |
@sdlime - sorry my mistake - I'd missed that in the
|
that then fails on the QUERYMAP's SIZE with map2img: |
Well that's a PITA... I can/will suppress writing -1 -1 going forward but if we want to have as much backwards compatibility as possible then we'll have to allow it for now. @jmckenna, have you run into this with any other parameters w/two values? |
|
@geographika, for 1:
|
|
@sdlime - in order to allow consistency for the same keywords across objects is there the option of setting the following at parse time in mapfile.c? Any further code using if(msyynumber < -360 || msyynumber > 360) return(MS_FAILURE);
style->angle = (double) msyynumber;
if (style->angle < 0) {
style->angle = 360 - fabs(style->angle);
}I guess a drawback would be when writing back out to a Mapfile |
|
We could, probably should try some tests first - maybe the docs are wrong? Can't avoid the drawback though. |
|
I think hit all of these. Please have a look. Note that I left style->angle at 0,360 for the moment. I added line numbers to the various misc errors... |
|
new report
with error message: |
Oops for some reason I didn't see this whole comment, at the time I only saw "that a PITA". Answer: this is the only time I faced it. |
* Add schema validation based on MapServer/MapServer#6466 and MapServer/MapServer#6463 * Fix angle * Update default object
|
Thanks @sdlime - the issues raised here have all been addressed. Anything else arising can be opened in a new ticket. |
Addressed issues identified in issue MapServer#6463. Mostly expanding allowed values to account for documentation and adding line numbers to error messages to make debugging easier.
Following on from #6458 and the docs pull request here, there are a few validation rules to check/confirm:
ANGLEkeywords can have negative values. For example the STYLE ANGLE docs currently state clockwise angles should be calculated as positive values:There are several cases where the default values for objects would not pass validation e.g. STYLE MINSIZE, MINWIDTH, OUTLINEWIDTH. Docs would read as Default is 0. Must be greater than 0.
Also CLUSTER BUFFER (defaults to 0 but must be > 0). Same for LAYER TOLERANCE.
Perhaps more problematic are when default values are written out to Mapfiles by MapServer, which would then produce invalid maps. E.g in
writeLayerall the following default to -1, but then validation is set to > 0.STYLE SYMBOL docs state the index starts at 1, but validation allows 0.
(nitpick) Minor inconsistency in validation for same property names - MAP MAXSIZE is >= 1 and LABEL MAXSIZE is > 0 (results in same validation as these are both integer values.
The text was updated successfully, but these errors were encountered: