Skip to content

Commit af50514

Browse files
committed
v2.1.1 - update xyz.py
1 parent 414dfb7 commit af50514

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
2.1.1

processes/io_generator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,14 @@ def fake_raster(defaults):
273273
]
274274

275275

276-
def skip_ndv(defaults):
276+
def skip_src_dst_nodata(defaults):
277277
return [
278-
LiteralInputD(defaults, 'skip_ndv', 'skip NoData values', data_type='boolean', min_occurs=1, max_occurs=1,
279-
default=True),
278+
LiteralInputD(defaults, 'skip_nodata', 'skip NoData values',
279+
data_type='boolean', min_occurs=1, max_occurs=1, default=True),
280+
LiteralInputD(defaults, 'src_nodata', 'override source NoData values',
281+
data_type='float', min_occurs=0, max_occurs=1),
282+
LiteralInputD(defaults, 'dst_nodata', 'replace source NoData values with the given destination NoData values',
283+
data_type='float', min_occurs=0, max_occurs=1),
280284
]
281285

282286

processes/trans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _handler(self, request, response: ExecuteResponse):
4343
output_filename = tempfile.mktemp(suffix=ext)
4444
raster_filename = process_helper.get_request_data(request.inputs, 'r')
4545
if of == 'xyz':
46-
gdal2xyz(raster_filename, output_filename, skip_no_data=True)
46+
gdal2xyz(raster_filename, output_filename, skip_nodata=True)
4747
else:
4848
gdalos_trans(raster_filename, of=of, out_filename=output_filename)
4949

processes/xyz.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self):
1919

2020
inputs = \
2121
iog.raster_input(defaults) + \
22-
iog.skip_ndv(defaults)
22+
iog.skip_src_dst_nodata(defaults)
2323

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

4141
def _handler(self, request, response: ExecuteResponse):
4242
raster_filename = process_helper.get_request_data(request.inputs, 'r')
43-
skip_ndv = request.inputs['skip_ndv'][0].data
44-
x, y, z = gdal2xyz(raster_filename, None, return_np_arrays=True, skip_no_data=skip_ndv)
43+
skip_nodata = process_helper.get_request_data(request.inputs, 'skip_nodata')
44+
src_nodata = process_helper.get_request_data(request.inputs, 'src_nodata')
45+
dst_nodata = process_helper.get_request_data(request.inputs, 'dst_nodata')
46+
x, y, z = gdal2xyz(raster_filename, None, return_np_arrays=True,
47+
skip_nodata=skip_nodata, src_nodata=src_nodata, dst_nodata=dst_nodata)
4548

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

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ numpy<=1.19.3
1414
pywps-json>=4.2.9.6
1515
czml3>=0.5.4
1616
gdalos>=0.50.0
17+
gdal-utils>=3.3.0.4
1718
gdal>=3.0.0

0 commit comments

Comments
 (0)