[Gdal-dev] no file

Frank Warmerdam warmerdam at pobox.com
Tue Mar 31 12:02:11 EDT 2009


mjollnir wrote:
> 
> 
> You can run the PNG encoder to a memory buffer "virtual file" using the
> mechanism described at:
> 
>    http://www.gdal.org/cpl__vsi_8h.html#66e2e6f093fd42f8a941b962d4c8a19e
> 
> Then you would send the contents of the memory buffer off to the socket.
> 
> In theory you could also write a special file handler allowing you to
> stream it directly to the socket without an intermediate memory buffer but
> that would be very involved.
> 
> I like the second idea, would you please give me a clue

/me sighs.

Is there some reason you feel that would be a much better solution?   Are your
png encoded results going to be very large?

I'm not willing to spend a lot of time trying to explain how to do the
second approach, but I will point you to ~/gdal/port/cpl_vsi_mem.cpp as
an example of a custom file handler implemention (the one for in-memory
virtual files).  You can try to work it out from that.

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



More information about the gdal-dev mailing list