Ticket #3595 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

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

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

Change History

Changed 3 years ago by Schpidi

Changed 3 years ago by Schpidi

Changed 3 years ago by Schpidi

  Changed 3 years ago by warmerdam

  • cc warmerdam added

  Changed 3 years ago by jmckenna

  • cc jmckenna added

  Changed 3 years ago by sdlime

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

  Changed 3 years ago by warmerdam

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.

  Changed 3 years ago by sdlime

  • status changed from new to assigned

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

  Changed 3 years ago by sdlime

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

  Changed 3 years ago by Schpidi

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

Changed 3 years ago by Schpidi

follow-up: ↓ 9   Changed 3 years ago by rouault

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 ; follow-up: ↓ 11   Changed 3 years ago by Schpidi

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

Stephan

  Changed 3 years ago by Schpidi

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

Stephan

Changed 3 years ago by Schpidi

in reply to: ↑ 9   Changed 3 years ago by Schpidi

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

The patch additionally includes some bug fixes.

Stephan

follow-up: ↓ 13   Changed 3 years ago by sdlime

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

Changed 3 years ago by Schpidi

in reply to: ↑ 12 ; follow-up: ↓ 15   Changed 3 years ago by Schpidi

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

follow-up: ↓ 16   Changed 3 years ago by tamas

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 ; follow-up: ↓ 17   Changed 3 years ago by sdlime

Replying to Schpidi:

Patch applied in r10717...

in reply to: ↑ 14   Changed 3 years ago by tamas

Replying to tamas:

I've fixed the issues in r10729

Changed 3 years ago by Schpidi

in reply to: ↑ 15   Changed 3 years ago by Schpidi

Replying to sdlime:

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

Changed 2 years ago by Schpidi

Changed 2 years ago by Schpidi

Changed 2 years ago by Schpidi

  Changed 2 years ago by Schpidi

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

follow-up: ↓ 20   Changed 2 years ago by sdlime

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 ; follow-up: ↓ 21   Changed 2 years ago by Schpidi

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

Changed 2 years ago by Schpidi

Changed 2 years ago by Schpidi

Changed 2 years ago by Schpidi

in reply to: ↑ 20   Changed 2 years ago by Schpidi

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

follow-up: ↓ 23   Changed 2 years ago by sdlime

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

Steve

Changed 2 years ago by Schpidi

in reply to: ↑ 22   Changed 2 years ago by Schpidi

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

Stephan

follow-up: ↓ 27   Changed 2 years ago by sdlime

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

  Changed 2 years ago by sdlime

Applied msautotest patch (msautotest_trunk_r10806_20101220.patch) in r10811.

Steve

  Changed 2 years ago by sdlime

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

in reply to: ↑ 24   Changed 2 years ago by Schpidi

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

Stephan

  Changed 2 years ago by sdlime

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

Changed 2 years ago by Schpidi

Changed 2 years ago by Schpidi

  Changed 2 years ago by Schpidi

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

  Changed 2 years ago by sdlime

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

Steve

Changed 2 years ago by Schpidi

follow-up: ↓ 32   Changed 2 years ago by Schpidi

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

in reply to: ↑ 31   Changed 2 years ago by Schpidi

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

follow-up: ↓ 34   Changed 2 years ago by sdlime

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

Steve

in reply to: ↑ 33   Changed 2 years ago by Schpidi

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

  Changed 2 years ago by schpidi

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 6.0 release

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

Note: See TracTickets for help on using tickets.