<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Viewshed GP Tool in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433327#M1334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the Viewshed GPTool in Runtime.&amp;nbsp; I ran the tool successfully in Catalog and packaged it for Runtime, trying to run it with the same data is throwing an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I spun up the service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LocalGeoprocessingService _viewshedGPService = new LocalGeoprocessingService(_packageFolder + "/Viewshed.gpk");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_viewshedGPService.setServiceType(GPServiceType.SubmitJob);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_viewshedGPService.startAsync();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then setup the parameters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; List&amp;lt;GPParameter&amp;gt; parameters = new ArrayList&amp;lt;GPParameter&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPString in_raster = new GPString("in_raster");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_raster.setValue(*full path to a .dt1 file*);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(in_raster);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPString in_observer_features = new GPString("in_observer_features");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_observer_features.setValue("/full/path/to/Observers.gdb/Observers");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(in_observer_features);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPRasterDataLayer out_raster = new GPRasterDataLayer("out_raster");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(out_raster);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;GeoProcessor _gpViewshed = new GeoProcessor(_viewshedGPService.getUrl() + "/Viewshed");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPJobResource gpJobResource = _gpViewshed.submitJob(parameters);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String jobID = gpJobResource.getJobID();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to get the job's status using gp.checkJobStatus(jobID) I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Job failed!com.esri.core.io.EsriServiceException: Unable to complete operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error executing tool.: ERROR 000816: The tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what this error means, my underlying data should be valid since it worked in catalog.&amp;nbsp; I am not sure if there is a general problem with the parameters I used, or if the tool works in Runtime yet.&amp;nbsp; My license level is Advanced.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on what might cause this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Aug 2011 19:07:43 GMT</pubDate>
    <dc:creator>MatthewKnight</dc:creator>
    <dc:date>2011-08-15T19:07:43Z</dc:date>
    <item>
      <title>Viewshed GP Tool</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433327#M1334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the Viewshed GPTool in Runtime.&amp;nbsp; I ran the tool successfully in Catalog and packaged it for Runtime, trying to run it with the same data is throwing an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I spun up the service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LocalGeoprocessingService _viewshedGPService = new LocalGeoprocessingService(_packageFolder + "/Viewshed.gpk");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_viewshedGPService.setServiceType(GPServiceType.SubmitJob);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_viewshedGPService.startAsync();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then setup the parameters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; List&amp;lt;GPParameter&amp;gt; parameters = new ArrayList&amp;lt;GPParameter&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPString in_raster = new GPString("in_raster");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_raster.setValue(*full path to a .dt1 file*);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(in_raster);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPString in_observer_features = new GPString("in_observer_features");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_observer_features.setValue("/full/path/to/Observers.gdb/Observers");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(in_observer_features);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPRasterDataLayer out_raster = new GPRasterDataLayer("out_raster");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.add(out_raster);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;GeoProcessor _gpViewshed = new GeoProcessor(_viewshedGPService.getUrl() + "/Viewshed");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GPJobResource gpJobResource = _gpViewshed.submitJob(parameters);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String jobID = gpJobResource.getJobID();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to get the job's status using gp.checkJobStatus(jobID) I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Job failed!com.esri.core.io.EsriServiceException: Unable to complete operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error executing tool.: ERROR 000816: The tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what this error means, my underlying data should be valid since it worked in catalog.&amp;nbsp; I am not sure if there is a general problem with the parameters I used, or if the tool works in Runtime yet.&amp;nbsp; My license level is Advanced.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on what might cause this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 19:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433327#M1334</guid>
      <dc:creator>MatthewKnight</dc:creator>
      <dc:date>2011-08-15T19:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Viewshed GP Tool</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433328#M1335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure exactly how you've set up your Geoprocessing model, but I'm surprised to see the raster layer as an input as that would usually be intermediate data given the likely size of the data. This leads me to wonder if you're trying to run the viewshed system tool as-is without including it in a model?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would expect the inputs of your model to be, for example, a point feature set for the input location (GPFeatureRecordSetLayer) and a linear unit value for the distance (GPLinearUnit). Typically in a Viewshed GP model which is then going to be published/shared as a package or service, the linear unit value is used in conjunction with the point feature set as the inputs to a buffer tool with the output from the buffer then being used to clip the raster on which the viewshed is finally run. You can also expose other parameters such as observer height.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example this service on SampleServer1 demonstrates the inputs and outputs I would expect to see: &lt;/SPAN&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additionally, in beta 1 we do not support raster data as a tool input but do hope to support this in beta 2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 07:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433328#M1335</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2011-08-16T07:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Viewshed GP Tool</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433329#M1336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cool, I did not know about that service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I submit my parameters I get back "java.lang.IllegalArgumentException: Invalid or unsupported wkid: 54003".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My input point is WGS84 (wkid 4326), I called both setProcessSR on the GeoProcessor and setSpatialReference on the input GPFeatureRecordSetLayer to set those spatial references as well, but it looks like at some point it's still trying to go to the default SR of 54003 which Runtime I guess does not currently support?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; Fixed it, I wasn't setting the outSR on the GeoProcessor to WGS84.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 14:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/viewshed-gp-tool/m-p/433329#M1336</guid>
      <dc:creator>MatthewKnight</dc:creator>
      <dc:date>2011-08-16T14:14:57Z</dc:date>
    </item>
  </channel>
</rss>

