Opened 13 years ago

Closed 13 years ago

#3595 closed enhancement (fixed)

Support of WCS 2.0 Protocol

Reported by: Schpidi Owned by: sdlime
Priority: normal Milestone: 6.0 release
Component: WCS Server Version: unspecified
Severity: normal Keywords:
Cc: warmerdam, jmckenna

Description

Some days ago the new Web Coverage Service (WCS) 2.0 Interface Standard was published on the public OGC webpages. This specification adopts the new OGC Core and Extension model and at the moment the following documents are available:

Technical changes from WCS version 1.1.2 include entirely building on the GML 3.2 encoding of coverages.

WCS 2.0 is based on OWS Common 2.0 and as the WCS 1.1 implementation takes advantage of the OWS metadata services in mapowscommon.c. However, because of main technical changes like the adoption of GML 3.2.1 or the introduction of trim and slice concepts the implementation is largely separated in mapwcs20.c.

At the top of msWCSDispatch() in mapwcs.c we added a junction to WCS 2.0 using msWCSDispatch20() in mapwcs20.c which parses the request independently because of the heavily changed request structure. These changes are mainly due to the new trim and slice concepts and the adoption of OWS 2.0.

Please find below some sample request to show the new functionality and usage of KVP parameters:

# GetCapabilities
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCapabilities
# DescribeCoverage 2.0
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=DescribeCoverage&COVERAGEID=grey
# GetCoverage 2.0 image/tiff full
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff
# GetCoverage 2.0 multipart/mixed (GML header & image/tiff) full
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&MEDIATYPE=multipart/mixed
# GetCoverage 2.0 image/tiff trim x y both
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&SUBSET=x(10,200)&SUBSET=y(10,200)
# GetCoverage 2.0 reproject to EPSG 4326
http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&SUBSET=x,http://www.opengis.net/def/crs/EPSG/0/4326(-121.488744,-121.485169)

Unfortunately the schemas are not yet available at http://schemas.opengis.net/wcs/ but I've attached the latest draft version here. (Btw. if you want to use libxml2 for validation be aware that there is a bug that breaks the validation of GML 3.2.1.)

Attached are patches both for the latest stable release 5.6.5 and the current (as of writing) trunk (r10696). I'll also provide patches for msautotest hopefully soon.

Have fun and many thanks for any feedback,
Stephan

Attachments (17)

mapserver_trunk_r10696_20101101.patch (128.4 KB ) - added by Schpidi 13 years ago.
mapserver_rel-5-6-5_20101101.patch (128.3 KB ) - added by Schpidi 13 years ago.
wcs_2.0_DRAFT_schemas.zip (80.3 KB ) - added by Schpidi 13 years ago.
msautotest_trunk_r10713_20101109.diff (38.8 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10713_20101110.patch (53.5 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10714_20101111.patch (1.3 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10731_20101116.patch (7.8 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10771_20101129.patch (45.5 KB ) - added by Schpidi 13 years ago.
msautotest_trunk_r10771_20101129.patch (51.5 KB ) - added by Schpidi 13 years ago.
wxs_expected_wcs_20.zip (30.6 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10806_20101220.patch (203.1 KB ) - added by Schpidi 13 years ago.
msautotest_trunk_r10806_20101220.patch (32.8 KB ) - added by Schpidi 13 years ago.
wxs_expected_wcs_20.2.zip (60.5 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10808_20101221.patch (119.3 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10812_20101222.patch (46.1 KB ) - added by Schpidi 13 years ago.
msautotest_trunk_r10812_20101222.patch (47.8 KB ) - added by Schpidi 13 years ago.
mapserver_trunk_r10836_20110106.patch (5.4 KB ) - added by Schpidi 13 years ago.

Download all attachments as: .zip

Change History (52)

by Schpidi, 13 years ago

by Schpidi, 13 years ago

Attachment: wcs_2.0_DRAFT_schemas.zip added

comment:1 by warmerdam, 13 years ago

Cc: warmerdam added

comment:2 by jmckenna, 13 years ago

Cc: jmckenna added

comment:3 by sdlime, 13 years ago

Patching 5.6 isn't really an option since we don't like to introduce largish features mid-release. I'd vote for patching trunk asap to start testing. - Steve

comment:4 by warmerdam, 13 years ago

Steve,

I agree. Do you have time to merge this or would you like me to? I think I wrote an RFC for WCS 1.1, but I don't see that as strictly necessary unless there are significant impacts beyond adding the new WCS version. The pattern is already in place.

comment:5 by sdlime, 13 years ago

Status: newassigned

I agree, these follow the established pattern so no RFC is necessary. Changes also seem to be pretty localized. I can apply the patches, I'd rather you take time to look at RFC 64... ;-)

Steve

comment:6 by sdlime, 13 years ago

Applied patch in trunk and committed in r10713. I tested compiling with and without WCS support without issue (on Linux). I've not tested the WCS server itself though.

I guess I'd like to move this ticket on to the msautotest or documentation components, with functional issues being handled via new tickets under the WCS component.

Any preference?

Steve

comment:7 by Schpidi, 13 years ago

Hi Steve,

many thanks for your positive response.

We're currently working on a patch for msautotest. I've attached a first preliminary version. This patch includes an extension for msautotest to support also POST request. Please note that this is work in progress and not finished yet.

Best regards, Stephan

comment:8 by rouault, 13 years ago

There are a bunch of warnings reported by the compiler :

mapwcs20.c: In function ‘msWCSCommon20_CreateRangeType’:
mapwcs20.c:1212: warning: unused variable ‘bandNames’
mapwcs20.c: In function ‘msWCSWriteFile20’:
mapwcs20.c:1395: warning: unused variable ‘encoding’
mapwcs20.c: In function ‘msWCSGetCapabilities20_CreateProfiles’:
mapwcs20.c:1831: warning: no return statement in function returning non-void
mapwcs20.c: In function ‘msWCSGetCapabilities20’:
mapwcs20.c:1887: warning: unused variable ‘ows_version’
mapwcs20.c:1885: warning: unused variable ‘context’
mapwcs20.c:1884: warning: unused variable ‘size’
mapwcs20.c:1883: warning: unused variable ‘buffer’
mapwcs20.c:1876: warning: unused variable ‘encoding’

in reply to:  8 ; comment:9 by Schpidi, 13 years ago

Thanks for your report. We'll have a look at the warnings and create a new patch.

Stephan

comment:10 by Schpidi, 13 years ago

The schemas are now available in the official OGC schema repository:

Stephan

in reply to:  9 comment:11 by Schpidi, 13 years ago

I've added a patch against the current trunk that should remove the warnings.

The patch additionally includes some bug fixes.

Stephan

comment:12 by sdlime, 13 years ago

I tried the patch locally but get a bunch of errors when compiling without WCS enabled.

sdlime$ make mapwcs20.o
gcc -c -O2 -fPIC -Wall     -DHAVE_VSNPRINTF -DNEED_STRRSTR                  -DUSE_WMS_SVR    -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL  -DUSE_GEOS   -DUSE_PROJ -DUSE_RGBA_PNG -DUSE_AGG      -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DGD_HAS_GET_TRUE_COLOR_PIXEL -DUSE_ICONV -DUSE_ZLIB    -I/usr/X11/include -I/usr/local/include -I/sw/include/freetype2 -I/sw/include -Irenderers/agg/include     -I/sw/include   -I/usr/local/include -I/sw/include/postgresql     -I/usr/local/include       mapwcs20.c -o mapwcs20.o
mapwcs20.c:36:25: error: libxml/tree.h: No such file or directory
mapwcs20.c:43:27: error: libxml/parser.h: No such file or directory
mapwcs20.c: In function ‘msWCSParseRequest20’:
mapwcs20.c:415: error: ‘xmlDocPtr’ undeclared (first use in this function)
mapwcs20.c:415: error: (Each undeclared identifier is reported only once
mapwcs20.c:415: error: for each function it appears in.)
mapwcs20.c:415: error: syntax error before ‘doc’
and so on...

Enabling WCS (--with-wcs) is more successful. Actually r10713 gives me the same problems on my home mac. So, I've committed the patch to trunk (r10714).

Steve

in reply to:  12 ; comment:13 by Schpidi, 13 years ago

You're right. To be honest I didn't try to compile without WCS support. I think the errors are because of the also missing libxml2 support. The attached patch includes a quick fix for that (but includes also a TODO).

Stephan

comment:14 by tamas, 13 years ago

The changes were applied in r10714 and it's now breaking the compilation with MSVC, causing the following errors:

mapwcs20.c
mapwcs20.c(769) : error C2057: expected constant expression
mapwcs20.c(769) : error C2466: cannot allocate an array of constant size 0
mapwcs20.c(769) : error C2133: 'subsets' : unknown size
mapwcs20.c(1125) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(1158) : error C2143: syntax error : missing ';' before 'type'
mapwcs20.c(1168) : error C2065: 'interval' : undeclared identifier
mapwcs20.c(1168) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
mapwcs20.c(1168) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
mapwcs20.c(1171) : error C2065: 'interval' : undeclared identifier
mapwcs20.c(1171) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
mapwcs20.c(1171) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
mapwcs20.c(1174) : error C2065: 'interval' : undeclared identifier
mapwcs20.c(1174) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
mapwcs20.c(1174) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
mapwcs20.c(1177) : error C2065: 'interval' : undeclared identifier
mapwcs20.c(1769) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(1777) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(1850) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(1883) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(1891) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(2012) : error C2057: expected constant expression
mapwcs20.c(2012) : error C2466: cannot allocate an array of constant size 0
mapwcs20.c(2012) : error C2133: 'available_mime_types' : unknown size
mapwcs20.c(2683) : warning C4013: 'lround' undefined; assuming extern returning int
mapwcs20.c(2738) : warning C4018: '<' : signed/unsigned mismatch
mapwcs20.c(2920) : error C2143: syntax error : missing ';' before 'type'
mapwcs20.c(2924) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2924) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2924) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2925) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2929) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2929) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2929) : error C2065: 'x' : undeclared identifier
mapwcs20.c(2931) : error C2065: 'x' : undeclared identifier
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Is this something to be compiled as C++ code?

in reply to:  13 ; comment:15 by sdlime, 13 years ago

Replying to Schpidi:

Patch applied in r10717...

in reply to:  14 comment:16 by tamas, 13 years ago

Replying to tamas:

I've fixed the issues in r10729

in reply to:  15 comment:17 by Schpidi, 13 years ago

Replying to sdlime:

The new patch should correctly handle WCS 2.0 requests when compiled with missing libxml2 support.

by Schpidi, 13 years ago

Attachment: wxs_expected_wcs_20.zip added

comment:18 by Schpidi, 13 years ago

I've uploaded a new patch fixing some bugs and adding scaling functionality.

Please note that there is no extension available yet specifying scaling. Thus we have to guess how this will be specified. Please find some sample requests in the second patch which is for msautotest. I've also added a zip containing the expected results for all new tests as far as the current implementation supports them.

Stephan

comment:19 by sdlime, 13 years ago

Stephan: Tried applying the mapserver_trunk_r10771_20101129.patch but failed. I think because of Alan's big change to make memory management more robust (r10772). Any chance you could update your patch to go against his changes too?

Steve

in reply to:  19 ; comment:20 by Schpidi, 13 years ago

Steve,

I did also ran into that but didn't find time yet to resolve it. I'll try my best to upload a new patch soon.

Did you also see the patch for msautotest? It includes an extension to support POST tests. I'll update that patch too.

Stephan

by Schpidi, 13 years ago

Attachment: wxs_expected_wcs_20.2.zip added

in reply to:  20 comment:21 by Schpidi, 13 years ago

Updated patch uploaded. This patch includes all the changes from the previous ones as well as some new enhancements.

Additionally there's a patch and expected results for msautotest.

Stephan

comment:22 by sdlime, 13 years ago

Great Stephan! I'll apply these this evening and report back here...

Steve

in reply to:  22 comment:23 by Schpidi, 13 years ago

Uploaded a new version of the patch. The old one accidentally included too many files.

Stephan

comment:24 by sdlime, 13 years ago

Applied new version of the patch (mapserver_trunk_r10808_20101221.patch) in r10810. Need to make sure this code is patched further to adhere to some new coding guidelines in 6.0:

http://trac.osgeo.org/mapserver/wiki/CodingGuidelines

I looked only briefly at the mapfile.c changes and noticed some strcpy, malloc and strdup calls that could use the new functions outlined at the link above.

Steve

comment:25 by sdlime, 13 years ago

Applied msautotest patch (msautotest_trunk_r10806_20101220.patch) in r10811.

Steve

comment:26 by sdlime, 13 years ago

Added expect test results in r10812. Should be all caught up. -Steve

in reply to:  24 comment:27 by Schpidi, 13 years ago

We changed several of these calls but obviously we didn't catch all, sorry. I'll take a look into it.

Stephan

comment:28 by sdlime, 13 years ago

No worries, just didn't want to lose the task... ;-)

comment:29 by Schpidi, 13 years ago

Uploaded another patch including fixes to adhere to new coding guidelines and some OWS functionality.

Please note that in mapfile.c we only changed code in the function where we added new code before.

Stephan

comment:30 by sdlime, 13 years ago

Whoops, missed these new patches. Applied to trunk in r10818 and r10819.

Steve

comment:31 by Schpidi, 13 years ago

The new patch resolves a weird segmentation fault on specific architectures and two others.

in reply to:  31 comment:32 by Schpidi, 13 years ago

I've added tickets #3680, #3681, and #3682 instead of the above patch.

comment:33 by sdlime, 13 years ago

I've lost track of where we are. Can this be closed now? I'm thinking so...

Steve

in reply to:  33 comment:34 by Schpidi, 13 years ago

I guess I should add some documentation. I plan to add this at the Code Sprint at the latest.

comment:35 by schpidi, 13 years ago

Milestone: 6.0 release
Resolution: fixed
Status: assignedclosed

Added documentation in r11382 (first changes accidentally in r11379).

Note: See TracTickets for help on using tickets.