Select to view content in your preferred language

Possible to pass Stream instead of file to Geoprocessing tools?

366
2
Jump to solution
12-13-2022 06:12 AM
DanielRatzlaff
New Contributor III

My add-in downloads zipped GeoJSON files and imports them with JSON to Features.  It would be handy to be able to pass a Stream (System.IO.Compression.ZipArchiveEntry.Open()) to the archived file instead of extracting the file to disk before importing.  Is this possible at all?

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

The tool documentation only shows 'File' as valid input.  JSON To Features (Conversion)—ArcGIS Pro | Documentation

This enhancement has to be implemented by the GP Tool (or GP Tools since i can imagine that this feature would be useful across many tools), so i would suggest to either add this to ArcGIS Pro Ideas - Esri Community or upvote the item if it's already there.   

For the time being you still have to stream into a temporary .json file and pass that to the tool.

View solution in original post

0 Kudos
2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

The tool documentation only shows 'File' as valid input.  JSON To Features (Conversion)—ArcGIS Pro | Documentation

This enhancement has to be implemented by the GP Tool (or GP Tools since i can imagine that this feature would be useful across many tools), so i would suggest to either add this to ArcGIS Pro Ideas - Esri Community or upvote the item if it's already there.   

For the time being you still have to stream into a temporary .json file and pass that to the tool.

0 Kudos
DanielRatzlaff
New Contributor III

Thanks, Wolf.  I thought as much.  I did submit an Idea on the board.  If I'm understanding how the GP tools work, they seem to be fairly tightly coupled to Python, so to implement this feature might be tricky (translating the Stream to a structure Python understands) but if implemented it might work across all GP tools.  We'll see how it goes.  In the meantime, I'll just do what I can do.