Skip to content

Commit

Permalink
v2.1.1 - update xyz.py
Browse files Browse the repository at this point in the history
  • Loading branch information
idanmiara committed Jan 27, 2021
1 parent 414dfb7 commit af50514
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.1.1
10 changes: 7 additions & 3 deletions processes/io_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,14 @@ def fake_raster(defaults):
]


def skip_ndv(defaults):
def skip_src_dst_nodata(defaults):
return [
LiteralInputD(defaults, 'skip_ndv', 'skip NoData values', data_type='boolean', min_occurs=1, max_occurs=1,
default=True),
LiteralInputD(defaults, 'skip_nodata', 'skip NoData values',
data_type='boolean', min_occurs=1, max_occurs=1, default=True),
LiteralInputD(defaults, 'src_nodata', 'override source NoData values',
data_type='float', min_occurs=0, max_occurs=1),
LiteralInputD(defaults, 'dst_nodata', 'replace source NoData values with the given destination NoData values',
data_type='float', min_occurs=0, max_occurs=1),
]


Expand Down
2 changes: 1 addition & 1 deletion processes/trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _handler(self, request, response: ExecuteResponse):
output_filename = tempfile.mktemp(suffix=ext)
raster_filename = process_helper.get_request_data(request.inputs, 'r')
if of == 'xyz':
gdal2xyz(raster_filename, output_filename, skip_no_data=True)
gdal2xyz(raster_filename, output_filename, skip_nodata=True)
else:
gdalos_trans(raster_filename, of=of, out_filename=output_filename)

Expand Down
9 changes: 6 additions & 3 deletions processes/xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):

inputs = \
iog.raster_input(defaults) + \
iog.skip_ndv(defaults)
iog.skip_src_dst_nodata(defaults)

outputs = iog.output_r() + \
iog.output_value(['x', 'y', 'z'])
Expand All @@ -40,8 +40,11 @@ def __init__(self):

def _handler(self, request, response: ExecuteResponse):
raster_filename = process_helper.get_request_data(request.inputs, 'r')
skip_ndv = request.inputs['skip_ndv'][0].data
x, y, z = gdal2xyz(raster_filename, None, return_np_arrays=True, skip_no_data=skip_ndv)
skip_nodata = process_helper.get_request_data(request.inputs, 'skip_nodata')
src_nodata = process_helper.get_request_data(request.inputs, 'src_nodata')
dst_nodata = process_helper.get_request_data(request.inputs, 'dst_nodata')
x, y, z = gdal2xyz(raster_filename, None, return_np_arrays=True,
skip_nodata=skip_nodata, src_nodata=src_nodata, dst_nodata=dst_nodata)

response.outputs['r'].data = raster_filename

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ numpy<=1.19.3
pywps-json>=4.2.9.6
czml3>=0.5.4
gdalos>=0.50.0
gdal-utils>=3.3.0.4
gdal>=3.0.0

0 comments on commit af50514

Please sign in to comment.