Skip to content

Commit cb5af69

Browse files
committed
Adjust PyWPS configuration to pycsw (geopython#67)
1 parent fff0431 commit cb5af69

File tree

7 files changed

+233
-228
lines changed

7 files changed

+233
-228
lines changed

default-sample.cfg

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[server]
2+
encoding=utf-8
3+
language=en-US
4+
url=http://localhost/wps
5+
maxoperations=30
6+
maxinputparamlength=1024
7+
maxsingleinputsize=
8+
maxrequestsize=3mb
9+
temp_path=/tmp/pywps/
10+
processes_path=
11+
outputurl=/data/
12+
outputpath=/tmp/outputs/
13+
logfile=
14+
loglevel=INFO
15+
logdatabase=
16+
workdir=
17+
18+
[metadata:main]
19+
identification_title=PyWPS Processing Service
20+
identification_abstract=PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
21+
identification_keywords=PyWPS,WPS,OGC,processing
22+
identification_keywords_type=theme
23+
identification_fees=NONE
24+
identification_accessconstraints=NONE
25+
provider_name=Organization Name
26+
provider_url=http://pywps.org/
27+
contact_name=Lastname, Firstname
28+
contact_position=Position Title
29+
contact_address=Mailing Address
30+
contact_city=City
31+
contact_stateorprovince=Administrative Area
32+
contact_postalcode=Zip or Postal Code
33+
contact_country=Country
34+
contact_phone=+xx-xxx-xxx-xxxx
35+
contact_fax=+xx-xxx-xxx-xxxx
36+
contact_email=Email Address
37+
contact_url=Contact URL
38+
contact_hours=Hours of Service
39+
contact_instructions=During hours of service. Off on weekends.
40+
contact_role=pointOfContact

docs/configuration.rst

+80-104
Original file line numberDiff line numberDiff line change
@@ -2,127 +2,103 @@
22
Configuration
33
=============
44

5-
PyWPS is configured busing configuration file. The file uses
5+
PyWPS is configured using a configuration file. The file uses
66
`ConfigParser <https://wiki.python.org/moin/ConfigParserExamples>`_ format. The
77
file can be stored anywhere or can be set using `PYWPS_CFG` environment
88
variable.
99

10-
.. note:: Compatibility with PyWPS 3.x: minor changes are just in the `server`
11-
section. Rest of the configuration file should work as is.
10+
.. versionadded:: 4.0.0
11+
.. warning:: Compatibility with PyWPS 3.x: major changes have been made
12+
to the config file in order to allow for shared configurations with pycsw
13+
and other projects.
1214

13-
The configuration file has 3 sections:
15+
The configuration file has 2 sections.
1416

15-
**wps**
16-
The `wps` section is related to the standard. Some necessary
17-
attributes are needed, namely:
17+
PyWPS ships with a sample configuration (``default-sample.cfg``). Copy the file to ``default.cfg`` and edit the following:
1818

19-
**title**
20-
title of the WPS service
21-
**abstract**
22-
abstract of the server
23-
**fees**
24-
usually set to `None`
25-
**contactraints**
26-
set to `None` as well
27-
**serveraddress**
28-
full address to WPS endpoint, like `http://localhost/wps`
29-
**serverport**
30-
port, usually set to 80 or just omitted
31-
**keywords**
32-
list of keywords of the service
19+
**[server]**
3320

34-
**provider**
35-
The `provider` section is related to service provider details:
21+
- **url**: the URL of the resulting service
22+
- **language**: the ISO 639-1 language and ISO 3166-1 alpha2 country code of the service (e.g. ``en-CA``, ``fr-CA``, ``en-US``)
23+
- **encoding**: the content type encoding (e.g. ``ISO-8859-1``, see https://docs.python.org/2/library/codecs.html#standard-encodings). Default value is 'UTF-8'
24+
- **loglevel**: the logging level (see http://docs.python.org/library/logging.html#logging-levels)
25+
- **logfile**: the full file path to the logfile
26+
- **maxoperations**: maximum number of parallel running operations
27+
- **logdatabase**: SQLite3 file, where the login about requests/responses will be provided. You can set this to `":memory:"` for having the database in memory
28+
- **maxrequestsize**: maximal request size. 0 for no limit
29+
- **workdir**: temporary directory for all temporary files (which should be always deleted, once the process is finished
30+
- **outputpath**: server path for storing output files
31+
- **outputurl**: corresponding URL
3632

37-
**providerName**
38-
name of the institution hosting WPS service
39-
**individualName**
40-
your name
41-
**positionName**
42-
your position
43-
**role**
44-
your role
45-
**deliveryPoint**
46-
street, address
47-
**city**
48-
city
49-
**postalCode**
50-
postal code
51-
**country**
52-
country
53-
**electronicMailAddress**
54-
e-mail
55-
**providerSite**
56-
URL of your homepage
57-
**phoneVoice**
58-
phone number
59-
**phoneFacsimile**
60-
fax
61-
**administrativeArea**
62-
...
63-
**hoursofservice**
64-
hours of service
65-
**contactinstructions**
66-
any detailed instructions
33+
.. note:: `outputpath` and `outputurl` must corespond
6734

68-
**server**
69-
the `server` section is related to instance of the WPS server
35+
**[metadata:main]**
7036

71-
**maxparaleloperations**
72-
maximum number of parallel running operations
73-
**logdatabase**
74-
sqlite3 file, where the login about requests/responses will be provided. You can set this to `":memory:"` for having the database in memory
75-
**maxrequestsize**
76-
maximal request size. 0 for no limit
77-
**workdir**
78-
temporary directory for all temporary files (which should be always deleted, once the process is finished
79-
**outputPath**
80-
server path for storing output files
81-
**outputUrl**
82-
corresponding URL
83-
**logfile**
84-
alternative file name to write all outputs to
85-
**loglevel**
86-
log level according to `logging module <https://docs.python.org/3/library/logging.html#logging-levels>`_
87-
88-
.. note:: `outputPath` and `outputUrl` must corespond
37+
- **identification_title**: the title of the service
38+
- **identification_abstract**: some descriptive text about the service
39+
- **identification_keywords**: comma delimited list of keywords about the service
40+
- **identification_keywords_type**: keyword type as per the `ISO 19115 MD_KeywordTypeCode codelist <http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode>`_). Accepted values are ``discipline``, ``temporal``, ``place``, ``theme``, ``stratum``
41+
- **identification_fees**: fees associated with the service
42+
- **identification_accessconstraints**: access constraints associated with the service
43+
- **provider_name**: the name of the service provider
44+
- **provider_url**: the URL of the service provider
45+
- **contact_name**: the name of the provider contact
46+
- **contact_position**: the position title of the provider contact
47+
- **contact_address**: the address of the provider contact
48+
- **contact_city**: the city of the provider contact
49+
- **contact_stateorprovince**: the province or territory of the provider contact
50+
- **contact_postalcode**: the postal code of the provider contact
51+
- **contact_country**: the country of the provider contact
52+
- **contact_phone**: the phone number of the provider contact
53+
- **contact_fax**: the facsimile number of the provider contact
54+
- **contact_email**: the email address of the provider contact
55+
- **contact_url**: the URL to more information about the provider contact
56+
- **contact_hours**: the hours of service to contact the provider
57+
- **contact_instructions**: the how to contact the provider contact
58+
- **contact_role**: the role of the provider contact as per the `ISO 19115 CI_RoleCode codelist <http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode>`_). Accepted values are ``author``, ``processor``, ``publisher``, ``custodian``, ``pointOfContact``, ``distributor``, ``user``, ``resourceProvider``, ``originator``, ``owner``, ``principalInvestigator``
8959

9060
-----------
9161
Sample file
9262
-----------
9363
::
9464

95-
[wps]
96-
title=PyWPS 4 Server
97-
abstract=See https://github.com/jachym/pywps-4 and http://www.opengeospatial.org/standards/wps
98-
fees=NONE
99-
constraints=NONE
100-
serveraddress=http://localhost:5000/wps
101-
serverport=5000
102-
keywords=GRASS,GIS,WPS
103-
lang=en-US
104-
105-
[provider]
106-
providerName=Organisation
107-
individualName=My Name
108-
positionName=Intern
109-
role=Developer
110-
deliveryPoint=Street
111-
city=Belval
112-
postalCode=000 00
113-
country=LU
114-
115-
providerSite=http://foo.bar
116-
phoneVoice=False
117-
phoneFacsimile=False
118-
administrativeArea=False
119-
hoursofservice=00:00-24:00
120-
contactinstructions=NONE
121-
12265
[server]
66+
encoding=utf-8
67+
language=en-US
68+
url=http://localhost/wps
12369
maxoperations=30
70+
maxinputparamlength=1024
71+
maxsingleinputsize=
12472
maxrequestsize=3mb
125-
workdir=/tmp/pywps/
126-
outputUrl=/data/
127-
outputPath=/tmp/outputs/
128-
logdatabase=/var/www/wps/wpsserver.db
73+
temp_path=/tmp/pywps/
74+
processes_path=
75+
outputurl=/data/
76+
outputpath=/tmp/outputs/
77+
logfile=
78+
loglevel=INFO
79+
logdatabase=
80+
workdir=
81+
82+
[metadata:main]
83+
identification_title=PyWPS Processing Service
84+
identification_abstract=PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
85+
identification_keywords=PyWPS,WPS,OGC,processing
86+
identification_keywords_type=theme
87+
identification_fees=NONE
88+
identification_accessconstraints=NONE
89+
provider_name=Organization Name
90+
provider_url=http://pywps.org/
91+
contact_name=Lastname, Firstname
92+
contact_position=Position Title
93+
contact_address=Mailing Address
94+
contact_city=City
95+
contact_stateorprovince=Administrative Area
96+
contact_postalcode=Zip or Postal Code
97+
contact_country=Country
98+
contact_phone=+xx-xxx-xxx-xxxx
99+
contact_fax=+xx-xxx-xxx-xxxx
100+
contact_email=Email Address
101+
contact_url=Contact URL
102+
contact_hours=Hours of Service
103+
contact_instructions=During hours of service. Off on weekends.
104+
contact_role=pointOfContact

pywps/app/Process.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ def execute(self, wps_request, uuid):
118118
if self.store_supported != 'true':
119119
raise StorageNotSupported('Process does not support the storing of the execute response')
120120

121-
file_path = config.get_config_value('server', 'outputPath')
122-
file_url = '%s:%s%s' % (
123-
config.get_config_value('wps', 'serveraddress'),
124-
config.get_config_value('wps', 'serverport'),
125-
config.get_config_value('server', 'outputUrl')
121+
file_path = config.get_config_value('server', 'outputpath')
122+
file_url = '%s%s' % (
123+
config.get_config_value('server', 'url'),
124+
config.get_config_value('server', 'outputurl')
126125
)
127126

128127
self.status_location = os.path.join(file_path, self.uuid) + '.xml'

0 commit comments

Comments
 (0)