In ArcPy, I want to use JSONToFeatures_conversion, but I'm working with data that I pulled from a web service. I have no need to save the data to disk. So, I thought I could do something like this:
fd = StringIO.StringIO(<my JSON string>) arcpy.JSONToFeatures_conversion(fd, 'in_memory\\output')
arcpy definitely doesn't like that though. I'm considering using the tempfile module, but that's not an ideal solution for this. Temp files aren't really a good solution for this because of a few factors, from environmental constraints (permissions in some of the environments where it may run) to the size of the datasets (IO overhead).
fs = arcpy.FeatureSet() fs.load(<url to service>)
Isn't exactly ideal either because the dataset is composed of data from a couple sources, with different attributes that have to be reconciled.
Ultimately, the product of this operation will be passed in to arcpy.SelectLayerByLocation_management as the select_features parameter
Environment: ArcGIS 10.x (multiple machines running slightly different versions, but none of it's ArcPro, hence all Python2 not Python3)