Difference between revisions of "WCS Wrapper Installation WindowsOP"

From Earth Science Information Partners (ESIP)
 
(166 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[WCS_Access_to_netCDF_Files| Back to WCS Wrapper]]   
 
[[WCS_Access_to_netCDF_Files| Back to WCS Wrapper]]   
  
'''Datafed OWS package 1.2'''
+
[http://aq-ogc-services.sourceforge.net Project on SourceForge]
  
Questions and Comments should be directed to Kari Hoijarvi [mailto:hoijarvi@seas.wustl.edu hoijarvi@seas.wustl.edu] Phone 314-935-6099(w) or 314-843-6436(h)
+
Questions and comments should go to [http://sourceforge.net/p/aq-ogc-services/discussion/ sourceforge discussions], bug reports to [http://sourceforge.net/p/aq-ogc-services/tickets/ sourceforge tickets]. Urgent issues can be asked from Kari Hoijarvi 314-935-6099(w) or 314-843-6436(h)
  
Binaries last updated July/15/10
+
Last updated 2010-12-13
  
== Get Python 2.6.5 ==
+
== Install as Administrator ==
  
We recommend '''python 2.6.5.14''' from [http://www.activestate.com/activepython/downloads ActiveState Python download page] or [http://downloads.activestate.com/ActivePython/releases/2.6.5.14/ActivePython-2.6.5.14-win32-x86.msi ActiveState Direct Download] or you can download from [http://www.python.org/download/releases/2.6.5/] but activepython contains some goodies, like very nice language sensitive editor '''PythonWin'''.
+
This installation requires admin rights. After installation, you can switch to a user account.
  
Since the C and C++ dll's are 32 bit, get a '''32 bit''' python even if you have 64 bit machine.
+
== Things to Consider About Security ==
 +
 
 +
The web.py framework and WCS service code has been written with security in mind, and there are no known security bugs. There is no code that writes on the disk, so running this service should not put your computer in danger.
 +
 
 +
To maximize the security of your computer, consider the following.
 +
 
 +
* '''Every file in every directory''' you put under C:\OWS\web\static becomes '''readable by anybody'''. This is by design, since the whole framework is meant to publish public data. '''Do not put confidential information under OWS folder!'''
 +
 
 +
* Windows Vista and later: Don't run this process with administrative rights. Create a low-rights account like WCS_RUNNER and use that.
 +
 
 +
* Under Windows XP, the WCS_RUNNER account requires administrative privileges. It should not, but it seems that [http://support.microsoft.com/kb/223375 it is required]. Those who know better, please inform the author. Go to ''Control panel / Administrative Tools / Computer management / Local Users and Groups''. Add a new user, add '''administrators''' to groups and make password non-expiring, not changeable.
 +
 
 +
== Get Python 2.6.6 ==
 +
 
 +
'''Attention. Activestate download is not available, so download from official site or wait that we support python 2.7'''
 +
 
 +
We recommend latest '''python 2.6.6''' from [http://www.activestate.com/activepython/downloads ActiveState Python download pa
 +
ge] or [http://downloads.activestate.com/ActivePython/releases/2.6.6.18/ActivePython-2.6.6.18-win32-x86.msi ActiveState Direct Download] or you can download from [http://www.python.org/download/releases/2.6.6/ official site] but activepython contains some goodies, like very nice language sensitive editor '''PythonWin'''.
 +
 
 +
Since the C and C++ dll's are 32 bit, get a '''32 bit''' python even if you have 64 bit machine. If requested, we will support 64 bit binaries too.
 +
 
 +
== Get the Datafed WCS Wrapper ==
 +
 
 +
If you have modified the default '''OWS/web/static/index.html'', make sure '''not to overwrite''' it. Keep the main copy elsewhere and copy it back.
 +
 
 +
Open the [http://sourceforge.net/projects/aq-ogc-services/files/ download page] in another tab.
 +
 
 +
If you are serving cubes from NetCDF files, get '''win32-ows-1.3.1.zip''' or later. This distribution contains point data support also. If you are serving only point data, you can just download '''ows-point-1.3.1.zip'''.
 +
 
 +
    ows-point-1.3.1.zip = (win32-ows-1.3.1.zip) - (netcdf support) + (sample point provider)
 +
 
 +
Unzip it/both into your installation folder '''C:\OWS'''. You can install to other folders, this is just used as an example.
 +
 
 +
You will to have directories '''C:\OWS\datafed''' and '''C:\OWS\web'''
 +
 
 +
The folder datafed contains ''datafed'' package, which contains tools for ISO 8601 time
 +
parsing and python-NetCDF module '''nc3''' ''(not in point)''. ''Web'' is the WCS framework.
 +
 
 +
Notice:
 +
 
 +
Linux is using '''PyNIO''' for '''NetCDF''' access from python. Since '''PyNIO''' is not supported under Windows, a subset '''datafed/minio''', was developed for windows. Using C based libraries enables delivering large amounts of data efficiently. Python is used only for query parsing, making minimal impact in speed.
 +
 
 +
Although the built-in webserver is intended mainly for development, you can use it to serve data from your own workstation just fine. For high load sites, look [http://webpy.org/install webpy.org/install] documentation how to integrate webpy with apache server etc.
  
 
== Get 3rd Party Components ==
 
== Get 3rd Party Components ==
  
Download [http://datafed.net/ows/OWS_3rdparty.zip OWS_3rdparty.zip] or hunt them down yourself.
+
Download [http://sourceforge.net/projects/aq-ogc-services/files/win32-3rdparty-1.2.0.zip/download win32-3rdparty-1.2.0.zip].  
  
 
Unzip the file. You'll see
 
Unzip the file. You'll see
  
 +
* runtime
 +
* web.py-0.33
 +
* activepython.txt
 +
* install_webpy.bat
 
* lxml-2.2.4.win32-py2.6.exe
 
* lxml-2.2.4.win32-py2.6.exe
* install_webpy.bat
+
* numpy-1.4.1-win32-superpack-python2.6.exe
* webpy
+
* OWS version 1.3.x
* install_netcdf.bat
+
 
* netcdf
+
Installing: all the files are in the 3rd party bundle, you don't need to go to web during installation.
 +
 
 +
* OWS version 1.3.x is just marking the version of this distribution.
 +
 
 +
* Copy all the files from '''runtime''' to C:\OWS\datafed. The NetCDF is not an unofficial build, so do not replace your old NetCDF dll's with it. ''(Not required in point)''
 +
 
 +
* activepython.txt is already done.
 +
 
 +
* Install webpy [[Image:webpy_favicon.png]] Run batch file '''install_webpy.bat''', it will print about two pages informational messages. There should be no warnings or errors. [http://webpy.org webpy home]
 +
 
 +
* Install lxml by running the setup program '''lxml-2.2.4.win32-py2.6.exe''', use default answer for everything. The lxml package is already in version 2.2.6, but the windows builds are not ready. [http://codespeak.net/lxml/ lxml home] [http://pypi.python.org/pypi/lxml/2.2.4 download page] [http://pypi.python.org/packages/2.6/l/lxml/lxml-2.2.4.win32-py2.6.exe#md5=d58763332ea0043b2e145e15a7b878fb direct download link]
 +
 
 +
* Install numpy 1.4.1 by running numpy-1.4.1-win32-superpack-python2.6.exe. Numpy is a great library for array manipulation. [http://numpy.scipy.org/ numpy home] [http://sourceforge.net/projects/numpy/files/ sourceforge download page] [https://sourceforge.net/projects/numpy/files/NumPy/1.4.1/numpy-1.4.1-win32-superpack-python2.6.exe/download direct download link] ''(Not required in point)''
 +
 
 +
 
  
Installing:
+
'''Disclaimer''': ''(Not required in point)'' The C:\OWS\datafed\netcdf.dll is a custom compiled from [[Image:Unidata_favicon.png]] [ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.1.2-beta1.tar.gz netcdf-4.1.2-beta1] and all the documented library calls are not be present. The bundled ncgen.exe and ncdump.exe are compiled for this purpose, nctest.exe is not there. It's heavily unit tested under datafed OWS framework, for other purposes use with caution.
  
* Install [http://codespeak.net/lxml/ lxml] ([http://pypi.python.org/pypi/lxml/2.2.4 download page]) ([http://pypi.python.org/packages/2.6/l/lxml/lxml-2.2.4.win32-py2.6.exe#md5=d58763332ea0043b2e145e15a7b878fb direct download link]) by running the setup program '''lxml-2.2.4.win32-py2.6.exe''', use default answer for everything. The lxml package is already in version 2.2.6, but the windows builds are not ready.
 
  
* Install webpy [http://webpy.org webpy.org] [[Image:webpy_favicon.png]] Run batch file '''install_webpy.bat''', it will print about two pages informational messages. There should be no warnings or errors.  
+
The datafed folder also contains utilities '''ncdump.exe''' and '''ncgen.exe''' Especially ncdump is very useful when creating or inspecting netcdf files. The page [http://www.unidata.ucar.edu/software/netcdf/docs/index.html UNIDATA NetCDF docs] has more information about these utilities. [http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install Main installation page] may be useful too.
  
* Install [http://numpy.scipy.org/ numpy 1.4.1]. Numpy is a great library for array manipulation, and this project is moving into it. ([http://sourceforge.net/projects/numpy/files/ sourceforge download page]) ([http://softlayer.dl.sourceforge.net/project/numpy/NumPy/1.4.1/numpy-1.4.1-win32-superpack-python2.6.exe direct download link])
+
== Configure Firewall PYTHONPATH  ==
  
* Install NetCDF [[Image:Unidata_favicon.png]]
+
Since your computer is probably running a firewall, and if it isn't it should, it's necessary to allow python to act as a server for incoming connections. For Windows firewall on XP:
  
The netcdf folder has no setup program. The install_netcdf.bat simply contains instructions where to copy files, and it shows your current '''PATH''' environment variable.
+
* Open Control panel/Windows Firewall
 +
* Exceptions tab
 +
* Add Program...
 +
* "Python Interactive Shell" or browse for C:\python26\python.exe
 +
* Hit OK
  
The only file you absolutely need from the netcdf folder is '''netcdf.dll'''. Move it somewhere in the path. '''ncdump.exe''' is a very useful utility, that we recommend to have also. [http://www.unidata.ucar.edu/software/netcdf/docs/index.html UNIDATA NetCDF docs] has more information about these utilities. [http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install Main installation page] may be useful too.
+
Make sure that '''C:\OWS''' and '''C:\OWS\web''' are in your '''PYTHONPATH''' variable. Create it via Control Panel
 +
/ System / Advanced / Environment Variables. Pythonpath looks just like PATH.
  
== Get the OWS WCS Wrapper ==
+
Run command prompt, start / run, "cmd.exe". Type "SET PYTHONPATH". If you see '''PYTHONPATH=C:\OWS;C:\OWS\web''' you're OK.
  
From [http://datafed.net/ows/datafed_ows.zip datafed.net/ows/datafed_ows.zip]. Unzip
+
== Start the Server ==
it into your installation folder, let's use '''C:\OWS''' as an example.
 
  
You will to have directories '''C:\OWS\datafed''' and '''C:\OWS\web'''
+
To see your IP address, type
  
The folder datafed contains ''datafed'' package, which contains tools for ISO 8601 time
+
    C:\OWS\web>ipconfig
parsing and python-NetCDF bridge. ''Web'' is the WCS framework.
 
  
Make sure that '''C:\OWS''' is in your '''PYTHONPATH''' variable. Create it via Control Panel
+
    Windows IP Configuration
/ System / Advanced / Environment Variables
+
    Ethernet adapter Local Area Connection:
 +
        Connection-specific DNS Suffix  . : gateway.2wire.net
 +
        IP Address. . . . . . . . . . . . : 192.168.1.65
 +
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
 +
        Default Gateway . . . . . . . . . : 192.168.1.254
  
Run command prompt, start / run, "cmd.exe". Type "SET PYTHONPATH". If you see '''PYTHONPATH=C:\OWS''' you're OK
+
Your public IP address is 192.168.1.65
  
 
Change Directory to '''C:\OWS\web''' folder and type '''python ows.py'''. You have now your server running, listening port 8080.
 
Change Directory to '''C:\OWS\web''' folder and type '''python ows.py'''. You have now your server running, listening port 8080.
Line 58: Line 124:
 
You can pass the port as parameter. '''python ows.py 80''' listens the standard port 80.
 
You can pass the port as parameter. '''python ows.py 80''' listens the standard port 80.
  
Congratulations if you got this far. Now we need to install some data to serve.
+
Open [http://localhost:8080 http://localhost:8080] and you should see the home page. Congratulations if you got this far. Now we need to install some data to serve. replace localhost with your IP address.
 +
 
 +
If the server won't start, try to set the path explicit  ''(Not required in point)'':
 +
 
 +
    set path=C:\OWS\datafed;%PATH%
 +
 
 +
to make sure, that correct versions of NetCDF and HDF dynamic link libraries are used.
  
 
== Putting your data into CF Compatible NetCDF Files ==
 
== Putting your data into CF Compatible NetCDF Files ==
  
The installation contains an example dataset 'testprovider'.
+
''(Not required in point)'' This is for getting the demo run only, more detailed instructions on how to serve '''cube''' and '''point''' data is documented at [[WCS_Wrapper_Configuration| WCS Wrapper Configuration]]
 +
How to use the wrapper libraries can be found in related page
 +
[http://wiki.esipfed.org/index.php/Creating_NetCDF_CF_Files Creating NetCDF-CF Files].
 +
 
 +
Setting up the demo dataset:
 +
 
 +
'''C:\OWS\web\static\testprovider\''' contains files:
 +
* [http://localhost:8080/static/testprovider/CubeA.ncml CubeA.ncml] and [http://localhost:8080/static/testprovider/CubeA.nc CubeA.nc]
 +
* [http://localhost:8080/static/testprovider/CubeB.ncml CubeB.ncml] and [http://localhost:8080/static/testprovider/CubeB.nc CubeB.nc]
 +
* [http://localhost:8080/static/testprovider/CubeB.ncml H5D.ncml] and [http://localhost:8080/static/testprovider/CubeB.nc H5D.nc]
 +
* [http://localhost:8080/static/testprovider/create_all.py create_all.py]
 +
 
 +
* [http://localhost:8080/static/testprovider/index.html index.html]
 +
* [http://localhost:8080/static/testprovider/wcs_capabilities.conf wcs_capabilities.conf]
 +
 
 +
*'''CubeA.ncml''' is a [http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/Tutorial.html NetCDF Markup Language] description of the test coverage, same for teh rest of the .ncml files. The .nc files are files that are created from using the ncml as instructions.
 +
*'''create_all.py''' is a script that creates the empty cube files and then fills it with test data. It servers as an example code how to create your own CF 1.0 compatible files. It has no user interface, just run it.
 +
 
 +
So do the following:
 +
 
 +
    cd C:\OWS\web\static\testprovider
 +
    create_all
 +
 
 +
activepython registers python.exe as default program for .py files, so you don't need to say ''python CubeA.py''
 +
 
 +
Now you have data to serve.
 +
 
 +
== Extract metadata from the NetCDF Files ==
 +
 
 +
Change directory to  and issue command
 +
 
 +
    cd C:\OWS\web
 +
    owsadmin wcs_prepare -ao
 +
 
 +
This program extracts the metadata from the netcdf files. Each provider will get a 'metadata.dat' giving fast access to coverages, fields and dimensionality.  
  
'''C:\OWS\web\static\testprovider\''' contains files [http://128.252.167.125:8080/static/testprovider/CubeA.ncml CubeA.ncml], '''CubeA.py''' and '''CubeA.nc'''
+
The WCS Service is now ready.
  
*'''CubeA.ncml''' is a [http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/Tutorial.html NetCDF Markup Language] description of the test coverage.
+
== Test Your WCS server ==
*'''CubeA.py''' is a script that creates the empty '''CubeA.nc''' file and fills it with test data. It servers as an example code how to create your own CF 1.0 compatible files. It has no user interface, just run it.
 
*'''CubeA.nc''' is the output of two previous, and serves as our test coverage.
 
  
Now, when you have '''C:\OWS\web\static\testprovider\CubeA.nc''' you actually have a '''WCS''' Service.
+
GetCapabilities query for NetCDF: http://localhost:8080/testprovider?service=WCS&acceptversions=1.1.2&Request=GetCapabilities
 +
or from the [http://128.252.202.19:8080/testprovider?service=WCS&version=1.1.2&Request=GetCapabilities external server]
  
More complete instructions on how to use the wrapper libraries can be fount in related page
+
GetCapabilities query for point: http://localhost:8080/point?service=WCS&acceptversions=1.1.2&Request=GetCapabilities
[http://wiki.esipfed.org/index.php/Creating_NetCDF_CF_Files Creating NetCDF-CF Files].
+
or from the [http://128.252.202.19:8080/point?service=WCS&version=1.1.2&Request=GetCapabilities external server]
 +
 
 +
 
 +
DescribeCoverage query for NetCDF: http://localhost:8080/testprovider?service=WCS&version=1.1.2&Request=DescribeCoverage&identifiers=CubeA or from the [http://128.252.202.19:8080/testprovider?service=WCS&version=1.1.0&Request=DescribeCoverage&identifiers=CubeA external server]
  
== You have now a WCS server ==
+
DescribeCoverage query for point: http://localhost:8080/point?service=WCS&version=1.1.2&Request=DescribeCoverage&identifiers=SURF_MET or from the [http://128.252.202.19:8080/point?service=WCS&version=1.1.0&Request=DescribeCoverage&identifiers=SURF_MET external server]
  
If you started the server, you can try this
 
  
http://localhost:8080/testprovider?service=WCS&version=1.1.0&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=true  
+
GetCoverage query for NetCDF: http://localhost:8080/testprovider?service=WCS&version=1.1.2&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=true or from the [http://128.252.202.19:8080/testprovider?service=WCS&version=1.1.2&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=true external server]
  
or the same test query from an [http://128.252.167.125:8080/testprovider?service=WCS&version=1.1.0&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=true external server]
+
GetCoverage query for point http://localhost:8080/point?service=WCS&request=getCoverage&version=1.1.2&identifier=SURF_MET&BoundingBox=-130,24,-50,40,urn:ogc:def:crs:OGC:2:84&TimeSequence=2009-09-01T15:00:00&RangeSubset=TEMP&format=text/csv&store=true
 +
[http://128.252.202.19:8080/point?service=WCS&request=getCoverage&version=1.1.2&identifier=SURF_MET&BoundingBox=-130,24,-50,40,urn:ogc:def:crs:OGC:2:84&TimeSequence=2009-09-01T15:00:00&RangeSubset=TEMP&format=text/csv&store=true external server]
  
 
Sections of the WCS url:
 
Sections of the WCS url:
 
*'''http://your_domain_or_ip_address:8080''' is the server url. It returns a static index.html page of providers using this server.
 
*'''http://your_domain_or_ip_address:8080''' is the server url. It returns a static index.html page of providers using this server.
*'''/testprovider''' is the provider name. There must be a folder '''C:\OWS\web\static\testprovider\'''.  
+
*'''testprovider''' is the provider name. There must be a folder '''C:\OWS\web\static\testprovider\'''.  
*'''&identifier=CubeA''' is the name of the NetCDF file. So in this example, '''C:\OWS\web\static\testprovider\''' contains file '''CubeA.nc''' and it becomes a coverage.   
+
* for NetCDF:
*RangeSubset='''*''' selects variables to be returned from the NetCFD, '*' gets all, &RangeSubset='''Spam;Eggs''' gets variables '''Spam''' and '''Eggs'''.  
+
**'''&identifier=CubeA''' is the name of the NetCDF file. So in this example, '''C:\OWS\web\static\testprovider\''' contains file '''CubeA.nc''' and it becomes a coverage.   
*'''&format=image/netcdf&store=true''' specifies, that the result will be a NetCDF file that is stored in the server and can later be fetched via from an url. These are now the only supported options.
+
**RangeSubset='''*''' selects variables to be returned from the NetCFD, '*' gets all, &RangeSubset='''Spam;Eggs''' gets variables '''Spam''' and '''Eggs'''.  
 +
**'''&format=image/netcdf&store=true''' specifies, that the result will be a NetCDF file that is stored in the server and can later be fetched via from an url. These are now the only supported options.
 +
* for point:
 +
** Coverage is often a database and RangeSubset selects a value column. This is not necessarily so, since configuring SQL is much more flexible than configuring NetCDF
  
 
The wcs GetCoverage returns an Xml envelope
 
The wcs GetCoverage returns an Xml envelope
Line 94: Line 205:
 
     <pre><span class="pi">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
 
     <pre><span class="pi">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
 
&lt;<span class="start-tag">Coverages</span><span class="attribute-name"> xmlns</span>=<span
 
&lt;<span class="start-tag">Coverages</span><span class="attribute-name"> xmlns</span>=<span
     class="attribute-value">"http://www.opengis.net/wcs/1.1/ows" </span><span class="attribute-name">
+
     class="attribute-value">"http://www.opengis.net/wcs/1.1" </span><span class="attribute-name">
         xmlns:ows</span>=<span class="attribute-value">"http://www.opengis.net/ows" </span><span
+
         xmlns:ows11</span>=<span class="attribute-value">"http://www.opengis.net/ows/1.1" </span><span
 
             class="attribute-name">xmlns:xlink</span>=<span class="attribute-value">"http://www.w3.org/1999/xlink"</span>&gt;
 
             class="attribute-name">xmlns:xlink</span>=<span class="attribute-value">"http://www.w3.org/1999/xlink"</span>&gt;
 
     &lt;<span class="start-tag">Coverage</span>&gt;
 
     &lt;<span class="start-tag">Coverage</span>&gt;
         &lt;<span class="start-tag">ows:Title</span>&gt;Select * From CubeA&lt;/<span class="end-tag">ows:Title</span>&gt;
+
         &lt;<span class="start-tag">ows11:Title</span>&gt;Select * From CubeA&lt;/<span class="end-tag">ows11:Title</span>&gt;
         &lt;<span class="start-tag">ows:Abstract</span>&gt;Where boundingbox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84 and timesequence=2007-01-01&lt;/<span class="end-tag">ows:Abstract</span>&gt;
+
         &lt;<span class="start-tag">ows11:Abstract</span>&gt;Where boundingbox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84 and timesequence=2007-01-01&lt;/<span class="end-tag">ows11:Abstract</span>&gt;
         &lt;<span class="start-tag">Identifier</span>&gt;<strong>CubeA</strong>&lt;/<span class="end-tag">Identifier</span>&gt;
+
         &lt;<span class="start-tag">ows11:Identifier</span>&gt;<strong>CubeA</strong>&lt;/<span class="end-tag">ows11:Identifier</span>&gt;
         &lt;<span class="start-tag">Reference</span><span class="attribute-name"> xlink:href</span>=<span
+
         &lt;<span class="start-tag">ows11:Reference</span><span class="attribute-name"> xlink:href</span>=<span
 
             class="attribute-value">"<strong>http://localhost:8080/static/cache/CubeA_1.nc</strong>" </span><span
 
             class="attribute-value">"<strong>http://localhost:8080/static/cache/CubeA_1.nc</strong>" </span><span
 
                 class="attribute-name">xlink:role</span>=<span class="attribute-value">"urn:ogc:def:role:WCS:1.1:coverage"</span><span
 
                 class="attribute-name">xlink:role</span>=<span class="attribute-value">"urn:ogc:def:role:WCS:1.1:coverage"</span><span
Line 110: Line 221:
 
</html>
 
</html>
  
The request writes out a netcdf file '''C:\OWS\web\static\cache\CubeA_1.nc''' and so it can be retrieved later with url '''http://localhost:8080/static/cache/CubeA_1.nc'''
+
The request writes out a NetCDF file '''C:\OWS\web\static\cache\CubeA_1.nc''' and so it can be retrieved later with url '''http://localhost:8080/static/cache/CubeA_1.nc'''
 
and it will be deleted in ten minutes. The number after coverage is a generated sequence number.
 
and it will be deleted in ten minutes. The number after coverage is a generated sequence number.
  
Line 119: Line 230:
 
*Every '''variable''' inside '''NetCDF''' becomes a '''field'''
 
*Every '''variable''' inside '''NetCDF''' becomes a '''field'''
  
== Creating GetCapabilities and DescribeCoverage Documents ==
+
== GetCoverage query with '''store=false''' ==
 +
 
 +
for NetCDF: http://128.252.202.19:8080/testprovider?service=WCS&version=1.1.2&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=false
  
The metadata queries of WCS, '''GetCoverage''' and '''DescribeCoverage''' need to be precompiled.
+
for point http://128.252.202.19:8080/point?service=WCS&request=getCoverage&version=1.1.2&identifier=SURF_MET&BoundingBox=-130,24,-50,40,urn:ogc:def:crs:OGC:2:84&TimeSequence=2009-09-01T15:00:00&RangeSubset=TEMP&format=text/csv&store=false
  
Run the following commands:
+
These queries return both the xml envelope and cube file bundled together in mime-multipart format.  
:: c:
 
:: cd \OWS\web
 
:: python owsadmin.py wcs_cap -v 1.1.0 -d my.server.com -p 8080 testprovider
 
:: python owsadmin.py wcs_desc -v 1.1.0 testprovider
 
  
Replace my.server.com with your domain name or your raw ip address like 128.34.111.47, and port -p 8080 with the port you want to use. Default is the standard -p 80, but that is not always possible, since you might have another webserver in your machine. If you just want to test from your own machine, you can use '''localhost''' as the domain.
+
'''All the browsers don't work with this. Firefox can open it, Internet Explorer can't.'''
  
They will create files '''C:\OWS\web\static\testprovider\wcs_1.1.0_capabilities.xml'''
+
== Stopping the Server ==
and '''C:\OWS\web\static\testprovider\wcs_1.1.0_desc_CubeA.xml'''. The capabilities file contains all the coverages that this provider has, and each coverage gets its own desc file.
 
  
GetCapabilities query: http://localhost:8080/testprovider?service=WCS&version=1.1.0&Request=GetCapabilities
+
Press ctrl+C to terminate the server, or if you are running as a scheduled task, end the task. This is a development web server, there is no shutdown command.
or from the [http://128.252.167.125:8080/testprovider?service=WCS&version=1.1.0&Request=GetCapabilities external server]
 
  
DescribeCoverage query: http://localhost:8080/testprovider?service=WCS&version=1.1.0&Request=DescribeCoverage&identifier=CubeA or from the [http://128.252.167.125:8080/testprovider?service=WCS&version=1.1.0&Request=DescribeCoverage&identifier=CubeA external server]
+
== Running in the background ==
  
Press ctrl+C to terminate the server.  
+
This executable is meant to be a test server for developers. Therefore it does not support running as a service. Leaving your workstation on all the time is possible, but then you will have the server window open all the time, which maybe is nice for monitoring, but usually quite annoying.
  
Notice: WCS Wrapper core is written in C++, enabling large amount of data delivery. Python is used only for query parsing, making minimal impact in speed.
+
But you can run any command line program in the background.
  
== Installing a High Performance Server ==
+
Go to control panel and open "Scheduled Tasks".
  
Although the built-in webserver is intended mainly for development, you can use it to serve data from your own workstation just fine. For high load sites, look [http://webpy.org/install webpy.org/install] documentation how to intergrate webpy with apache server etc.
+
* Click on "add scheduled task."
  
== Optional: Creating a service from periodic collection of NetCDF files. ==
+
* Pick C:\OWS\web\ows.py as the executable.
  
Sometimes you have accumulated a huge number of small timeseries NetCDF files, like daily slices from a model output. You could combine those into one big cube, but you for a terabyte of files, that may not be an option.
+
* Check "When my computer starts" as the scheduling"
  
The OWS web server can be configured to serve directly from time encoded files. We are serving some
+
* Choose a proper user name. With Windows XP and earlier the user needs to be an Administrator.
HTAP ozone model data with this method.
 
  
'''Live Query Examples:'''
+
* Check box "open advanced properties..."
  
Linux Server:  
+
Change the properties:
:[http://niceguy.wustl.edu:81/HTAP?service=WCS&version=1.1.0&Request=GetCapabilities GetCapabilities]
 
:[http://niceguy.wustl.edu:81/HTAP?service=WCS&version=1.1.0&Request=DescribeCoverage&identifier=HTAP_GEMAQ-v1p0 DescribeCoverage]
 
:[http://niceguy.wustl.edu:81/HTAP?service=WCS&version=1.1.0&Request=GetCoverage&identifier=GEMAQ-v1p0&BoundingBox=260,32,280,48,urn:ogc:def:crs:OGC:2:84&TimeSequence=2001-01-01T12:00:00Z&RangeSubset=vmr_no2&format=image/netcdf&store=true GetCoverage]
 
  
Windows Workstation:
+
* The default port is 8080. On the task tab, add port number to the program C:\OWS\web\ows.py 8081
:[http://128.252.167.125:8080/HTAP?service=WCS&version=1.1.0&Request=GetCapabilities GetCapabilities]
 
:[http://128.252.167.125:8080/HTAP?service=WCS&version=1.1.0&Request=DescribeCoverage&identifier=HTAP_GEMAQ-v1p0 DescribeCoverage]
 
:[http://128.252.167.125:8080/HTAP?service=WCS&version=1.1.0&Request=GetCoverage&identifier=GEMAQ-v1p0&BoundingBox=260,32,280,48,urn:ogc:def:crs:OGC:2:84&TimeSequence=2001-01-01T12:00:00Z&RangeSubset=vmr_no2&format=image/netcdf&store=true GetCoverage]
 
  
How to set this up on your site:
+
* On settings tab, check off the "Stop the task if ..." box
  
Download our HTAP test package from [http://datafed.net/ows/datafed_ows_HTAP.zip" datafed.net/ows/datafed_ows_HTAP.zip]. It only has two days of data to make download small.
+
You can now start the task and end it from the "Scheduled tasks" form.
  
Unzip it to the '''C:\OWS''' folder, the zip file contains directories
+
Notice, that if you choose your own username, you'll see the window when you log on. This is kind of nice, since the window will display incoming queries.
'''C:\OWS\GEMAQ-v1p0''', '''C:\OWS\GEOSChem-v45''' and '''C:\OWS\web\static\HTAP\'''
 
  
The dataset name is '''HTAP'''. The coverages are '''GEMAQ-v1p0''' and '''GEOSChem-v45'''.
+
* [https://sites.google.com/site/geosspilot2/air-quality-and-health-working-group/aq-use-case-2-deploy-component--service/install-datafed-netcdf-ogc-wcs Implementation of netCDF Server at Northrop Grumman]
  
If you used other folder than '''C:\OWS''' you need to edit '''C:\OWS\web\static\HTAP\HTAP_config.py''' and change the variable '''netcdf_root_folder''' to point the correct directory.
+
== Put your own data online ==
  
If you have the WCS running, you can now try this [http://localhost:8080/HTAP?service=WCS&version=1.1.0&Request=GetCoverage&identifier=GEMAQ-v1p0&BoundingBox=260,32,280,48,urn:ogc:def:crs:OGC:2:84&TimeSequence=2001-01-01T12:00:00Z&RangeSubset=fieldSubset:vmr_no2&format=image/netcdf&store=true test query] from your own machine.
+
* [[WCS_Wrapper_Configuration| WCS Wrapper Configuration]]: Common information about the server
 +
* [[WCS_Wrapper_Configuration_for_Point_Data]]: How to serve SQL-based point data.
 +
* [[WCS_Wrapper_Configuration_for_Cubes]]: How to serve NetCDF-CF based cube data.
  
The server returns the same short XML document, which contains a link into the query result.
+
== Running high traffic sites with IIS ==
  
== The Human Interface: Create the index.html Front Pages for Visitors. ==
+
These instructions are based on [http://webpy.org/cookbook/iis7_iis6_windows_pyisapie Deploying web.py on IIS7 via PyISAPIe]
  
If no query is present, the server gives a default page '''index.html'''. You should provide pages for your server and for all the providers.
+
=== Hack around a bug ===
  
The server index.html is at '''C:\OWS\web\static\index.html''', which will be displayed from url http://localhost:8080/, Index of an  external server index.html [http://128.252.167.125:8080/is here].  
+
Unfortunately webpy has a slight problem. You need to edit C:\Python26\Lib\site-packages\web\wsgi.py and add '''return False'''  
 +
to '''_is_dev_mode''' function. Make it look exactly like
  
Every provider folder should also have an index.html like  '''C:\OWS\web\static\testprovider\index.html''' which will be displayed from http://localhost:8080/testprovider, index of an external provider front page is [http://128.252.167.125:8080/HTAP here]
+
    def _is_dev_mode():
 +
        return False
  
If you modify the default '''index.html'', make sure '''not to overwrite''' it next time you upgrade the WCS Wrapper package. Keep the main copy elsewhere and copy it back.
+
With 4 space indentation as in the source code and case sensitive '''False'''
  
== Running in the background ==
+
=== Create New Application Pool ===
  
This executable is meant to be a test server for developers. Therefore it does not support running as a service. Leaving your workstation on all the time is possible, but then you will have the server window open all the time, which maybe is nice for monitoring, but usually quite annoying.
+
Go to IIS management console, and create a new Application pool.  
  
But you can run any command line program in the background.
+
* In 64 bit machines allow 32 bit applications.
 +
* Disable rapid-fail protection.
 +
* In IIS7
 +
** Disable managed code, no .NET version
 +
** Classic pipeline
 +
** Create a new local user like OWS_RUNNER, and assign the applicationpool to run under that username. Do not make it power user or administrator, just a user is enough.
 +
Give the user read/execute permissions under C:\OWS and additional write permissions under C:\OWS\web\static
  
First, consider creating a new local user like WCS_RUNNER. This user requires with administrative privileges. It should not, but it seems that [http://support.microsoft.com/kb/223375 it is required] in Windows XP and earlier. Those who know better, please inform the author. Go to ''Control panel / Administrative Tools / Computer management / Local Users and Groups''. Add a new user, add '''administrators''' to groups and make password non-expiring, not changeable.
+
=== Create OWS Website ===
  
Go to control panel and open "Scheduled Tasks".
+
* New website, name it OWS
 +
* port 8080 or something unique, anyway not the standard 80, which will interfere with existing stuff.
 +
* Site path something like C:\OWS\web so that ''static'' folder is directly under it.
 +
* Permissions: Read, Run Scripts, Execute
 +
* If the installation is to another directory than C:\OWS, edit the OWS\web\web.config file, change the PyISAPIe.dll path to yours.
 +
* If a provider starts with /S, add it to the OWS\web\web.config file. Providers with other letters are configured automatically with wildcards.
 +
* Edit OWS\web\config.py and change '''log_webpy_to_file = True''' for enabling logging via IIS
  
* Click on "add scheduled task."
+
== Significant changes since version 1.2 ==
  
* pick C:\OWS\web\ows.py as the executable.
+
* Unix and Windows code base have been unified.  
  
* Check "When my computer starts" as the scheduling"
+
* filtering by any dimension works now. You can choose pressure or wavelength.
  
* Choose a proper user name. The user needs to be an Administrator.
+
* Performance for querying large cubes as improved.
  
* Check box "open advanced properties..."
+
* Query Caching was implemented: Identical queries will return the same temporary file.
  
Change the properties:
+
== Significant changes since version 1.1 ==
  
* The default port is 8080. On the task tab, add port number to the program C:\OWS\web\ows.py 8081
+
* Tested with activestate python 2.6.5.14 and 2.6.5.15, Earlier versions of python 2.6 may work.
  
* on settings tab, check off the "Stop the task if ..." box
+
* Unix and Windows style newlines bug is still present.
  
You can now start the task and end it from the "Scheduled tasks" form.
+
* Bug fixes to xml documents
  
Notice, that if you choose your own username, you'll see the window when you log on. This is kind of nice, since the window will display incoming queries.  
+
* added optional wcs_capabilities.conf files for wcs metadata.
  
* [https://sites.google.com/site/geosspilot2/air-quality-and-health-working-group/aq-use-case-2-deploy-component--service/install-datafed-netcdf-ogc-wcs Implementation of netCDF Server at Northrop Grumman]
+
Finally we have xml schemas that actually work. 1.1.1 and 1.1.2 documents can be validated properly. This also exposed a huge number of wrong names ans namespaces in the capabilities and describecoverage documents. If you have code that used to read 1.1.0 xml, it needs to be updated.
  
 
== Significant changes since version 1.0 ==
 
== Significant changes since version 1.0 ==
Line 244: Line 359:
  
 
Some filters returned incorrect results. One good reason to upgrade.
 
Some filters returned incorrect results. One good reason to upgrade.
 +
 +
== Moved from WCS Server for CF (GEO-AQ-CoP==
 +
* These two services are in the same computer: htap.icg.kfa-juelich.de. The two completely different services are created just putting the netcdf files to folders HTAP_FC_pressure and MACC_bnds. They are just ordinary folders: the folder name is used as service name. http://geo-aq-cop.org/node/1316/
 +
* The HTAP_FC_pressure GetCapabilities contains plenty of coverages. For example GISS-PUCCINI-modelEaer_FC3SA_metm comes simply from the file GISS-PUCCINI-modelEaer_FC3SA_metm.nc which is in the HTAP_FC_pressure folder. One of the data variables is cnvflxup(time,lev,lat,lon) and that becomes automatically a field.

Latest revision as of 12:29, October 12, 2012

Back to WCS Wrapper

Project on SourceForge

Questions and comments should go to sourceforge discussions, bug reports to sourceforge tickets. Urgent issues can be asked from Kari Hoijarvi 314-935-6099(w) or 314-843-6436(h)

Last updated 2010-12-13

Install as Administrator

This installation requires admin rights. After installation, you can switch to a user account.

Things to Consider About Security

The web.py framework and WCS service code has been written with security in mind, and there are no known security bugs. There is no code that writes on the disk, so running this service should not put your computer in danger.

To maximize the security of your computer, consider the following.

  • Every file in every directory you put under C:\OWS\web\static becomes readable by anybody. This is by design, since the whole framework is meant to publish public data. Do not put confidential information under OWS folder!
  • Windows Vista and later: Don't run this process with administrative rights. Create a low-rights account like WCS_RUNNER and use that.
  • Under Windows XP, the WCS_RUNNER account requires administrative privileges. It should not, but it seems that it is required. Those who know better, please inform the author. Go to Control panel / Administrative Tools / Computer management / Local Users and Groups. Add a new user, add administrators to groups and make password non-expiring, not changeable.

Get Python 2.6.6

Attention. Activestate download is not available, so download from official site or wait that we support python 2.7

We recommend latest python 2.6.6 from [http://www.activestate.com/activepython/downloads ActiveState Python download pa ge] or ActiveState Direct Download or you can download from official site but activepython contains some goodies, like very nice language sensitive editor PythonWin.

Since the C and C++ dll's are 32 bit, get a 32 bit python even if you have 64 bit machine. If requested, we will support 64 bit binaries too.

Get the Datafed WCS Wrapper

If you have modified the default OWS/web/static/index.html, make sure not to overwrite' it. Keep the main copy elsewhere and copy it back.

Open the download page in another tab.

If you are serving cubes from NetCDF files, get win32-ows-1.3.1.zip or later. This distribution contains point data support also. If you are serving only point data, you can just download ows-point-1.3.1.zip.

   ows-point-1.3.1.zip = (win32-ows-1.3.1.zip) - (netcdf support) + (sample point provider)

Unzip it/both into your installation folder C:\OWS. You can install to other folders, this is just used as an example.

You will to have directories C:\OWS\datafed and C:\OWS\web

The folder datafed contains datafed package, which contains tools for ISO 8601 time parsing and python-NetCDF module nc3 (not in point). Web is the WCS framework.

Notice:

Linux is using PyNIO for NetCDF access from python. Since PyNIO is not supported under Windows, a subset datafed/minio, was developed for windows. Using C based libraries enables delivering large amounts of data efficiently. Python is used only for query parsing, making minimal impact in speed.

Although the built-in webserver is intended mainly for development, you can use it to serve data from your own workstation just fine. For high load sites, look webpy.org/install documentation how to integrate webpy with apache server etc.

Get 3rd Party Components

Download win32-3rdparty-1.2.0.zip.

Unzip the file. You'll see

  • runtime
  • web.py-0.33
  • activepython.txt
  • install_webpy.bat
  • lxml-2.2.4.win32-py2.6.exe
  • numpy-1.4.1-win32-superpack-python2.6.exe
  • OWS version 1.3.x

Installing: all the files are in the 3rd party bundle, you don't need to go to web during installation.

  • OWS version 1.3.x is just marking the version of this distribution.
  • Copy all the files from runtime to C:\OWS\datafed. The NetCDF is not an unofficial build, so do not replace your old NetCDF dll's with it. (Not required in point)
  • activepython.txt is already done.
  • Install webpy Webpy favicon.png Run batch file install_webpy.bat, it will print about two pages informational messages. There should be no warnings or errors. webpy home
  • Install lxml by running the setup program lxml-2.2.4.win32-py2.6.exe, use default answer for everything. The lxml package is already in version 2.2.6, but the windows builds are not ready. lxml home download page direct download link


Disclaimer: (Not required in point) The C:\OWS\datafed\netcdf.dll is a custom compiled from Unidata favicon.png netcdf-4.1.2-beta1 and all the documented library calls are not be present. The bundled ncgen.exe and ncdump.exe are compiled for this purpose, nctest.exe is not there. It's heavily unit tested under datafed OWS framework, for other purposes use with caution.


The datafed folder also contains utilities ncdump.exe and ncgen.exe Especially ncdump is very useful when creating or inspecting netcdf files. The page UNIDATA NetCDF docs has more information about these utilities. Main installation page may be useful too.

Configure Firewall PYTHONPATH

Since your computer is probably running a firewall, and if it isn't it should, it's necessary to allow python to act as a server for incoming connections. For Windows firewall on XP:

  • Open Control panel/Windows Firewall
  • Exceptions tab
  • Add Program...
  • "Python Interactive Shell" or browse for C:\python26\python.exe
  • Hit OK

Make sure that C:\OWS and C:\OWS\web are in your PYTHONPATH variable. Create it via Control Panel / System / Advanced / Environment Variables. Pythonpath looks just like PATH.

Run command prompt, start / run, "cmd.exe". Type "SET PYTHONPATH". If you see PYTHONPATH=C:\OWS;C:\OWS\web you're OK.

Start the Server

To see your IP address, type

   C:\OWS\web>ipconfig
   Windows IP Configuration
   Ethernet adapter Local Area Connection:
       Connection-specific DNS Suffix  . : gateway.2wire.net
       IP Address. . . . . . . . . . . . : 192.168.1.65
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.1.254

Your public IP address is 192.168.1.65

Change Directory to C:\OWS\web folder and type python ows.py. You have now your server running, listening port 8080.

You can pass the port as parameter. python ows.py 80 listens the standard port 80.

Open http://localhost:8080 and you should see the home page. Congratulations if you got this far. Now we need to install some data to serve. replace localhost with your IP address.

If the server won't start, try to set the path explicit (Not required in point):

   set path=C:\OWS\datafed;%PATH%

to make sure, that correct versions of NetCDF and HDF dynamic link libraries are used.

Putting your data into CF Compatible NetCDF Files

(Not required in point) This is for getting the demo run only, more detailed instructions on how to serve cube and point data is documented at WCS Wrapper Configuration How to use the wrapper libraries can be found in related page Creating NetCDF-CF Files.

Setting up the demo dataset:

C:\OWS\web\static\testprovider\ contains files:

  • CubeA.ncml is a NetCDF Markup Language description of the test coverage, same for teh rest of the .ncml files. The .nc files are files that are created from using the ncml as instructions.
  • create_all.py is a script that creates the empty cube files and then fills it with test data. It servers as an example code how to create your own CF 1.0 compatible files. It has no user interface, just run it.

So do the following:

   cd C:\OWS\web\static\testprovider
   create_all

activepython registers python.exe as default program for .py files, so you don't need to say python CubeA.py

Now you have data to serve.

Extract metadata from the NetCDF Files

Change directory to and issue command

   cd C:\OWS\web
   owsadmin wcs_prepare -ao

This program extracts the metadata from the netcdf files. Each provider will get a 'metadata.dat' giving fast access to coverages, fields and dimensionality.

The WCS Service is now ready.

Test Your WCS server

GetCapabilities query for NetCDF: http://localhost:8080/testprovider?service=WCS&acceptversions=1.1.2&Request=GetCapabilities or from the external server

GetCapabilities query for point: http://localhost:8080/point?service=WCS&acceptversions=1.1.2&Request=GetCapabilities or from the external server


DescribeCoverage query for NetCDF: http://localhost:8080/testprovider?service=WCS&version=1.1.2&Request=DescribeCoverage&identifiers=CubeA or from the external server

DescribeCoverage query for point: http://localhost:8080/point?service=WCS&version=1.1.2&Request=DescribeCoverage&identifiers=SURF_MET or from the external server


GetCoverage query for NetCDF: http://localhost:8080/testprovider?service=WCS&version=1.1.2&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=true or from the external server

GetCoverage query for point http://localhost:8080/point?service=WCS&request=getCoverage&version=1.1.2&identifier=SURF_MET&BoundingBox=-130,24,-50,40,urn:ogc:def:crs:OGC:2:84&TimeSequence=2009-09-01T15:00:00&RangeSubset=TEMP&format=text/csv&store=true external server

Sections of the WCS url:

  • http://your_domain_or_ip_address:8080 is the server url. It returns a static index.html page of providers using this server.
  • testprovider is the provider name. There must be a folder C:\OWS\web\static\testprovider\.
  • for NetCDF:
    • &identifier=CubeA is the name of the NetCDF file. So in this example, C:\OWS\web\static\testprovider\ contains file CubeA.nc and it becomes a coverage.
    • RangeSubset=* selects variables to be returned from the NetCFD, '*' gets all, &RangeSubset=Spam;Eggs gets variables Spam and Eggs.
    • &format=image/netcdf&store=true specifies, that the result will be a NetCDF file that is stored in the server and can later be fetched via from an url. These are now the only supported options.
  • for point:
    • Coverage is often a database and RangeSubset selects a value column. This is not necessarily so, since configuring SQL is much more flexible than configuring NetCDF

The wcs GetCoverage returns an Xml envelope

<?xml version="1.0" encoding="UTF-8"?>
<Coverages xmlns="http://www.opengis.net/wcs/1.1" 
        xmlns:ows11="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
    <Coverage>
        <ows11:Title>Select * From CubeA</ows11:Title>
        <ows11:Abstract>Where boundingbox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84 and timesequence=2007-01-01</ows11:Abstract>
        <ows11:Identifier>CubeA</ows11:Identifier>
        <ows11:Reference xlink:href="http://localhost:8080/static/cache/CubeA_1.nc" xlink:role="urn:ogc:def:role:WCS:1.1:coverage"/>
    </Coverage>
</Coverages>

The request writes out a NetCDF file C:\OWS\web\static\cache\CubeA_1.nc and so it can be retrieved later with url http://localhost:8080/static/cache/CubeA_1.nc and it will be deleted in ten minutes. The number after coverage is a generated sequence number.

In short:

  • Every folder under static becomes a provider. Providers are unrelated. There can be any number of providers.
  • Every NetCDF file in the provider folder becomes a coverage. The WCS Capabilities document is automatically compiled from all the NetCDF files.
  • Every variable inside NetCDF becomes a field

GetCoverage query with store=false

for NetCDF: http://128.252.202.19:8080/testprovider?service=WCS&version=1.1.2&Request=GetCoverage&identifier=CubeA&BoundingBox=-180,-90,180,90,urn:ogc:def:crs:OGC:2:84&TimeSequence=2007-01-01&RangeSubset=*&format=image/netcdf&store=false

for point http://128.252.202.19:8080/point?service=WCS&request=getCoverage&version=1.1.2&identifier=SURF_MET&BoundingBox=-130,24,-50,40,urn:ogc:def:crs:OGC:2:84&TimeSequence=2009-09-01T15:00:00&RangeSubset=TEMP&format=text/csv&store=false

These queries return both the xml envelope and cube file bundled together in mime-multipart format.

All the browsers don't work with this. Firefox can open it, Internet Explorer can't.

Stopping the Server

Press ctrl+C to terminate the server, or if you are running as a scheduled task, end the task. This is a development web server, there is no shutdown command.

Running in the background

This executable is meant to be a test server for developers. Therefore it does not support running as a service. Leaving your workstation on all the time is possible, but then you will have the server window open all the time, which maybe is nice for monitoring, but usually quite annoying.

But you can run any command line program in the background.

Go to control panel and open "Scheduled Tasks".

  • Click on "add scheduled task."
  • Pick C:\OWS\web\ows.py as the executable.
  • Check "When my computer starts" as the scheduling"
  • Choose a proper user name. With Windows XP and earlier the user needs to be an Administrator.
  • Check box "open advanced properties..."

Change the properties:

  • The default port is 8080. On the task tab, add port number to the program C:\OWS\web\ows.py 8081
  • On settings tab, check off the "Stop the task if ..." box

You can now start the task and end it from the "Scheduled tasks" form.

Notice, that if you choose your own username, you'll see the window when you log on. This is kind of nice, since the window will display incoming queries.

Put your own data online

Running high traffic sites with IIS

These instructions are based on Deploying web.py on IIS7 via PyISAPIe

Hack around a bug

Unfortunately webpy has a slight problem. You need to edit C:\Python26\Lib\site-packages\web\wsgi.py and add return False to _is_dev_mode function. Make it look exactly like

   def _is_dev_mode():
       return False

With 4 space indentation as in the source code and case sensitive False

Create New Application Pool

Go to IIS management console, and create a new Application pool.

  • In 64 bit machines allow 32 bit applications.
  • Disable rapid-fail protection.
  • In IIS7
    • Disable managed code, no .NET version
    • Classic pipeline
    • Create a new local user like OWS_RUNNER, and assign the applicationpool to run under that username. Do not make it power user or administrator, just a user is enough.

Give the user read/execute permissions under C:\OWS and additional write permissions under C:\OWS\web\static

Create OWS Website

  • New website, name it OWS
  • port 8080 or something unique, anyway not the standard 80, which will interfere with existing stuff.
  • Site path something like C:\OWS\web so that static folder is directly under it.
  • Permissions: Read, Run Scripts, Execute
  • If the installation is to another directory than C:\OWS, edit the OWS\web\web.config file, change the PyISAPIe.dll path to yours.
  • If a provider starts with /S, add it to the OWS\web\web.config file. Providers with other letters are configured automatically with wildcards.
  • Edit OWS\web\config.py and change log_webpy_to_file = True for enabling logging via IIS

Significant changes since version 1.2

  • Unix and Windows code base have been unified.
  • filtering by any dimension works now. You can choose pressure or wavelength.
  • Performance for querying large cubes as improved.
  • Query Caching was implemented: Identical queries will return the same temporary file.

Significant changes since version 1.1

  • Tested with activestate python 2.6.5.14 and 2.6.5.15, Earlier versions of python 2.6 may work.
  • Unix and Windows style newlines bug is still present.
  • Bug fixes to xml documents
  • added optional wcs_capabilities.conf files for wcs metadata.

Finally we have xml schemas that actually work. 1.1.1 and 1.1.2 documents can be validated properly. This also exposed a huge number of wrong names ans namespaces in the capabilities and describecoverage documents. If you have code that used to read 1.1.0 xml, it needs to be updated.

Significant changes since version 1.0

  • Python version

python 2.5 will not work for you, use 2.6

  • Unix and Windows style newlines.

With python 2.5, webpy development server required, that text files have Unix-style end of line marker, plain LF and not the Windows convention CR-LF. This was a bug deep in python libraries, and is fixed in 2.6.

The owsadmin.py script still supports turning files to unix and windows convention.

python C:\OWS\web\owsadmin.py unix_nl "C:\OWS\web\static\testprovider\index.html"
  • errorneous "fieldsubset:" prefix

The WCS query used to have fieldsubset: prefix, this was incorrect and is fixed. It also means, that old queries that used fieldsubsets won't work anymore. Update your links.

  • Bug fixes to queries

Some filters returned incorrect results. One good reason to upgrade.

Moved from WCS Server for CF (GEO-AQ-CoP

  • These two services are in the same computer: htap.icg.kfa-juelich.de. The two completely different services are created just putting the netcdf files to folders HTAP_FC_pressure and MACC_bnds. They are just ordinary folders: the folder name is used as service name. http://geo-aq-cop.org/node/1316/
  • The HTAP_FC_pressure GetCapabilities contains plenty of coverages. For example GISS-PUCCINI-modelEaer_FC3SA_metm comes simply from the file GISS-PUCCINI-modelEaer_FC3SA_metm.nc which is in the HTAP_FC_pressure folder. One of the data variables is cnvflxup(time,lev,lat,lon) and that becomes automatically a field.