Hello everybody. I have some problems with st_aspng and st_asraster. I would try to generate a raster image from a vector polygon and view this with a php script. Following the example in the postgis documentation:
SELECT ST_AsPNG(ST_AsRaster(ST_Buffer(ST_Point(1,5),10),150, 150, '2BUI')); this generate a binary sequence (blob) but when I try to view it in a web browser I obtain the follow error message Warning: imagecreatefromstring() [function.imagecreatefromstring]: Data is not in a recognized format This is my script: header('Content-Type: image/png'); $query_finale="SELECT ST_AsPNG(ST_AsRaster(ST_Buffer(ST_Point(1,5),10),10, 10, '2BUI'));" $finale_result_raster=pg_query($conn,$query_finale); $final_result= pg_query($conn,$query_finale); $img_raster=pg_fetch_array($final_result); $immagine=$img_raster['immagine']; imagepng($immagine); does anyone know why it doesn't work? Thanks!!! Francesco
_______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users