Skip to content

Instantly share code, notes, and snippets.

@enolfc
Last active June 21, 2018 11:45
Show Gist options
  • Save enolfc/1c95eece6cb8870bc8bb4b7d1cc388a8 to your computer and use it in GitHub Desktop.
Save enolfc/1c95eece6cb8870bc8bb4b7d1cc388a8 to your computer and use it in GitHub Desktop.
Sample call to DataMiner using WPS
import os
import logging
# initialize logging, otherwise you'll not see debug output.
logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)
from owslib.wps import WebProcessingService, ComplexDataInput, monitorExecution
dataminer_url = 'http://dataminer.garr.d4science.org/wps/WebProcessingService'
headers = {'gcube-token': os.environ['GCUBE_TOKEN']}
wps = WebProcessingService(dataminer_url, headers=headers)
processid = 'org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_GEO_CHART'
inputs = [
('InputTable',
ComplexDataInput('http://data.d4science.org/dCt1K2V4TmZkOUNnbSs4U053dE9SZXNjYnJGTWYyZWlHbWJQNStIS0N6Yz0', mimeType="text/xml")),
('Longitude', 'decimalLongitude'),
('Latitude', 'decimalLatitude'),
('Quantities', 'Quantities'),
('Time', 'eventDate'),
]
execution = wps.execute(processid, inputs, output="non_deterministic_output")
from owslib.wps import monitorExecution
monitorExecution(execution, sleepSecs=40, download=True)
print(execution.status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment