Permalink
Browse files

Fix msContourGetOption() to be able to parse values where no min/maxs…

…caledenom is specified, e.g. PROCESSING 'CONTOUR_INTERVAL=20' (#4691)
  • Loading branch information...
rouault committed Jul 7, 2013
1 parent d75372d commit c5765a5892b21cb716a1bcbad15d3800f00867ff
Showing with 14 additions and 0 deletions.
  1. +14 −0 mapcontour.c
View
@@ -462,6 +462,9 @@ static char* msContourGetOption(layerObj *layer, const char *name)
options = CSLFetchNameValueMultiple(layer->processing, name);
c = CSLCount(options);
/* First pass to find the value among options that have min/maxscaledenom */
/* specified */
for (i=0; i<c && found == MS_FALSE; ++i) {
values = CSLTokenizeStringComplex(options[i], ":", FALSE, FALSE);
if (CSLCount(values) == 2) {
@@ -480,6 +483,17 @@ static char* msContourGetOption(layerObj *layer, const char *name)
}
CSLDestroy(values);
}
/* Second pass to find the value among options that do NOT have */
/* min/maxscaledenom specified */
for (i=0; i<c && found == MS_FALSE; ++i) {
values = CSLTokenizeStringComplex(options[i], ":", FALSE, FALSE);
if (CSLCount(values) == 1) {
value = msStrdup(values[0]);
found = MS_TRUE;
}
CSLDestroy(values);
}
CSLDestroy(options);

0 comments on commit c5765a5

Please sign in to comment.