Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5027

Wrapping command-line applications

$
0
0

Wrappers is my word; maybe there's a better one. I mean a CLI call like:

SpatialJoin_analysis (target_features, join_features, out_feature_class, {join_operation}, {join_type}, {field_mapping}, {match_option}, {search_radius}, {distance_field_name})

[arcpy spatial join code]

Could be "wrapped" so that it could be used from an API with a series of required and optional parameters.

In php, you'd do something like:

$result = ['result' => (shell_exec(python -c "import arcpy; arcpy.SpatialJoin_analysis($var1, $var2, $var3, '$var4')"))];
return $result;

Obviously, this is a silly example because DF now supports python, but that's the idea.

Creating a wrapper would involve wrapping all or a subset of the commandline features of an application as a dreamfactory endpoint and providing a swagger file. Of course, to use the wrapper you'd have to have the target application installed on the machine or provide configuration for the endpoint.

Given some samples, people could "wrap" any local application with a CLI. These could go into a library, much like the current DF connections.

Does this seem like a reasonable undertaking?


Viewing all articles
Browse latest Browse all 5027

Trending Articles