Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test usage of PAVICS WPS from ArcGIS and QGIS #1

Open
huard opened this issue Jan 22, 2018 · 6 comments
Open

Test usage of PAVICS WPS from ArcGIS and QGIS #1

huard opened this issue Jan 22, 2018 · 6 comments
Assignees

Comments

@huard
Copy link
Contributor

huard commented Jan 22, 2018

Test whether it is possible to import WPS processes into GIS software (ArcGIS, QGIS)

  • Issue bug reports for what does not work
  • Document what does work in this repo
@tlogan2000
Copy link
Contributor

tlogan2000 commented Jan 31, 2018

# ArcGIS WPS functionality
Test 1 - WPS client for ArcGIS - Unsuccessful to date (31/01/2018)
https://wiki.52north.org/Geoprocessing/ExtensibleClient

  • Successful installation of client and connection to PAVICS wps services
  • WPS (flying pigeon) algorithms appear as a 'toolbox' in ArcGIS menu
  • Unable to open any tool (e.g. subset_bbox or other) to enter parameters and execute
  • Importing of tools in graphical 'Model Builder' equally results in an error

Test 2 - Custom ArcGIS Python tools using owslib - Generally successful (31/01/2018)
Overview : Create custom python scripts for PAVICS wps functionality via owslib (e.g. Catalogue - Search or FlyingPigeon - subset_bbox). Python scripts are then integrated as ArcGIS Tools with GUI for input/output parameters. Tools can be chained together using Model Builder.

Requires creation of individual scripts/tools that call wps functions.
Successful creation of python script / arcgis toolboxes for simple wps processes:

  • Catalog 'search' using 'constraints'
  • FlyingPigeon subset_bbox to subset netCDF files

Successful integration of tools into the arcGIS Model Builder & execution of workflow (nb* 2 tools only to date)
image

  • Catalogue search tool connects to wps and searches for .nc files with options for 4 constraints (Project, Variable, Frequency, Model). Produces an output .csv of urls to .nc files
    image

  • Subset bounding box tool accepts output .csv of netCDF urls and performs a subset of each .nc file. Subset bounding box can be entered manually or can be defined by a GIS layer open in ArcMap. Results in second url list of subsetted .nc files.

image

Notes:
Requirements for successful implementation in Test 2 cases (NB* Windows only as ArcGIS is only available for Win):
specific version of pytz package : pytz-2017.3-py2.7 : https://pypi.python.org/pypi/pytz
installation of Microsoft Visual C++ Compiler for Python 2.7 : https://www.microsoft.com/en-ca/download/confirmation.aspx?id=44266

@huard
Copy link
Contributor Author

huard commented Jan 31, 2018

Excellent, thanks for the report !

@tlogan2000 tlogan2000 reopened this Jan 31, 2018
@tlogan2000
Copy link
Contributor

I closed this apparently.... Reopened as is a work in progress. Haven't touched QGIS at all yet

@Zeitsperre
Copy link
Contributor

I'm still in the learning phase for WPS, but I'm tackling this next week.

@Zeitsperre
Copy link
Contributor

WPS-Client Plugin for QGIS - Limited Use

  • Installed from QGIS Plugin Manager successfully
  • Configures easily and is able to see the listing of WPS capabilities
  • Prompt allows users to run processes using local NetCDFs

wps-client

Errors/Limitations

  • No integration possible between WPS-Client and Toolbox functions: WPS Client is completely standalone and can't be added via a graphical modeler.
  • Since QGIS can only handle one variable per layer, the method that QGIS uses to read NetCDF files prompts users to choose which variable they wish to load from NetCDF (e.g. tasmin, tasmax, pr, time_vector) and appends "NETCDF:" to the beginning and ":varname" to the end of the NetCDF location. This causes an error when uploading files via WPS-Client as the filename cannot be found in the file structure.

wps-ncerror

Looking around on the net, PyQGIS/PyWPS scripts should easily integrate into the QGIS Processing Toolbox. Looking at scripts from @tlogan2000 to see if they'll work now.

Tested on Ubuntu 16.04 LTS with QGIS 2.18.16 and WPS-Client 2.1.6.

@Zeitsperre
Copy link
Contributor

Zeitsperre commented Feb 7, 2018

Additional Notes

  • Successfully launched the "Subset" function using inputs from @bstdenis
    ('resource', '.../thredds/dodsC/birdhouse/ouranos/cb-oura-1.0/NorESM1-M/rcp85/day/tasmin/tasmin_day_NorESM1-M_rcp85_r1i1p1_na10kgrid_qm-moving-50bins-detrend_2100.nc'), ('typename', 'ADMINBOUNDARIES:Regions adminstratives - Quebec'), ('featureids', 'Regions adminstratives - Quebec.15'), ('geoserver', 'http://.../geoserver/wfs')
  • Returns the json file address that can act as an input for other algorithms.

wps_subset

It's not pretty but it seems to work. Looking into PyQGIS/PyWPS this week or next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants