AnsweredAssumed Answered

Unable to display FeatureSet in Map Widget

Question asked by dwaipayana23 on Sep 24, 2018
Latest reply on Sep 24, 2018 by dwaipayana23

Hi all,

I am trying to display a FeatureSet (arcgis.features.FeatureSet) object on the ArcGIS API for Python map widget ( in Jupyter Notebook. 


I have two FeatureSet objects:

  • obtained while querying a layer (query_resp_from_x)
  • constructed from arcgis.features.Feature objects (feature_set)


This is the code I am using to create the feature_set object:


from arcgis.features import Feature, FeatureSet, FeatureCollection

attributes = [{'FID':1, 'some_field':'some_val', ...}, {'FID':2, 'some_field':'some_val', ...}, ...]

features_from_geom = [{"paths": [[...]]}, {"paths": [[...]]}, ...]

# len(attributes) = len(features_from_geom) = 5

features = list()
counter = len(attributes)
for idx in range(counter):
    features.append(Feature(geometry=features_from_geom[idx], attributes=attributes[idx]))

# here, query_resp_from_x is just a query response from layer X, which in itself is a FeatureSet

feature_set = FeatureSet(


Then, I created a map widget in the same notebook and added both the FeatureSet objects to it:


from arcgis.gis import GIS

gis_obj = GIS('http://my_portal', 'my_user')
map_obj =


The map displayed only the query response FeatureSet (query_resp_from_x). Neither the FeatureSet I constructed (feature_set) was displayed, not an exception was raised.


I tried adding some rendering information to the FeatureSet and construct a FeatureCollection from it and display it on map, to no avail.


Can someone tell me what is wrong with this approach?


(P.S.: I converted both the FeatureSet objects (feature_set and query_resp_from_x) and compared them. They were exactly the same except for changes in values. I am attaching both the dict objects as JSON files for your reference.)