[mapserver-users] Export geotiff Mapserver

Pavel Iacovlev iacovlev.pavel at gmail.com
Thu Aug 6 11:00:48 EDT 2009


Hi Frank, djutopie,

We discussed this on IRC some time ago, and PHPMapscript saveImage
method does not have that "2nd" parameter to pass the map file.

   int saveImage(string filename)
        Writes image object to specifed filename.
        Passing an empty filename sends output to stdout.  In this case,
        the PHP header() function should be used to set the documents's
        content-type prior to calling saveImage().
        The output format is the one that is currently selected in the
        map file.
        The function returns -1 on error.  On success, it returns either 0
        if writing to an external file, or the number of bytes written if
        output is sent to stdout.

My work ground was to create the .tfw file for the tif manually,
http://pastie.org/574127 here is the PHP class.

On Thu, Aug 6, 2009 at 5:41 PM, Frank Warmerdam<warmerdam at pobox.com> wrote:
> djutopie wrote:
>>
>> Hello everyone,
>>
>> I'm trying to export a map with geotiff layers but when
>> i'm doing it the geotiff file doesn't keep tags and
>> real values of the geotiff..
>>
>> Is there a way to do it right?
>>
>> My code before to export (mapscript php) :
>>
>>        $map->outputformat->set("driver","GDAL/GTIFF");
>>        $map->outputformat->set("imagemode","BYTE");
>>        $map->outputformat->set("mimetype","image/tiff");
>>        $map->outputformat->set("extension","tif");
>>
>> Thanks ;)
>
> Djutopie,
>
> In C the msSaveImage() function includes a "mapObj" argument that may
> be NULL.  It is necessary to pass in the map in order for SaveImage to
> write georeferencing information to a geotiff file.  So the issue isn't
> so much the outputformat setup (which looks fine) as it is how SaveImage
> is called.  I'm uncertain if the map argument can be passed from PHP
> mapscript
> or not.
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
http://iap.md, The future is open


More information about the mapserver-users mailing list