Select to view content in your preferred language

California wildfires 2017 - Thomas Fire analysis

1000
3
01-11-2021 03:23 AM
KrishV
by
Frequent Contributor

Hi All,

 

I'm trying to use the sample -  California wildfires 2017 - Thomas Fire analysis on my AOI and  I'm able to extract the burnt areas as shown below:

KrishV_0-1610364046164.png

 

But when trying to save it, I'm getting below error:

 

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-28-f2cc7de7a07e> in <module>
----> 1 persisted_fire_output = burnt_areas.save()

/opt/conda/lib/python3.6/site-packages/arcgis/raster/_layer.py in save(self, output_name, for_viz, process_as_multidimensional, build_transpose, gis, future, **kwargs)
   3458                         gr_output = _save_ra(self._fnra,output_name=output_name, other_outputs=self._other_outputs, gis=g,future=future,  **kwargs)
   3459                     else:
-> 3460                         gr_output = generate_raster(self._fnra, output_name=output_name, process_as_multidimensional=process_as_multidimensional, build_transpose=build_transpose, gis=g, future=future, **kwargs)
   3461                 except Exception:
   3462                     if layer_extent_set:

/opt/conda/lib/python3.6/site-packages/arcgis/raster/analytics.py in generate_raster(raster_function, function_arguments, output_raster_properties, output_name, process_as_multidimensional, build_transpose, context, gis, future, **kwargs)
    844                                                      context=context,
    845                                                      future=future,
--> 846                                                      **kwargs)
    847 
    848 def convert_feature_to_raster(input_feature,

/opt/conda/lib/python3.6/site-packages/arcgis/_impl/tools.py in generate_raster(self, raster_function, function_arguments, output_raster_properties, output_name, context, future, **kwargs)
   7514                                           function_arguments=function_arguments,
   7515                                           output_raster_properties=output_raster_properties,
-> 7516                                           context=context, gis=self._gis, future=True)
   7517         gpjob._is_ra = True
   7518         gpjob._item_properties = True

<string> in generate_raster(raster_function, output_name, function_arguments, output_raster_properties, context, gis, future)

/opt/conda/lib/python3.6/site-packages/arcgis/geoprocessing/_support.py in _execute_gp_tool(gis, task_name, params, param_db, return_values, use_async, url, webtool, add_token, return_messages, future)
    388                 job_info = gptool._con.post(submit_url, gp_params)
    389         else:
--> 390             job_info = gptool._con.post(submit_url, gp_params)
    391         job_id = job_info['jobId']
    392         if future:

/opt/conda/lib/python3.6/site-packages/arcgis/gis/_impl/_con/_connection.py in post(self, path, params, files, **kwargs)
    708                                      file_name=file_name,
    709                                      try_json=try_json,
--> 710                                      force_bytes=kwargs.pop('force_bytes', False))
    711     #----------------------------------------------------------------------
    712     def put(self, url, params=None, files=None, **kwargs):

/opt/conda/lib/python3.6/site-packages/arcgis/gis/_impl/_con/_connection.py in _handle_response(self, resp, file_name, out_path, try_json, force_bytes)
    495                     raise Exception(resp['error'])
    496             else:
--> 497                 data = resp.json()
    498             #if 'error' in data:
    499                 #raise Exception(data['error'])

/opt/conda/lib/python3.6/site-packages/requests/models.py in json(self, **kwargs)
    896                     # used.
    897                     pass
--> 898         return complexjson.loads(self.text, **kwargs)
    899 
    900     @property

/opt/conda/lib/python3.6/site-packages/simplejson/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, use_decimal, **kw)
    523             parse_constant is None and object_pairs_hook is None
    524             and not use_decimal and not kw):
--> 525         return _default_decoder.decode(s)
    526     if cls is None:
    527         cls = JSONDecoder

/opt/conda/lib/python3.6/site-packages/simplejson/decoder.py in decode(self, s, _w, _PY3)
    368         if _PY3 and isinstance(s, bytes):
    369             s = str(s, self.encoding)
--> 370         obj, end = self.raw_decode(s)
    371         end = _w(s, end).end()
    372         if end != len(s):

/opt/conda/lib/python3.6/site-packages/simplejson/decoder.py in raw_decode(self, s, idx, _w, _PY3)
    398             elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
    399                 idx += 3
--> 400         return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

Any idea on how to fix this error?

 @RohitSingh2 

Thanks,

Krish

0 Kudos
3 Replies
by Anonymous User
Not applicable

Hi @KrishV , 

Looks like submit job REST request to the Raster Analysis server is failing. Can you kindly make sure that the Raster Analysis server is up and running and that you can manually access the RasterAnalysis REST end point e.g.  https://xxxxxx.xxx.com/server/rest/services/System/RasterAnalysisTools/GPServer/GenerateRaster 

If that's running, could you check for the Image server (Raster Analysis Server) version and let me know so I could try reproducing this error on a similar setup at my end. 

Thanks,

@PriyankaTuteja 

0 Kudos
KrishV
by
Frequent Contributor

Hi @Anonymous User ,

 

Thanks for your response! 🙂

I have checked the RasterAnalysis REST end point and it is running.

I'm using ArcGIS Image Server 10.8.1

 

Thanks,

Krish

0 Kudos
PriyankaTuteja
Esri Contributor

Hi @KrishV ,

We have an enterprise 10.8.1 set up, credentials:

gis = GIS(url='https://pythonapi.playground.esri.com/portal', username='arcgis_python', password='amazing_arcgis_123')

I have tried running this notebook using the above credentials and the cell

persisted_fire_output = burnt_areas.save()

worked for me. See the screenshot below:

PriyankaTuteja_2-1614150446857.png

 

I wonder what's wrong with your portal. Could you try using your credentials with verify_cert=False and see if it works.

 

gis = GIS(url='url', username='name', password='***', verify_cert=False)

 

Regards,

Priyanka

 

0 Kudos