Tuesday, 8 August 2017

postgis - ST_AsRaster for polygon


Having a hard time to get a raster from a polygon


ST_AsRaster(ST_Buffer(ST_GeomFromText('POLYGON((-30 40, -20 30, -25 20, -23 10, -30 40))', 4326), 50),ARRAY['8BUI'],ARRAY[118]);

This line is giving me an error : No function matches the given name and argument types. You might need to add explicit type casts.



Answer



You are missing pixel dimensions:


SELECT ST_AsRaster(ST_Buffer(ST_GeomFromText('POLYGON((-30 40, -20 30, -25 20, -23 10, -30 40))', 4326), 50),100,100,ARRAY['8BUI'],ARRAY[118]);

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...