I'd like to create an image based on raster output I'm building from a PostgreSQL spatial database.
I have a query:
SELECT (
ST_AsPNG(
ST_AsRaster(
geom, 1.5::double precision, 2::double precision, 11, 11, '8BUI', 100, 0, 0, 0, false
)
)
) AS "png" FROM "geom" AS "g" LIMIT 1
When I dump the returned result, I get:
resource(83) of type (stream)
I've tried many combinations of using PHP's built-in functions of working with images, but can't seem to get anywhere in actually drawing the polygon. I always get an issue with 'invalid resource type supplied' or similar.
There seems to be no helpful documentation available - could anyone guide me in the right direction?
Technologies in use:
Postgis 2
Postgres 9