00001
00042 #ifndef INC_SOA_WMSCAPABILITIES_H
00043 #define INC_SOA_WMSCAPABILITIES_H
00044
00045 #ifndef INC_MI32_MISTRINGLIST_H
00046 #include <mi32/mistringlist.h>
00047 #endif
00048
00049 #ifndef INC_MI32_SPATREF_H
00050 #include <mi32/spatref.h>
00051 #endif
00052
00053 #ifndef INC_MI32_RECT_H
00054 #include <mi32/rect.h>
00055 #endif
00056
00057 class XMLDOC;
00058 class XMLNODE;
00059 class HTTPMESSAGE;
00060 class SUBREGION2D;
00061
00062 namespace SOA {
00063 namespace WMS {
00064
00065
00066
00067 class ONLINERESOURCE {
00068 public:
00070 ONLINERESOURCE ();
00071
00073 ~ONLINERESOURCE ();
00074
00075 const MISTRING& GetHref (
00076 ) const { return (m_href); }
00077
00079 ERRVALUE ParseXML (
00080 const XMLNODE *xmlnode
00081 );
00082
00083 private:
00084 #ifndef GENERATING_DOXYGEN_OUTPUT
00085 MISTRING m_href;
00086 #endif
00087 };
00088
00089
00090
00091 class BASEURL {
00092 public:
00093
00095 const MISTRING& GetFormat (
00096 ) const { return (m_Format); }
00097
00099 const ONLINERESOURCE& GetOnlineResource (
00100 ) const { return (m_OnlineResource); }
00101
00102 protected:
00103
00105 BASEURL ();
00106
00108 ~BASEURL ();
00109
00112 ERRVALUE ParseItem (
00113 const XMLNODE *itemnode
00114 );
00115
00116 private:
00117 #ifndef GENERATING_DOXYGEN_OUTPUT
00118
00119 ONLINERESOURCE m_OnlineResource;
00120 MISTRING m_Format;
00121 #endif
00122 };
00123
00124
00125
00126 class DATAURL : public BASEURL {
00127 public:
00128
00130 DATAURL ();
00131
00133 ~DATAURL ();
00134
00136 ERRVALUE ParseXML (
00137 const XMLNODE *xmlnode
00138 );
00139 };
00140 typedef MILIST<DATAURL> DATAURLLIST;
00141
00142
00143
00144 class SIZEDATAURL : public BASEURL {
00145 public:
00146
00148 SIZEDATAURL ();
00149
00151 ~SIZEDATAURL ();
00152
00154 UINT32 GetHeight (
00155 ) const { return (m_Height); }
00156
00158 UINT32 GetWidth (
00159 ) const { return (m_Width); }
00160
00162 ERRVALUE ParseXML (
00163 const XMLNODE *xmlnode
00164 );
00165
00166 private:
00167 #ifndef GENERATING_DOXYGEN_OUTPUT
00168
00169 UINT32 m_Width;
00170 UINT32 m_Height;
00171 #endif
00172 };
00173 typedef MILIST<SIZEDATAURL> SIZEDATAURLLIST;
00174
00175
00176
00177 class CONTACTPERSON {
00178 public:
00179
00181 CONTACTPERSON ();
00182
00184 ~CONTACTPERSON ();
00185
00187 ERRVALUE ParseXML (
00188 const XMLNODE *xmlnode
00189 );
00190
00192 const MISTRING& GetOrganization (
00193 ) const { return (m_Organization); }
00194
00196 const MISTRING& GetPerson (
00197 ) const { return (m_Person); }
00198
00199 private:
00200 #ifndef GENERATING_DOXYGEN_OUTPUT
00201
00202 MISTRING m_Person;
00203 MISTRING m_Organization;
00204 #endif
00205 };
00206
00207
00208
00209 class CONTACTADDRESS {
00210 public:
00212 CONTACTADDRESS ();
00213
00215 ~CONTACTADDRESS ();
00216
00218 ERRVALUE ParseXML (
00219 const XMLNODE *xmlnode
00220 );
00221
00223 const MISTRING& GetAddress (
00224 ) const { return (m_Address); }
00225
00227 const MISTRING& GetAddressType (
00228 ) const { return (m_AddressType); }
00229
00231 const MISTRING& GetCity (
00232 ) const { return (m_City); }
00233
00235 const MISTRING& GetCountry (
00236 ) const { return (m_Country); }
00237
00239 const MISTRING& GetPostCode (
00240 ) const { return (m_PostCode); }
00241
00243 const MISTRING& GetStateOrProvince (
00244 ) const { return (m_StateOrProvince); }
00245
00246 private:
00247 #ifndef GENERATING_DOXYGEN_OUTPUT
00248
00249 MISTRING m_AddressType;
00250 MISTRING m_Address;
00251 MISTRING m_City;
00252 MISTRING m_StateOrProvince;
00253 MISTRING m_PostCode;
00254 MISTRING m_Country;
00255 #endif
00256 };
00257
00258
00259
00260 class CONTACTINFORMATION {
00261 public:
00263 CONTACTINFORMATION ();
00264
00266 ~CONTACTINFORMATION ();
00267
00269 ERRVALUE ParseXML (
00270 const XMLNODE *xmlnode
00271 );
00272
00274 const WMS::CONTACTADDRESS& GetAddress (
00275 ) const { return (m_ContactAddress); }
00276
00278 const MISTRING& GetPosition (
00279 ) const { return (m_ContactPosition); }
00280
00282 const MISTRING& GetEmail (
00283 ) const { return (m_ContactEmail); }
00284
00286 const MISTRING& GetFaxPhone (
00287 ) const { return (m_ContactFaxPhone); }
00288
00290 const WMS::CONTACTPERSON& GetPersonPrimary (
00291 ) const { return (m_ContactPersonPrimary); }
00292
00294 const MISTRING& GetVoicePhone (
00295 ) const { return (m_ContactVoicePhone); }
00296
00297 private:
00298 #ifndef GENERATING_DOXYGEN_OUTPUT
00299
00300 WMS::CONTACTPERSON m_ContactPersonPrimary;
00301 MISTRING m_ContactPosition;
00302 WMS::CONTACTADDRESS m_ContactAddress;
00303 MISTRING m_ContactVoicePhone;
00304 MISTRING m_ContactFaxPhone;
00305 MISTRING m_ContactEmail;
00306 #endif
00307 };
00308
00309
00310
00312 class SERVICE {
00313 public:
00315 SERVICE ();
00316
00318 ~SERVICE ();
00319
00321 const MISTRING& GetAbstract (
00322 ) const { return (m_Abstract); }
00323
00325 const MISTRING& GetAccessConstraints (
00326 ) const { return (m_AccessConstraints); }
00327
00329 const WMS::CONTACTINFORMATION& GetContactInformation (
00330 ) const { return (m_ContactInformation); }
00331
00333 const MISTRING& GetFees (
00334 ) const { return (m_Fees); }
00335
00337 const MISTRINGLIST& GetKeywordList (
00338 ) const { return (m_KeywordList); }
00339
00341 UINT32 GetLayerLimit (
00342 ) const { return (m_LayerLimit); }
00343
00345 UINT32 GetMaxHeight (
00346 ) const { return (m_MaxHeight); }
00347
00349 UINT32 GetMaxWidth (
00350 ) const { return (m_MaxWidth); }
00351
00353 const WMS::ONLINERESOURCE& GetOnlineResource (
00354 ) const { return (m_OnlineResource); }
00355
00357 const MISTRING& GetTitle (
00358 ) const { return (m_Title); }
00359
00361 ERRVALUE ParseXML (
00362 const XMLNODE *xmlnode
00363 );
00364
00365 private:
00366 #ifndef GENERATING_DOXYGEN_OUTPUT
00367
00368 MISTRING m_Title;
00369 MISTRING m_Abstract;
00370 MISTRINGLIST m_KeywordList;
00371 WMS::ONLINERESOURCE m_OnlineResource;
00372 WMS::CONTACTINFORMATION m_ContactInformation;
00373 MISTRING m_Fees;
00374 MISTRING m_AccessConstraints;
00375 UINT32 m_LayerLimit;
00376 UINT32 m_MaxWidth;
00377 UINT32 m_MaxHeight;
00378 #endif
00379 };
00380
00381
00382
00383 class OPERATION {
00384 public:
00386 OPERATION ();
00387
00389 ~OPERATION ();
00390
00392 const MISTRINGLIST& GetFormatList (
00393 ) const { return (m_FormatList); }
00394
00396 const ONLINERESOURCE& GetOnlineResource (
00397 ) const { return (m_OnlineResource); }
00398
00400 bool IsAvailable (
00401 ) const { return (m_IsAvailable); }
00402
00404 ERRVALUE ParseXML (
00405 const XMLNODE *xmlnode
00406 );
00407
00408 private:
00409 #ifndef GENERATING_DOXYGEN_OUTPUT
00410
00411 MISTRINGLIST m_FormatList;
00412 WMS::ONLINERESOURCE m_OnlineResource;
00413
00414 bool m_IsAvailable;
00415 #endif
00416 };
00417
00418
00419
00420 class REQUEST {
00421 public:
00423 REQUEST ();
00424
00426 ~REQUEST ();
00427
00429 const WMS::OPERATION& GetOperationGetCapabilities (
00430 ) const { return (m_OpGetCapabilities); }
00431
00433 const WMS::OPERATION& GetOperationGetFeatureInfo (
00434 ) const { return (m_OpGetFeatureInfo); }
00435
00437 const WMS::OPERATION& GetOperationGetMap (
00438 ) const { return (m_OpGetMap); }
00439
00441 ERRVALUE ParseXML (
00442 const XMLNODE *xmlnode
00443 );
00444
00445 private:
00446 #ifndef GENERATING_DOXYGEN_OUTPUT
00447
00448 WMS::OPERATION m_OpGetCapabilities;
00449 WMS::OPERATION m_OpGetMap;
00450 WMS::OPERATION m_OpGetFeatureInfo;
00451 #endif
00452 };
00453
00454
00455
00456 class EXTENDEDCAPABILITIES {
00457 public:
00458 private:
00459 };
00460
00461
00462
00463 class BOUNDINGBOX {
00464 public:
00466 BOUNDINGBOX ();
00467
00469 ~BOUNDINGBOX ();
00470
00472 const SPATREF::COORDREFSYS& GetCRS (
00473 ) const { return (m_CRS); }
00474
00476 const DRECT2D& GetExtent (
00477 ) const { return (m_Extent); }
00478
00480 const DPOINT2D& GetResolution (
00481 ) const { return (m_Resolution); }
00482
00484 ERRVALUE ParseXML (
00485 const XMLNODE *xmlnode
00486 );
00487
00488 private:
00489 #ifndef GENERATING_DOXYGEN_OUTPUT
00490
00491 SPATREF::COORDREFSYS m_CRS;
00492 DRECT2D m_Extent;
00493 DPOINT2D m_Resolution;
00494 #endif
00495 };
00496 typedef MILIST<BOUNDINGBOX> BOUNDINGBOXLIST;
00497
00498
00499
00500 class DIMENSION {
00501 public:
00503 DIMENSION ();
00504
00506 ~DIMENSION ();
00507
00509 const MISTRING& GetDefault (
00510 ) const { return (m_Default); }
00511
00513 const MISTRING& GetName (
00514 ) const { return (m_Name); }
00515
00517 const MISTRING& GetUnits (
00518 ) const { return (m_Units); }
00519
00521 const MISTRING& GetUnitSymbol (
00522 ) const { return (m_UnitSymbol); }
00523
00525 const MISTRING& GetValue (
00526 ) const { return (m_Value); }
00527
00528 bool HasMultipleValues (
00529 ) const { return (m_MultipleValues); }
00530
00531 bool IsCurrent (
00532 ) const { return (m_Current); }
00533
00534 bool IsNearestValue (
00535 ) const { return (m_NearestValue); }
00536
00538 ERRVALUE ParseXML (
00539 const XMLNODE *xmlnode
00540 );
00541
00542 private:
00543 #ifndef GENERATING_DOXYGEN_OUTPUT
00544
00545 MISTRING m_Name;
00546 MISTRING m_Units;
00547 MISTRING m_UnitSymbol;
00548 MISTRING m_Default;
00549 MISTRING m_Value;
00550 bool m_MultipleValues;
00551 bool m_NearestValue;
00552 bool m_Current;
00553 #endif
00554 };
00555 typedef MILIST<DIMENSION> DIMENSIONLIST;
00556
00557
00558
00559 class ATTRIBUTION {
00560 public:
00562 ATTRIBUTION ();
00563
00565 ~ATTRIBUTION ();
00566
00568 const WMS::SIZEDATAURL& GetLogoURL (
00569 ) const { return (m_LogoURL); }
00570
00572 const ONLINERESOURCE& GetOnlineResource (
00573 ) const { return (m_OnlineResource); }
00574
00576 const MISTRING& GetTitle (
00577 ) const { return (m_Title); }
00578
00580 ERRVALUE ParseXML (
00581 const XMLNODE *xmlnode
00582 );
00583
00584 private:
00585 #ifndef GENERATING_DOXYGEN_OUTPUT
00586
00587 MISTRING m_Title;
00588 WMS::ONLINERESOURCE m_OnlineResource;
00589 WMS::SIZEDATAURL m_LogoURL;
00590 #endif
00591 };
00592
00593
00594
00595 class METADATAURL : BASEURL {
00596 public:
00597 enum TYPE {
00598 TYPE_Unknown,
00599 TYPE_ISO_19115_2003,
00600 TYPE_FGDC_1998,
00601 TYPE_COUNT
00602 };
00603
00605 METADATAURL ();
00606
00608 ~METADATAURL ();
00609
00611 TYPE GetType (
00612 ) const { return (m_Type); }
00613
00615 ERRVALUE ParseXML (
00616 const XMLNODE *xmlnode
00617 );
00618
00619 private:
00620 #ifndef GENERATING_DOXYGEN_OUTPUT
00621
00622 TYPE m_Type;
00623 #endif
00624 };
00625 typedef MILIST<METADATAURL> METADATAURLLIST;
00626
00627
00628
00629 class STYLE {
00630 public:
00632 STYLE ();
00633
00635 ~STYLE ();
00636
00638 const MISTRING& GetAbstract (
00639 ) const { return (m_Abstract); }
00640
00642 const WMS::SIZEDATAURLLIST& GetLegendURLList (
00643 ) const { return (m_LegendURLList); }
00644
00646 const MISTRING& GetName (
00647 ) const { return (m_Name); }
00648
00650 const WMS::DATAURL& GetStyleSheetURL (
00651 ) const { return (m_StyleSheetURL); }
00652
00654 const WMS::DATAURL& GetStyleURL (
00655 ) const { return (m_StyleURL); }
00656
00658 const MISTRING& GetTitle (
00659 ) const { return (m_Title); }
00660
00662 ERRVALUE ParseXML (
00663 const XMLNODE *xmlnode
00664 );
00665
00666 private:
00667 #ifndef GENERATING_DOXYGEN_OUTPUT
00668
00669 MISTRING m_Name;
00670 MISTRING m_Title;
00671 MISTRING m_Abstract;
00672 WMS::SIZEDATAURLLIST m_LegendURLList;
00673 DATAURL m_StyleSheetURL;
00674 DATAURL m_StyleURL;
00675 #endif
00676 };
00677 typedef MILIST<STYLE> STYLELIST;
00678
00679
00680
00681 class LAYER {
00682 public:
00684 LAYER ();
00685
00687 ~LAYER ();
00688
00690 ERRVALUE ComputeSubRegion (
00691 const SPATREF::COORDREFSYS& CoordRefSys,
00692 SUBREGION2D& SubRegion
00693 ) const;
00694
00698 const WMS::BOUNDINGBOX* FindBoundingBox (
00699 const SPATREF::COORDREFSYS *pCRS
00700 ) const;
00701
00704 const WMS::LAYER* FindLayer (
00705 const MISTRING& LayerName
00706 ) const;
00707
00710 const WMS::STYLE* FindStyle (
00711 const MISTRING& StyleName
00712 ) const;
00713
00715 const MISTRING& GetAbstract (
00716 ) const { return (m_Abstract); }
00717
00719 const WMS::ATTRIBUTION& GetAttribution (
00720 ) const { return (m_Attribution); }
00721
00723 const WMS::BOUNDINGBOXLIST& GetBoundingBoxList (
00724 ) const { return (m_BoundingBoxList); }
00725
00727 int GetCascaded (
00728 ) const { return (m_Cascaded); }
00729
00732 bool GetCoordRefSysId (
00733 const SPATREF::COORDREFSYS& CoordRefSys,
00734 MISTRING& IdStr
00735 ) const;
00736
00739 void GetCoordRefSysList (
00740 SPATREF::COORDREFSYSLIST& CoordRefSysList,
00741 bool IncludeTopLayer
00742 ) const;
00743
00745 int GetFixedHeight (
00746 ) const { return (m_FixedHeight); }
00747
00749 int GetFixedWidth (
00750 ) const { return (m_FixedWidth); }
00751
00753 const DRECT2D& GetGeographicBoundingBox (
00754 ) const;
00755
00757 const MISTRINGLIST& GetKeywordList (
00758 ) const { return (m_KeywordList); }
00759
00761 const MILIST<LAYER>& GetLayerList (
00762 ) const { return (m_LayerList); }
00763
00765 double GetMaxScaleDenominator (
00766 ) const { return (m_MaxScaleDenominator); }
00767
00769 double GetMinScaleDenominator (
00770 ) const { return (m_MinScaleDenominator); }
00771
00774 const MISTRING& GetName (
00775 ) const { return (m_Name); }
00776
00779 const LAYER* GetParent (
00780 ) const { return (m_pParent); }
00781
00783 const STYLELIST& GetStyleList (
00784 ) const { return (m_StyleList); }
00785
00787 const MISTRING& GetTitle (
00788 ) const { return (m_Title); }
00789
00791 bool IsNoSubsets (
00792 ) const { return (m_NoSubsets); }
00793
00795 bool IsOpaque (
00796 ) const { return (m_Opaque); }
00797
00799 bool IsQueryable (
00800 ) const { return (m_Queryable); }
00801
00803 ERRVALUE ParseXML (
00804 const LAYER *pParent,
00805 const XMLNODE *xmlnode
00806 );
00807
00808 private:
00809 #ifndef GENERATING_DOXYGEN_OUTPUT
00810 const WMS::LAYER *m_pParent;
00811
00812 bool m_Queryable;
00813 int m_Cascaded;
00814 bool m_Opaque;
00815 bool m_NoSubsets;
00816 int m_FixedWidth;
00817 int m_FixedHeight;
00818
00819 MISTRING m_Name;
00820 MISTRING m_Title;
00821 MISTRING m_Abstract;
00822 MISTRINGLIST m_KeywordList;
00823 SPATREF::COORDREFSYSLIST m_CoordRefSysList;
00824 MISTRINGLIST m_CoordRefSysIdList;
00825 DRECT2D m_GeographicBoundingBox;
00826 WMS::BOUNDINGBOXLIST m_BoundingBoxList;
00827 WMS::DIMENSIONLIST m_DimensionList;
00828 WMS::ATTRIBUTION m_Attribution;
00829 MISTRINGLIST m_AuthorityURLList;
00830 MISTRINGLIST m_IdentifierList;
00831 WMS::METADATAURLLIST m_MetadataURLList;
00832 WMS::DATAURLLIST m_DataURLList;
00833 WMS::DATAURLLIST m_FeatureListURLList;
00834 STYLELIST m_StyleList;
00835 double m_MinScaleDenominator;
00836 double m_MaxScaleDenominator;
00837 MILIST<LAYER> m_LayerList;
00838
00839 void GetCoordRefSysListLow (SPATREF::COORDREFSYSLIST& CoordRefSysList, bool IncludeTopLayer) const;
00840 ERRVALUE ParseGeographicBoundingBox (const XMLNODE *xmlnode);
00841 ERRVALUE ParseLatLonBoundingBox (const XMLNODE *xmlnode);
00842
00843 #endif
00844 };
00845 typedef MILIST<LAYER> LAYERLIST;
00846
00847
00849 class CAPABILITY {
00850 public:
00851
00853
00854 class EXCEPTION {
00855 public:
00857 EXCEPTION ();
00858
00860 ~EXCEPTION ();
00861
00863 const MISTRINGLIST& GetFormatList (
00864 ) const { return (m_FormatList); }
00865
00867 ERRVALUE ParseXML (
00868 const XMLNODE *xmlnode
00869 );
00870
00871 private:
00872 #ifndef GENERATING_DOXYGEN_OUTPUT
00873 MISTRINGLIST m_FormatList;
00874 #endif
00875 };
00876
00878 CAPABILITY ();
00879
00881 ~CAPABILITY ();
00882
00885 const WMS::LAYER* FindLayer (
00886 const MISTRING& LayerName
00887 ) const;
00888
00891 bool GetCoordRefSysId (
00892 const SPATREF::COORDREFSYS& CoordRefSys,
00893 MISTRING& IdStr
00894 ) const;
00895
00898 void GetCommonCoordRefSysList (
00899 const MISTRINGLIST& LayerNameList,
00900 SPATREF::COORDREFSYSLIST& CoordRefSysList
00901 ) const;
00902
00904 const WMS::CAPABILITY::EXCEPTION& GetException (
00905 ) const { return (m_Exception); }
00906
00908 const WMS::LAYER& GetLayer (
00909 ) const { return (m_Layer); }
00910
00912 const WMS::REQUEST& GetRequest (
00913 ) const { return (m_Request); }
00914
00916 ERRVALUE ParseXML (
00917 const XMLNODE *xmlnode
00918 );
00919
00920 private:
00921 #ifndef GENERATING_DOXYGEN_OUTPUT
00922
00923 WMS::REQUEST m_Request;
00924 WMS::CAPABILITY::EXCEPTION m_Exception;
00925 WMS::LAYER m_Layer;
00926 #endif
00927 };
00928
00929
00931 class CAPABILITIES {
00932 public:
00933
00935 CAPABILITIES ();
00936
00938 ~CAPABILITIES ();
00939
00941 void AddRef (
00942 ) { ++m_RefCount; }
00943
00945 const WMS::CAPABILITY& GetCapability (
00946 ) const { return (m_Capability); }
00947
00949 const WMS::SERVICE& GetService (
00950 ) const { return (m_Service); }
00951
00953 const MISTRING& GetVersion (
00954 ) const { return (m_Version); }
00955
00957 const MISTRING& GetUpdateSequence (
00958 ) const { return (m_UpdateSequence); }
00959
00961 const XMLDOC& GetXML (
00962 ) const { return (*m_pDocReply); }
00963
00965 ERRVALUE ParseMessage (
00966 const HTTPMESSAGE& message
00967 );
00968
00970 void Release (
00971 ) {
00972 if ((--m_RefCount) == 0) delete this;
00973 }
00974
00975 private:
00976 #ifndef GENERATING_DOXYGEN_OUTPUT
00977 UINT32 m_RefCount;
00978 XMLDOC *m_pDocReply;
00979
00980 WMS::SERVICE m_Service;
00981 WMS::CAPABILITY m_Capability;
00982
00983 MISTRING m_Version;
00984 MISTRING m_UpdateSequence;
00985
00986 CAPABILITIES (const CAPABILITIES& rhs);
00987 CAPABILITIES& operator= (const CAPABILITIES& rhs);
00988 #endif
00989 };
00990
00991
00992
00993 }
00994 }
00995
00996 #endif // INC_SOA_WMSCAPABILITIES_H