Skip to content

Commit

Permalink
Merge pull request #4692 from rouault/fix_msContourGetOption
Browse files Browse the repository at this point in the history
Fix msContourGetOption() to be able to parse values where no min/maxscal...
  • Loading branch information
Alan Boudreault committed Aug 12, 2013
2 parents efed3d7 + c5765a5 commit caafcaa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mapcontour.c
Expand Up @@ -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) {
Expand All @@ -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);

Expand Down

0 comments on commit caafcaa

Please sign in to comment.