OGC Capabilities Documents In The ROA

17
Copyright © 2008, Open Geospatial Consortium, Inc., All Rights R Copyright © 2008, Open Geospatial Consortium, Inc., All Rights R June 2008  TC Meeting: Architecture DWG Presentation  66th OGC Technical Committee Potsdam, Germany Arnulf Christl June 02, 2008 Hosted by Additional Sponsors:

description

This presentation shows that an OGC WMS Capabilities document is the representation of a resource even if it is the result of the operation of a software. Thus we should also treat it as a *document*!Lets start to think about how REST can be put to use in the geospatial context.

Transcript of OGC Capabilities Documents In The ROA

Page 1: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.

June 2008 TC Meeting: Architecture DWG Presentation 

 66th OGC Technical Committee

Potsdam, GermanyArnulf Christl

June 02, 2008

Hosted by

Additional Sponsors:

Page 2: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.2

Helping the World to Communicate

Geographically

Agenda

• Scope of this presentation• RESTful OGC Web Services?• Introducing to the ROA (Resource Oriented Architecture)• OGC WMS in the ROA• Recap WMS Capabilities• Reading the Capabilities but not getting Maps• How to do Better: LegendURL• Making Capabilities findable

Copyright: WhereGroup GmbH & Co. KG.Licensed under GNU FDL http://www.gnu.org/licenses/fdl.txt  and CreativeCommons 3.0 ShareAlike

Page 3: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.3

Helping the World to Communicate

Geographically

Scope of this presentation

• This presentation shows that an OGC WMS Capabilities document is the representation of a resource (even if it is the result of the operation of a software).

• The idea is NOT to start a discussion whether SOAP will clean the REST of the web.

• The idea is NOT to present REST as the solution to all problems.

• The idea is to start thinking abouthow REST can be put to use.

Page 4: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.4

Helping the World to Communicate

Geographically

RESTful OGC Web Services?

• According to Wikipedia OGC Services have been designed around the REST paradigm [1].

• This is funny because 10 years ago the term REST and RESTful  services was yet to be born.

• Maybe the OGC was more avant­garde than we might have expected? 

• Probably the OGC design simply followed standard best practices to serve the emerging WAN architecture.

• As an example we look into the standard OGC WMS.[1] http://en.wikipedia.org/wiki/Open_Geospatial_Consortium

Page 5: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.5

Helping the World to Communicate

Geographically

Introducing the ROA

• The Resource Oriented Architecture is about enabling the programmable web. It is the home for RESTful web services.

• Instead of calling remote procedures at one single address it uses distributed resources across the web.

• Many implementations of OGC WMS standards are based on a software's perspective of the architecture.

• The ROA is the architecture's perspective of a software that runs as a service. 

Page 6: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.6

Helping the World to Communicate

Geographically

The ROA Concepts and Properties

Four concepts: ResourcesTheir names (URL)Their representationsThe links between them 

and four properties AddressabilityStatelessnessConnectednessA uniform Interface

From: RESTful Web Services, Richardson & Ruby, page 105

Page 7: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.7

Helping the World to Communicate

Geographically

OGC WMS in the ROA

• The OGC WMS standard is not all that interesting from a programmable web's perspective because it only returns pretty but dumb images. 

• But the OGC WMS Capabilities document is a good start to look what could be done better

• The Capabilities already contains (almost) everything that is required to make clients get maps in the ROA. 

• Clients must know how to formulate a GET request with scoping parameters, some of which have explicit values.

Page 8: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.8

Helping the World to Communicate

Geographically

The OGC WMS Capabilities Document

• The OGC WMS capabilities document contains information about "maps" (the resource) and how to access them (GET a representation).

• The Capabilities document is one possible representation (the meta data) of the resource "maps".

• It contains hints on how to GET (GetMap) more representations (images) of the named resource (maps).

• Although it contains redundant information about WHERE the resource is, the client still must have implicit knowledge of HOW to GET the representation.

Page 9: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.9

Helping the World to Communicate

Geographically

Getting OGC WMS Capabilities[1]

• OGC WMS capabilities documents have a location (URL)http://wms.oregonexplorer.info/ecwp/ecw_wms.dll?

• Then the resource has to be scoped with a set of defined parameters to actually get the document.?REQUEST=GetCapabilties&SERVICE=WMS&VERSION=1.1.1

• This scoping information (in practice) never changes.http://wms.oregonexplorer.info/ecwp/capabilites

...would be just fine, maybe add the version of the service:http://wms111.oregonexplorer.info/ecwp/capabilites

• The Capabilties document is just a representation of the resource "maps" that exposes its meta data.

[1] http://wms.oregonexplorer.info/ (OGC web site of the month 03/2008)

Page 10: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.10

Helping the World to Communicate

Geographically

<Request><GetCapabilities>

<Format>application/vnd.ogc.wms_xml</Format><DCPType>

<HTTP><Get>

<OnlineResource xlink:href="http://wms.oregonexplorer.info/ecwp/ecw_wms.dll?"/></Get>

</HTTP></DCPType>

</GetCapabilities><GetMap>

<Format>image/png</Format><Format>image/jpeg</Format>

<DCPType><HTTP>

<Get><OnlineResource xlink:href="http://wms.oregonexplorer.info/ecwp/ecw_wms.dll?"/>

</Get>[...]

Reading the Capabilities Documents

• The "Capabilities" contains information WHERE to get maps but not HOW to get them:

Page 11: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.11

Helping the World to Communicate

Geographically

Not Getting the Map

• To get a map representation of the OGC WMS resource the client has to scope it with parameters.http://wms.oregonexplorer.info/ecwp/ecw_wms.dll? REQUEST=GetMapSERVICE=WMSVERSION=1.1.1LAYERS=2005ORTHOIMAGERY.ECWFORMAT=image/jpegSTYLES=BGCOLOR=0xFFFFFFTRANSPARENT=TRUESRS=EPSG:4326BBOX=­122.168515234362,42.8926048497946,­122.039660890008,42.9934387129544WIDTH=835HEIGHT=705

Page 12: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.12

Helping the World to Communicate

Geographically

Getting the Map

• Some of these parameters are irrelevant, some should be part of the URL, some I don't know what to do about either. http://wms111.oregonexplorer.info/ecwp/ecw_map? 

REQUEST=GetMapSERVICE=WMSVERSION=1.1.1

? LAYERS=2005ORTHOIMAGERY.ECWFORMAT=image/jpeg

STYLES=BGCOLOR=0xFFFFFFTRANSPARENT=TRUE

? SRS=EPSG:4326BBOX=­122.168515234362,42.8926048497946,­122.039660890008,42.9934387129544WIDTH=835HEIGHT=705

Page 13: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.13

Helping the World to Communicate

Geographically

[...]    <Layer queryable="0" opaque="0" cascaded="0">        <Name>railroad_line</Name>        <Title>Railroad lines</Title>        <SRS>epsg:4326</SRS>        <LatLonBoundingBox minx="5.98259" miny="47.4064" maxx="15" maxy="54.9045" />        <BoundingBox SRS="EPSG:4326"                    minx="5.98259" miny="47.4064" maxx="15" maxy="54.9045" />        <Style>          <Name>default</Name>          <Title>default</Title>          <LegendURL width="20" height="10">             <Format>image/png</Format>             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:               href="http://wms.wheregroup.com/cgi­bin/germany?version=1.1.1&amp;service=WMS&                amp;request=GetLegendGraphic&amp;layer=railroad_line&amp;format=image/png"/>          </LegendURL>        </Style>    </Layer>[...]

LegendURL does it better [1]

• This OnlineResource has all the WHERE and the HOW:

[1] http://wms.wheregroup.com/cgi­bin/germany

Page 14: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.14

Helping the World to Communicate

Geographically

<Request><EPSG4326>

<Format>image/png</Format><Format>image/jpeg</Format>

<DCPType><HTTP>

<Get><OnlineResource xlink:href="http://wms.oregonexplorer.info/ecwp/4326/ecw_map?"/>

</Get></HTTP>

</DCPType></GetCapabilities><EPSG:26910>

<Format>image/png</Format><Format>image/jpeg</Format>

<DCPType><HTTP>

<Get><OnlineResource xlink:href="http://wms.oregonexplorer.info/ecwp/26910/ecw_map?"/> 

</Get>

Modifying Capabilities Documents

• Capabilities with WHERE and HOW to get maps:

Page 15: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.15

Helping the World to Communicate

Geographically

The ROA Rules!

Four concepts:ResourcesTheir names (URL)Their representationsThe links between them 

and four properties AddressabilityStatelessnessConnectednessA uniform Interface

 in              up  /\   left  <[MAP]>  rightout           down     capabilities   Legend

capabilitiesmapslegends...

From: RESTful Web Services, Richardson & Ruby, page 105

Page 16: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.16

Helping the World to Communicate

Geographically

Making Capabilities Findable

• Expose OGC WMS Capabilities documents as really beautiful documents not as the result of a remotely invoked operation of a software.

• Give the Capabilities Document an extra home (URL). • The Capabilities Document is the v­card of the service and 

must contain all information that is needed to access the resource and get a result. 

• Explore how to use XHTML as a format that is readable by machines and humans alike.

Page 17: OGC Capabilities Documents In The ROA

Copyright © 2008, Open Geospatial Consortium, Inc., All Rights Reserved.17

Helping the World to Communicate

Geographically

Discussion

Thank you for your attention.

Author: Arnulf Christl WhereGroup GmbH & Co. KGSiemensstr. 853121 BonnGermanyhttp://www.wheregroup.com/ 

Copyright: WhereGroup GmbH & Co. KG.

This  presentation  is  dual  licensed  under  GNU  FDL  and Creative Commons 3.0 Share Alike. Choose the one that fits your needs best. The presentation master, first page and last page (this one) are what the GNU FDL refers to as invariant sections.  Please  do  not  modify  these  pages  without  getting written permission by the author. Find the full text of the GNU FDL at: http://www.gnu.org/licenses/fdl.txt