I am running<br><br>create table vector_grid as<br>SELECT (gvxy).geom geom, ((gvxy).x - 1) + (gvxy).y cellid<br>FROM (SELECT ST_PixelAsPolygons(<br>    ST_MakeEmptyRaster( 423152, 361936,<br>               ST_X(ST_Transform(ST_SetSRID(ST_Point(8.07734039737749, 57.7505109647578),4326),32632)),<br>
               ST_Y(ST_Transform(ST_SetSRID(ST_Point(8.07734039737749, 57.7505109647578),4326),32632)),<br>               16,16,0,0, 32632) ) gvxy) foo;<br><br>to get a "16 mt by 16 mt" grid. I calculated the height and width in meters. And I should approximately get 0.5 billion polygons!<br>
Y'day your calculation for 4x4 m^2 was saying 25 million polygons. Am not sure how you got that? Am I doing something wrong<br>by projecting it to UTM coordinates first to compute euclidean height and width?<br><b>I also get error --> NOTICE:  Raster do not have band 1. Returning null values<br>
</b><br><br><div class="gmail_quote">On Fri, Mar 23, 2012 at 2:05 PM, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">> I have a bounding box with the dimensions below.<br>
> "BOX(8.07734039737749 54.4984986588244,15.1919565742587<br>
> 57.7505109647578)"<br>
> I now want to make an empty raster using ST_MakeEmptyRaster, but I am not<br>
> sure about a few params. So maybe someone can help me?<br>
><br>
> raster ST_MakeEmptyRaster(integer width, integer height,<br>
>                                               float8 upperleftx, float8 upperlefty,<br>
>                                                   float8 scalex, float8 scaley, float8 skewx, float8<br>
> skewy,<br>
>                                                      integer srid=unknown);<br>
><br>
> ST_MakeEmptyRaster( 15.1919565742587 - 8.07734039737749,<br>
> 57.7505109647578 - 54.4984986588244,<br>
>                                        8.07734039737749, 57.7505109647578,<br>
>                                            ?,?,?,? (no idea what to put in skew and scale)<br>
>                                                      4326);<br>
><br>
> I am hoping that using the degrees in height, width calculations is ok?<br>
<br>
</div></div>Maybe it's would time for you to read a bit of the documentation...<br>
<br>
<a href="http://postgis.org/documentation/manual-svn/RT_ST_MakeEmptyRaster.html" target="_blank">http://postgis.org/documentation/manual-svn/RT_ST_MakeEmptyRaster.html</a><br>
<br>
scale is the pixel size. skew is the rotation (kind of).<br>
<br>
Read this as well:<br>
<br>
<a href="http://en.wikipedia.org/wiki/World_file" target="_blank">http://en.wikipedia.org/wiki/World_file</a><br>
<br>
Pierre<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br>