arcgis...FeatureSet != arcpy...FeatureSet

1539
4
03-15-2018 07:31 AM
JoshuaBixby
MVP Esteemed Contributor

Just a heads up/warning to ArcPy users, primarily, that arcgis.features.feature.FeatureSet does not equal arcpy.arcobjects.arcobjects.FeatureSet, and trying to use one in place of the other will generate errors all over the place.  Silly me assumed that the ArcGIS API for Python team would at least make the two interoperable.

4 Replies
RohitSingh2
Esri Contributor

ArcPy and ArcGIS API for Python are two different packages that deal with related things. It would be unreasonable to expect to use classes from one package in place of those from another. Regarding interoperability, you could use FeatureSet.df and write it to a feature class, and load it unisg arcpy and get an arcpy FeatureSet.

JoshuaBixby
MVP Esteemed Contributor

I have to disagree with you on reasonableness.

  • For one, we are not talking about a class/object name that is the same in Python and JavaScript or Python and C#.  Crossing a language threshold is a big threshold, people know they are using a different language and expect differences even if the name is the same.
  • Secondly, we are not talking about a class/object name that is the same between Esri and Shapely or Esri and GeoDjango.  Crossing a company/organization threshold is also a big threshold, and as great as interoperability would be if the name is the same, it isn't expected.
  • Additionally, the ArcPy FeatureSet and ArcGIS API for Python API FeatureSet are designed to send & receive data to and from Esri GIS server products, so the purpose of the class/object is very similar, if not the same.
  • And finally, ArcPy and ArcGIS API for Python are both bundled and installed with ArcGIS Pro.

Same name, same language, same company, similar purpose, and packaged together with ArcGIS Pro.  Given those five factors, I do not think it is unreasonable to expect some level of interoperability.  Clearly the ArcGIS API for Python development team feels differently, but now I know where to set my expectations when working with the product.

TedKowal
Regular Contributor II

I do not believe it is unreasonable to expect a consistent "Definition" of a FeatureSet and all language abide by that consistent definition.  An apple may be an apple in VB.net but you have to treat it like an Orange in Python......  In all other areas in the programming world I FULLY expect an object or class to return a a class/object that could be used in the same manner in any language or package.  That is a reasonable expectation!

RohitSingh2
Esri Contributor

ArcPy and ArcGIS API for Python are in two different namespaces. The fully qualified name is not the same. Import statements can be used to resolve the differences - that's what they are for.