ESRI's Viewshed GP task: how is it done?

276
1
07-26-2018 07:49 PM
MichalGasparovic
New Contributor III

Hi,

we are in a need of generating the VS polygons and have found this example
Geoprocessing - viewshed analysis | ArcGIS API for JavaScript 4.8 

which is great, though we are struggling to replicate the server side geoprocessing tool.

If we use out of the box viewshed 2 task, (as viewshed doesn't accept the distance), it takes nearly 3minutes (probably busy generating the TIF, but also, the grid is much more detailed (0.5m) for a point and 1km distance, whereas in the sample, it takes only 3secs.

Additionally, I can see that the model is returning the GPFeatureRecordSetLayer, which json, where as the viewshed 2 task generates only raster. Is this raster additionally converted to features?

Thank you for any insight on how we could improve on this.

With regards,

M

0 Kudos
1 Reply
SrinivasaRao
New Contributor II

Dear Michal,

I am also looking for the Viewshed analysis solution using ArcGIS Javascript API. For your problem you can convert your raster Tiff output to vector polygon using Raster to Polygon toolbox.

Following steps/tools, we have followed

We have published Viewshed2 as a GP service and consumed it in our portal.

Inputs:
Observer feature
In raster - presently we have hardcoded with existing DSM (do you know how to pass this as a parameter)
Observer elevation
Inner radius
Outer radius
Horizontal start angle
Horizontal end angle
Vertical lower angle
Vertical upper angle

Tools used:
Viewshed2
Buffer
Add Field
Raster to Polygon

 

Thanks and Regards,

S.Srinivasa Rao,

Ph: 9322251303.

0 Kudos