4

I need to develop a webportal which will display the images generated by a GIS software package. I my development I need to run gdal command inside php exec() function. but I don't know how to do this.

dakcarto
7,79428 silver badges34 bronze badges
asked May 28, 2012 at 6:45
1

1 Answer 1

6

it works under PHP 4, PHP 5. beside this you can use passthru command too.. passthru command execute an external program and display raw output.

exec — Execute an external program

Description

string exec ( string $command [, array &$output [, int &$return_var ]] )

exec() executes the given command.

there is an example here. but they are complaining that it works a bit slow.

<?php
// gdal_translate converts GIS data
// in this case, simply copy a GeoTIFF with no transforms
$command = 'gdal_translate /tmp/in.tif /tmp/out.tif';
$t0 = microtime(true);
exec($command);
$t1 = microtime(true);
printf("%.1f seconds", $t1 - $t0);
?>

i hope it helps you...

answered May 28, 2012 at 7:11
1
  • 2
    @Mehedi - Please mark this as accepted if it indeed solved your problem. Commented Jun 1, 2012 at 14:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.