I have got console app that get parameters to start and then output result of calculation.
Example (from docs):
gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370
177502 311865
In step-by step mode it's work like:
gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370[press enter]- I input from keyboard:
177502 311865[press enter] - it's print on screen new coordinates:
244296.723070577 165937.350438393 1.60975147597492
I need to call it's from D, pass input parametrs, and handle it's output.
It's seems that I need use pipeShell for it, but I can't understand how to use it.
Here is my code:
import std.stdio;
import std.process;
import std.file;
void main()
{
auto pipes = pipeProcess(["gdaltransform", " -s_srs epsg:4326 -t_srs EPSG:3857"], Redirect.stdout);
scope(exit) wait(pipes.pid);
}
But how to read of gdaltransform output to variable and then terminate app?