Skip to content

Commit

Permalink
Backporting: WCS: Set layer projection to map's one if not set (#4079).
Browse files Browse the repository at this point in the history
  • Loading branch information
Schpidi committed Aug 28, 2012
1 parent b89c07e commit 4a34233
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mapwcs.c
Expand Up @@ -1642,6 +1642,15 @@ static int msWCSGetCoverage(mapObj *map, cgiRequestObj *request,
/* make sure the layer is on */
lp->status = MS_ON;

/* If the layer has no projection set, set it to the map's projection (#4079) */
if(lp->projection.numargs <=0) {
char *map_original_srs = msGetProjectionString(&(map->projection));
if (msLoadProjectionString(&(lp->projection), map_original_srs) != 0) {
msSetError( MS_WCSERR, "Error when setting map projection to a layer with no projection", "msWCSGetCoverage()" );
return msWCSException(map, NULL, NULL, params->version);
}
}

/* we need the coverage metadata, since things like numbands may not be available otherwise */
status = msWCSGetCoverageMetadata(lp, &cm);
if(status != MS_SUCCESS) return MS_FAILURE;
Expand Down

0 comments on commit 4a34233

Please sign in to comment.