1 | | = Getting started with COWS server and COWS client = |
2 | | |
3 | | [[PageOutline]] |
4 | | |
5 | | This page provides a quick overview on how to get started with a COWS server and COWS client applications. |
6 | | |
7 | | == Setting up an example COWS server == |
8 | | |
9 | | Here is a basic set of instructions for setting up a cowsserver instance with an example dataset. In the examples below it is assumed your test dataset CSML file has been called {{{mydataset.xml}}}. Note that this assumes you have installed all the dependencies and that their scripts are in your path: |
10 | | |
11 | | 1. Create your CSML file describing an example NetCDF file: |
12 | | |
13 | | {{{ |
14 | | # I'm going to use a NetCDF file called 'var1.nc' in $MYDATA dir |
15 | | # I'll create my CSML file describing that data as '$MYDATA/mydataset.xml' |
16 | | |
17 | | $ cd $MYDATA |
18 | | $ csmlscan -i mydataset -N "My Dataset" -o mydataset.xml var1.nc |
19 | | # Which writes: $MYDATA/mydataset.xml |
20 | | }}} |
21 | | |
22 | | 2. Modify the pylons app configuration file {{{development.ini}}} to point at local paths and the required port: |
23 | | |
24 | | ***ADD EXAMPLE CHANGES HERE*** |
25 | | |
26 | | 3. Go to the top-level directory containing the {{{development.ini}}} file and start the service: |
27 | | |
28 | | The service can be run using paster or mod_wsgi, this example uses paster. |
29 | | |
30 | | {{{ |
31 | | $ paster serve development.ini |
32 | | }}} |
33 | | |
34 | | 4. Now open a browser and look at the top-level catalogue page: |
35 | | |
36 | | Note that the URL {{{http://<host>:<port>/}}} will route to the "catalogue" controller in the pylons app that shows, for each dataset (CSML file), the following links: |
37 | | |
38 | | {{{ |
39 | | Templates: |
40 | | * WMS GetCapabilities - http://<host>:<port>/<dataset_id>/wms?service=WMS&request=GetCapabilities&id=None |
41 | | * WCS GetCapabilities - http://<host>:<port>/<dataset_id>/wcs?service=WCS&request=GetCapabilities&id=None |
42 | | * WMS GetCapabilities - http://<host>:<port>/<dataset_id>/wfs?service=WFS&request=GetCapabilities&id=None |
43 | | |
44 | | Examples: |
45 | | * WMS GetCapabilities - http://westerly.badc.rl.ac.uk:8444/mydataset/wms?service=WMS&request=GetCapabilities&id=None |
46 | | * WCS GetCapabilities - http://westerly.badc.rl.ac.uk:8444/wcs?service=WCS&request=GetCapabilities&id=None |
47 | | * WMS GetCapabilities - http://westerly.badc.rl.ac.uk:8444/wfs?service=WFS&request=GetCapabilities&id=None |
48 | | }}} |
49 | | |
50 | | 5. Make a WMS !GetLegend call: |
51 | | |
52 | | If you investigate the layer names in the WMS !GetCapabilities document (see above) then you can use a layer name to generate a request based on the template below: |
53 | | |
54 | | {{{ |
55 | | * template - http://<host>:<port>/<dataset_id>/wms?request=GetLegend&layers=<layer_name> |
56 | | * example - http://westerly.badc.rl.ac.uk:8444/mydataset/wms?request=GetLegend&layers=mydataset_pqn |
57 | | }}} |
58 | | |
59 | | 6. Make a WMS !GetMap call: |
60 | | |
61 | | Insertion of the layer name into the template below should return a Map tile: |
62 | | |
63 | | {{{ |
64 | | * template - http://<host>:<port>/<dataset_id>/wms?SRS=EPSG%3A4326&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&TIME2794-12-01T00:00:00.0=&LAYERS=<layer_name>&BBOX=-29%2C-20%2C50%2C50&WIDTH=256&HEIGHT=256 |
65 | | |
66 | | * example - http://westerly.badc.rl.ac.uk:8444/mydataset/wms?SRS=EPSG%3A4326&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&TIME2794-12-01T00:00:00.0=&LAYERS=mydataset_pqn&BBOX=-29%2C-20%2C50%2C50&WIDTH=256&HEIGHT=256 |
67 | | }}} |
68 | | |
69 | | 7. Make a WCS !GetCoverage call: |
70 | | |
71 | | You should be able to get a coverage from the WCS by adapting the template below: |
72 | | |
73 | | {{{ |
74 | | * template - http://<host>:<port>/<dataset_id>/wcs?request=GetCoverage&service=WCS&version=1.0.0&crs=EPSG:4326&format=cf-netcdf&coverage=<coverage_name>&bbox=-180,-90,180,90& |
75 | | |
76 | | * example - http://westerly.badc.rl.ac.uk:8443/mydataset/wcs?request=GetCoverage&service=WCS&version=1.0.0&crs=EPSG:4326&format=cf-netcdf&coverage=mydataset_pqn&bbox=-180,-90,180,90& |
77 | | }}} |
78 | | |
79 | | == Setting up an example COWS client application == |
80 | | |
81 | | The main cowsclient is currently the '''wmsviz''' controller that is served under {{{http://<host>:<port>/wmsviz}}}. |
82 | | |
83 | | 1. Modify the {{{development.ini}}} configuration file: |
84 | | |
85 | | Go to the top-level cowsclient directory and modify the {{{development.ini}}} file and make changes (if you are not using the defaults). |
86 | | |
87 | | {{{ |
88 | | # Example changes to development.ini, if serving data from (host=westerly and port=844): |
89 | | port = 8443 |
90 | | serverurl=http://westerly.badc.rl.ac.uk:8443 |
91 | | }}} |
92 | | |
93 | | 2. Modify the avilalable end points: |
94 | | |
95 | | The cowsclient can be provided with various endpoints (URLs to WMS service capabilities) but can also be given endpoints interactively. Here are a few WMS end points (some of which are secured) that might be useful: |
96 | | |
97 | | '''Public WMS endpoints''' |
98 | | |
99 | | **TO COME*** |
100 | | |
101 | | '''Secured WMS endpoints''' |
102 | | |
103 | | http://ceda.ac.uk/cowsclient/wmsviz?REQUEST=GetDisplayOptions&URL=http%3A%2F%2Fceda.ac.uk%2Fcows%2Fcoapec_100yr_data%2Fwms%3Frequest%3DGetDisplayOptions%26layers%3Dcoapec_100yr_data_solar_2 |
104 | | |
105 | | 3. Deploy the service using paster: |
106 | | |
107 | | {{{ |
108 | | $ paster serve development.ini |
109 | | }}} |
110 | | |
111 | | 4. View the {{{wmsviz}}} controller from a browser: |
112 | | |
113 | | Open the following page in a browser: |
114 | | |
115 | | {{{ |
116 | | * template - http://<host>:<port>/wmsviz |
117 | | * example - http://westerly.badc.rl.ac.uk:8443/wmsviz |
118 | | }}} |
| 1 | See http://cows.badc.rl.ac.uk/wiki/CowsFramework/GettingStarted |