@@ -27,6 +27,7 @@ map service syntax for SOAP/HTTP POST
27
27
#include " qgslogger.h"
28
28
#include " qgswmsserver.h"
29
29
#include " qgswfsserver.h"
30
+ #include " qgswcsserver.h"
30
31
#include " qgsmaprenderer.h"
31
32
#include " qgsmapserviceexception.h"
32
33
#include " qgspallabeling.h"
@@ -348,7 +349,99 @@ int main( int argc, char * argv[] )
348
349
}
349
350
350
351
QgsWMSServer* theServer = 0 ;
351
- if ( serviceString == " WFS" )
352
+ if ( serviceString == " WCS" )
353
+ {
354
+ delete theServer;
355
+ QgsWCSServer* theServer = 0 ;
356
+ try
357
+ {
358
+ theServer = new QgsWCSServer ( parameterMap );
359
+ }
360
+ catch ( QgsMapServiceException e ) // admin.sld may be invalid
361
+ {
362
+ theRequestHandler->sendServiceException ( e );
363
+ continue ;
364
+ }
365
+
366
+ theServer->setAdminConfigParser ( adminConfigParser );
367
+
368
+
369
+ // request type
370
+ QString request = parameterMap.value ( " REQUEST" );
371
+ if ( request.isEmpty () )
372
+ {
373
+ // do some error handling
374
+ QgsDebugMsg ( " unable to find 'REQUEST' parameter, exiting..." );
375
+ theRequestHandler->sendServiceException ( QgsMapServiceException ( " OperationNotSupported" , " Please check the value of the REQUEST parameter" ) );
376
+ delete theRequestHandler;
377
+ delete theServer;
378
+ continue ;
379
+ }
380
+
381
+ if ( request.compare ( " GetCapabilities" , Qt::CaseInsensitive ) == 0 )
382
+ {
383
+ QDomDocument capabilitiesDocument;
384
+ try
385
+ {
386
+ capabilitiesDocument = theServer->getCapabilities ();
387
+ }
388
+ catch ( QgsMapServiceException& ex )
389
+ {
390
+ theRequestHandler->sendServiceException ( ex );
391
+ delete theRequestHandler;
392
+ delete theServer;
393
+ continue ;
394
+ }
395
+ QgsDebugMsg ( " sending GetCapabilities response" );
396
+ theRequestHandler->sendGetCapabilitiesResponse ( capabilitiesDocument );
397
+ delete theRequestHandler;
398
+ delete theServer;
399
+ continue ;
400
+ }
401
+ else if ( request.compare ( " DescribeCoverage" , Qt::CaseInsensitive ) == 0 )
402
+ {
403
+ QDomDocument describeDocument;
404
+ try
405
+ {
406
+ describeDocument = theServer->describeCoverage ();
407
+ }
408
+ catch ( QgsMapServiceException& ex )
409
+ {
410
+ theRequestHandler->sendServiceException ( ex );
411
+ delete theRequestHandler;
412
+ delete theServer;
413
+ continue ;
414
+ }
415
+ QgsDebugMsg ( " sending GetCapabilities response" );
416
+ theRequestHandler->sendGetCapabilitiesResponse ( describeDocument );
417
+ delete theRequestHandler;
418
+ delete theServer;
419
+ continue ;
420
+ }
421
+ else if ( request.compare ( " GetCoverage" , Qt::CaseInsensitive ) == 0 )
422
+ {
423
+ QByteArray* coverageOutput;
424
+ try
425
+ {
426
+ coverageOutput = theServer->getCoverage ();
427
+ }
428
+ catch ( QgsMapServiceException& ex )
429
+ {
430
+ theRequestHandler->sendServiceException ( ex );
431
+ delete theRequestHandler;
432
+ delete theServer;
433
+ continue ;
434
+ }
435
+ if ( coverageOutput )
436
+ {
437
+ theRequestHandler->sendGetCoverageResponse ( coverageOutput );
438
+ }
439
+ delete theRequestHandler;
440
+ delete theServer;
441
+ continue ;
442
+ }
443
+ }
444
+ else if ( serviceString == " WFS" )
352
445
{
353
446
delete theServer;
354
447
QgsWFSServer* theServer = 0 ;
0 commit comments