-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from bird-house/add_geospatial
Add geospatial process and GIS pip recipe
- Loading branch information
Showing
28 changed files
with
149 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "olympus_mons", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ "type": "Feature", "properties": { "id": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 133.821082132244499, -182.172079007781065 ], [ 119.87448803812417, -187.178548682593487 ], [ 117.371253200717959, -200.052327846396878 ], [ 121.304907945213429, -211.138082126338645 ], [ 137.754736876739969, -211.495687103110981 ], [ 147.767676226364813, -206.131612451526223 ], [ 146.337256319275525, -188.608968589682775 ], [ 133.821082132244499, -182.172079007781065 ] ] ] ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
""" | ||
Process using an application/geo+json and 'image/tiff; application=geotiff' output. Used to test UI interactions. | ||
Author: Trevor James Smith | ||
""" | ||
from pathlib import Path | ||
from pywps import Process, ComplexOutput | ||
from pywps import FORMATS | ||
import logging | ||
|
||
|
||
LOGGER = logging.getLogger("PYWPS") | ||
|
||
__all__ = ["GeoData"] | ||
|
||
DATA_DIR = Path(__file__).parent.parent.joinpath('data') | ||
|
||
|
||
class GeoData(Process): | ||
def __init__(self): | ||
inputs = list() | ||
outputs = [ | ||
ComplexOutput( | ||
"raster", | ||
"DEM of region in GeoTIFF format.", | ||
abstract="Elevation data for Olympus Martian region in byte range.", | ||
as_reference=True, | ||
supported_formats=[FORMATS.GEOTIFF], | ||
), | ||
ComplexOutput( | ||
"vector", | ||
"Region definition in GeoJSON format", | ||
abstract="Rough vector polygon of the Olympus Mons plateau.", | ||
as_reference=True, | ||
supported_formats=[FORMATS.GEOJSON], | ||
), | ||
] | ||
|
||
super(GeoData, self).__init__( | ||
self._handler, | ||
identifier="geodata", | ||
title="deliver vector and raster data", | ||
abstract="Return an example raster and vector dataset", | ||
version="1.0", | ||
inputs=inputs, | ||
outputs=outputs, | ||
store_supported=True, | ||
status_supported=True, | ||
) | ||
|
||
@staticmethod | ||
def _handler(request, response): | ||
response.update_status("PyWPS Process started.", 0) | ||
|
||
response.outputs['vector'].file = DATA_DIR / "Olympus_Mons.geojson" | ||
|
||
response.outputs['raster'].file = DATA_DIR / "Olympus.tif" | ||
|
||
response.update_status("PyWPS Process completed.", 100) | ||
|
||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ channels: | |
- conda-forge | ||
- defaults | ||
dependencies: | ||
- pywps>=4.2.7 | ||
- pywps=4.4.0 | ||
- sphinx | ||
- nbsphinx | ||
- ipython |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pywps>=4.2.6<4.3 | ||
pywps>=4.4.0 | ||
jinja2 | ||
click | ||
psutil | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pywps import Service | ||
from pywps.tests import assert_response_success | ||
from emu.processes.wps_geodata import GeoData | ||
from .common import client_for, CFG_FILE, get_output | ||
|
||
|
||
class TestGeoData: | ||
def test_wps_geodata(self): | ||
|
||
client = client_for(Service(processes=[GeoData()], cfgfiles=CFG_FILE)) | ||
|
||
resp = client.get( | ||
service='wps', request='execute', version='1.0.0', | ||
identifier='geodata', asobj=True) | ||
|
||
assert_response_success(resp) | ||
assert set(get_output(resp.xml).keys()) == {"vector", "raster"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import pytest | ||
import os | ||
from pywps import Service | ||
from pywps.tests import assert_response_success | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.