Skip to content

Commit

Permalink
Merge branch 'branch-7-0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 10, 2017
2 parents bf73b5c + 3735c36 commit 36ac406
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 28 deletions.
36 changes: 17 additions & 19 deletions mapwcs20.c
Expand Up @@ -2009,12 +2009,18 @@ static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadata
{
xmlNodePtr psDomainSet, psGrid, psLimits, psGridEnvelope, psOrigin,
psOffsetX, psOffsetY;
char low[100], high[100], id[100], point[100], resx[100], resy[100], axisLabels[100];
char low[100], high[100], id[100], point[100];
char offsetVector1[100], offsetVector2[100], axisLabels[100];

psDomainSet = xmlNewChild( psRoot, psGmlNs, BAD_CAST "domainSet", NULL);
{
psGrid = xmlNewChild(psDomainSet, psGmlNs, BAD_CAST "RectifiedGrid", NULL);
{
double x0 = cm->geotransform[0]+cm->geotransform[1]/2+cm->geotransform[2]/2;
double y0 = cm->geotransform[3]+cm->geotransform[4]/2+cm->geotransform[5]/2;
double resx = cm->geotransform[1];
double resy = cm->geotransform[5];

xmlNewProp(psGrid, BAD_CAST "dimension", BAD_CAST "2");
snprintf(id, sizeof(id), "grid_%s", layer->name);
xmlNewNsProp(psGrid, psGmlNs, BAD_CAST "id", BAD_CAST id);
Expand All @@ -2032,27 +2038,19 @@ static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadata
}

if(projection->proj != NULL && pj_is_latlong(projection->proj)) {
if (swapAxes == MS_FALSE) {
strlcpy(axisLabels, "long lat", sizeof(axisLabels));
} else {
strlcpy(axisLabels, "lat long", sizeof(axisLabels));
}
strlcpy(axisLabels, "long lat", sizeof(axisLabels));
} else {
if (swapAxes == MS_FALSE) {
strlcpy(axisLabels, "x y", sizeof(axisLabels));
} else {
strlcpy(axisLabels, "y x", sizeof(axisLabels));
}
strlcpy(axisLabels, "x y", sizeof(axisLabels));
}

xmlNewChild(psGrid, psGmlNs, BAD_CAST "axisLabels", BAD_CAST axisLabels);

psOrigin = xmlNewChild(psGrid, psGmlNs, BAD_CAST "origin", NULL);
{
if (swapAxes == MS_FALSE) {
snprintf(point, sizeof(point), "%f %f", cm->extent.minx, cm->extent.maxy);
snprintf(point, sizeof(point), "%f %f", x0, y0);
} else {
snprintf(point, sizeof(point), "%f %f", cm->extent.maxy, cm->extent.minx);
snprintf(point, sizeof(point), "%f %f", y0, x0);
}
psOrigin = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "Point", NULL);
snprintf(id, sizeof(id), "grid_origin_%s", layer->name);
Expand All @@ -2063,14 +2061,14 @@ static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadata
}

if (swapAxes == MS_FALSE) {
snprintf(resx, sizeof(resx), "%f 0", cm->xresolution);
snprintf(resy, sizeof(resy), "0 %f", -fabs(cm->yresolution));
snprintf(offsetVector1, sizeof(offsetVector1), "%f 0", resx);
snprintf(offsetVector2, sizeof(offsetVector2), "0 %f", resy);
} else {
snprintf(resx, sizeof(resx), "0 %f", cm->xresolution);
snprintf(resy, sizeof(resy), "%f 0", -fabs(cm->yresolution));
snprintf(offsetVector1, sizeof(offsetVector1), "0 %f", resx);
snprintf(offsetVector2, sizeof(offsetVector2), "%f 0", resy);
}
psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx);
psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy);
psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST offsetVector1);
psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST offsetVector2);

xmlNewProp(psOffsetX, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
xmlNewProp(psOffsetY, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
Expand Down
2 changes: 1 addition & 1 deletion msautotest/wxs/expected/wcs_20_desc.txt
Expand Up @@ -21,7 +21,7 @@ Content-Type: text/xml; charset=UTF-8
<gml:axisLabels>x y</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_grey" srsName="http://www.opengis.net/def/crs/EPSG/0/32611">
<gml:pos>0.000000 300.000000</gml:pos>
<gml:pos>5.000000 295.000000</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32611">10.000000 0</gml:offsetVector>
Expand Down
2 changes: 1 addition & 1 deletion msautotest/wxs/expected/wcs_20_desc.xml
Expand Up @@ -19,7 +19,7 @@
<gml:axisLabels>x y</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_grey" srsName="http://www.opengis.net/def/crs/EPSG/0/32611">
<gml:pos>0.000000 300.000000</gml:pos>
<gml:pos>5.000000 295.000000</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32611">10.000000 0</gml:offsetVector>
Expand Down
8 changes: 4 additions & 4 deletions msautotest/wxs/expected/wcs_20_desc_bands.xml
Expand Up @@ -16,10 +16,10 @@
<gml:high>104 60</gml:high>
</gml:GridEnvelope>
</gml:limits>
<gml:axisLabels>lat long</gml:axisLabels>
<gml:axisLabels>long lat</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_multi" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<gml:pos>49.891143 14.470271</gml:pos>
<gml:pos>49.874157 14.487132</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/4326">0 0.033722</gml:offsetVector>
Expand Down Expand Up @@ -204,10 +204,10 @@
<gml:high>104 60</gml:high>
</gml:GridEnvelope>
</gml:limits>
<gml:axisLabels>lat long</gml:axisLabels>
<gml:axisLabels>long lat</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_multi_new" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<gml:pos>49.891143 14.470271</gml:pos>
<gml:pos>49.874157 14.487132</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/4326">0 0.033722</gml:offsetVector>
Expand Down
Binary file modified msautotest/wxs/expected/wcs_20_getcov_bands_name.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_20_getcov_bands_name_new.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_20_getcov_bands_name_new_reproject.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_20_getcov_full.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion msautotest/wxs/expected/wcs_20_getcov_grd_mp.dat
Expand Up @@ -23,7 +23,7 @@ Content-Type: application/gml+xml; charset=UTF-8
<gml:axisLabels>x y</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_grey" srsName="http://www.opengis.net/def/crs/EPSG/0/32611">
<gml:pos>0.000000 300.000000</gml:pos>
<gml:pos>5.000000 295.000000</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32611">10.000000 0</gml:offsetVector>
Expand Down
Binary file modified msautotest/wxs/expected/wcs_20_getcov_reproj.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_20_post_bands_name.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_20_post_bands_name_new.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion msautotest/wxs/expected/wcs_20_post_desc.xml
Expand Up @@ -19,7 +19,7 @@
<gml:axisLabels>x y</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_grey" srsName="http://www.opengis.net/def/crs/EPSG/0/32611">
<gml:pos>0.000000 300.000000</gml:pos>
<gml:pos>5.000000 295.000000</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32611">10.000000 0</gml:offsetVector>
Expand Down
Binary file modified msautotest/wxs/expected/wcs_20_post_getcov_full_multipart.dat
Binary file not shown.
Binary file modified msautotest/wxs/expected/wcs_mask_20_getcov_full.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion msautotest/wxs/expected/wcs_mask_20_getcov_grd_mp.dat
Expand Up @@ -23,7 +23,7 @@ Content-Type: application/gml+xml; charset=UTF-8
<gml:axisLabels>x y</gml:axisLabels>
<gml:origin>
<gml:Point gml:id="grid_origin_grey" srsName="http://www.opengis.net/def/crs/EPSG/0/32611">
<gml:pos>0.000000 300.000000</gml:pos>
<gml:pos>5.000000 295.000000</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32611">10.000000 0</gml:offsetVector>
Expand Down
Binary file modified msautotest/wxs/expected/wcs_mask_20_getcov_reproj.dat
Binary file not shown.

0 comments on commit 36ac406

Please sign in to comment.