AnsweredAssumed Answered

From a FeatureSet to FeatureLayer for Overlay analysis

Question asked by greta.carrete_eowilson on Jun 12, 2019
Latest reply on Sep 20, 2019 by n_jaku01_wwu

Hello,

 

I am trying to use the analysis tool overlay_layers. Because my dataset is so large I am querying it so I have two FeatureSets. This tool requires FeatureLayers so I am using the information from here to have feature collections but when I run the overlay tool I get an error. 

Many thanks to any feedback

 

Here is my code:

#checking I have FeatureCollections 
type(fc1)
arcgis.features.feature.FeatureCollection

type(fc2)
arcgis.features.feature.FeatureCollection

#Running the analysis
overlay_rf = overlay_layers(input_layer=fc1, overlay_layer=fc2, overlay_type='Intersect')

And here is the error I get:

---------------------------------------------------------------------------JSONDecodeError                           Traceback (most recent call last)<ipython-input-30-4a4a1668cec5> in <module>----> 1 overlay_rf_subfacet = overlay_layers(input_layer=wdpa_fc, overlay_layer=facet_fc, overlay_type='Intersect')~/anaconda3/lib/python3.7/site-packages/arcgis/features/manage_data.py in overlay_layers(input_layer, overlay_layer, overlay_type, snap_to_input, output_type, tolerance, output_name, context, gis, estimate)    191         output_name,    192         context,--> 193         estimate=estimate)    194     195 def create_route_layers( ~/anaconda3/lib/python3.7/site-packages/arcgis/_impl/tools.py in overlay_layers(self, input_layer, overlay_layer, overlay_type, snap_to_input, output_type, tolerance, output_name, context, estimate)   1529    1530 -> 1531         task_url, job_info, job_id = super()._analysis_job(task, params)   1532    1533         job_info = super()._analysis_job_status(task_url, job_info)~/anaconda3/lib/python3.7/site-packages/arcgis/_impl/tools.py in _analysis_job(self, task, params)    143         params["f"] = "json"    144 --> 145         resp = self._con.post(submit_url, params, token=self._token)    146         #print(resp)    147         return task_url, resp, resp['jobId']~/anaconda3/lib/python3.7/site-packages/arcgis/_impl/connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)   1141             resp_json = json.loads(resp_data, object_pairs_hook=OrderedDict)   1142         else:-> 1143             resp_json = json.loads(resp_data)   1144    1145  ~/anaconda3/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)    346             parse_int is None and parse_float is None and    347             parse_constant is None and object_pairs_hook is None and not kw):--> 348         return _default_decoder.decode(s)    349     if cls is None:    350         cls = JSONDecoder ~/anaconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)    335     336         """--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())    338         end = _w(s, end).end()    339         if end != len(s):~/anaconda3/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)    353             obj, end = self.scan_once(s, idx)    354         except StopIteration as err:--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None    356         return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Outcomes