We have a geoprocessing service that takes a point feature layer, runs some calculation steps, and output a line feature layer. The input and output feature layers both need to have z values. The service was published from a python script tool.
When we run the GP service as a web tool in Pro, it all works fine, generates a line feature that has z values.
However, when we run the GP service on REST endpoint (or by JS API) using the same input, the output feature layer does NOT have Z. The REST page of the GPservice also shows that output parameter hasZ=False.
We tried to explicitly set arcpy.env.outputZFlag = 'enabled' in the script, and setting the output parameter environment setting in the toolbox, but none of them worked. The output parameter is still not Z-aware.
Does anyone have an idea on how to solve this issue? Thanks in advance!
Updates: We've solved the parameter hasZ=false problem - by changing the parameter type in the toolbox from a Feature Set to a Feature Layer and republish the tool.
Problem is, even with parameter hasZ=true and returnZ set to true when submitting a job, the result returned from REST endpoint still shows no Z value.
Hi Evelyn,
I encountered the same issue as you did: the result of my geoprocessing service from the REST endpoint also does not include a Z value. Have you found any workaround for this issue by any chance?
Apologies for the late reply! We ended up reworking the whole workflow, by generating the result in a file gdb and uploading the whole gdb to portal to create a hosted feature layer, just so that the output feature layer preserves Z values.